Closed jimmybaraglia closed 7 years ago
Hi Jimmy,
Hope you're doing well 😄
Take a look at this snippet. It basically steers the robot back to a given pose but first specifies that the torso angles are required to be always equal to 0.0 [deg]
(or any other suitable home configuration).
This way, you'll bypass the IK service and at the same time ask the Cartesian controller to account for the torso as well. Once done, the normal behavior gets restored by means of context switching.
Hi Ugo,
I am doing good. How about you?
It worked like a charm, thank you for the link to the code. I updated my code as follows:
void actionRepertoire::go_home(ICartesianControl *ctrl, Vector home_pos, Vector home_rot){
//Create & store the contect
int context;
ctrl->storeContext(&context);
//Set new DoF for contect
Vector dof;
ctrl->getDOF(dof); dof=1.0;
ctrl->setDOF(dof,dof);
//Set limits
ctrl->setLimits(0,0.0,0.0);
ctrl->setLimits(1,0.0,0.0);
ctrl->setLimits(2,0.0,0.0);
//Motion time = 3 seconds
ctrl->setTrajTime(3);
//Go to pose
ctrl->goToPose(home_pos, home_rot);
ctrl->waitMotionDone(0.1,4);
//Restore the previous context
ctrl->restoreContext(context);
ctrl->deleteContext(context);
}
Cheers, Jimmy Baraglia
I'm the same old 😉 Glad to know it helped.
Hi,
I am using the ICartesianControl to set the hands of the robot at certain position. Once the motion is done, I want the robot to come back to its initial resting position. The torso is activated for both cartesianCtrl:
To go back to
home(resting)
position, I save at start the position and orientation of each arms:Then, after moving to the desired position (with the right_arm and/or the left_arm), I try to go back to the home position:
However, this method does not work so well as the calculated inverse kinematic for each home position set the torso to different positions.
My question is: is there any simple way to tell iCub to come back to its initial
home(resting)
position?Thank you in advance, Jimmy Baraglia