25 for (
const auto &jsEl : jp) {
26 output <<
"\t\t"<<jsEl.first <<
" : ";
27 for(
const auto &jValue : jsEl.second){
28 output << jValue <<
", ";
30 output.seekp (-2, output.cur);
38 return jp *= multiplier;
43 return jp *= multiplier;
48 for (
auto &jsEl : jp) {
49 for (
int i = 0; i< jsEl.second.size(); i++) {
50 jsEl.second.at(i) *= multiplier;
68 for (
auto &jsEl : jp1) {
69 if (jsEl.second.size() != jp2.at(jsEl.first).size() ) {
70 throw "Dofs not same";
73 for (
int i = 0; i < jsEl.second.size(); i++) {
74 jsEl.second.at(i) += jp2.at(jsEl.first).at(i);
82 for (
const auto &jicEl : jic) {
83 output <<
"\t"<< jicEl.first <<
" : " << jicEl.second;
92 #define PROCESS_VAL(p) case(p): s = #p; break; 137 std::stringstream output;
138 output <<
"ActionName: " <<
name << std::endl;
141 output <<
"FingersInvolved: [";
143 output << fingName <<
", " ;
145 output.seekp (-2, output.cur);
146 output <<
"]" << std::endl;
149 output <<
"FingersInvolved: <not inserted>" << std::endl;
153 output <<
"JointsInvolvedCount: " << std::endl;;
156 output <<
"JointPos:" << std::endl;
161 std::cout << output.str();
std::string getName() const
Get the name of the action.
Type
Enum useful to discriminate each action when, for example, we want to parse a file if you change thi...
std::map< std::string, std::vector< double > > JointPos
The map to describe the position of all actuated joints.
std::map< std::string, unsigned int > JointsInvolvedCount
The map to describe, how many times a joint is set by the action.
virtual void print() const
Overridable functions, if we want to make them more action-specific.
bool keys_equal(std::map< keyType, valueType1 > const &lhs, std::map< keyType, valueType2 > const &rhs)
Return false if two maps have different keys.
JointPos operator+(JointPos jp1, JointPos jp2)
JointsInvolvedCount getJointsInvolvedCount() const
Get for jointsInvolvedCount.
std::ostream & operator<<(std::ostream &output, const JointPos jp)
operator overload for JointPos so it is easier to print
std::set< std::string > getFingersInvolved() const
Get for fingersInvolved.
JointsInvolvedCount jointsInvolvedCount
JointPos & operator*=(JointPos &jp, double multiplier)
virtual JointPos getJointPos() const =0
Get the position related to this action.
JointPos & operator+=(JointPos &jp1, ROSEE::JointPos jp2)
std::set< std::string > fingersInvolved
JointPos operator*(double multiplier, JointPos jp)