Difference between revisions of "BaseManipulation"
Constantin (Talk | contribs) (Created page with "== Code Examples == === Setting A Robots Manipulators To Default === <pre> baseManip = RaveCreateModule(penv, "BaseManipulation"); if(baseManip == NULL) { ROS_FATAL("Was unable...") |
|||
Line 1: | Line 1: | ||
== Code Examples == | == Code Examples == | ||
=== Setting A Robots Manipulators To Default === | === Setting A Robots Manipulators To Default === | ||
− | < | + | <source lang="cpp"> |
baseManip = RaveCreateModule(penv, "BaseManipulation"); | baseManip = RaveCreateModule(penv, "BaseManipulation"); | ||
if(baseManip == NULL) | if(baseManip == NULL) | ||
Line 23: | Line 23: | ||
baseManip->SendCommand(soutput, sinput); | baseManip->SendCommand(soutput, sinput); | ||
} | } | ||
− | </ | + | </source> |
Latest revision as of 17:30, 29 November 2011
Code Examples
Setting A Robots Manipulators To Default
<source lang="cpp"> baseManip = RaveCreateModule(penv, "BaseManipulation"); if(baseManip == NULL) { ROS_FATAL("Was unable to create module BaseManipulation. Check your $OPENRAVE_PLUGINS\n"); return false; } penv->AddModule(baseManip, myRobot->GetName()); //Move our manipulators to default positions so they don't fall with physics... stringstream sinput, soutput; for(vector<RobotBase::ManipulatorPtr>::const_iterator myIt = myRobot->GetManipulators().begin(); myIt != myRobot->GetManipulators().end(); myIt++) { sinput.clear(); sinput.str(""); sinput << "MoveManipulator goal"; for(unsigned int i = 0; i < (*myIt)->GetArmIndices().size(); i++) sinput << " 0";
myRobot->SetActiveManipulator((*myIt)->GetName()); baseManip->SendCommand(soutput, sinput); } </source>