Hi Alban,
The initial desired joint positions of the iCub seem to be actually set in an initialization plugin:
$HBP/GazeboRosPackages/src/icub_initialization/src/icub_initialization.cpp
That’s the reason that it goes to that initial pose with its arms up form the neutral position, since you now have gravity disabled and don’t really care about the robot balancing, you don’t really need that pose.
There are two things you can try, edit the plugin file above and comment out this block:
/*if (("l_shoulder_pitch" == it->second->GetName()) || ("r_shoulder_pitch" == it->second->GetName()))
this->jointControl->SetPositionTarget(it->first, -0.52);
else if (("l_shoulder_roll" == it->second->GetName()) || ("r_shoulder_roll" == it->second->GetName()))
this->jointControl->SetPositionTarget(it->first, 0.52);
else if (("l_elbow" == it->second->GetName()) || ("r_elbow" == it->second->GetName()))
this->jointControl->SetPositionTarget(it->first, 0.785);
else if (("l_wrist_yaw" == it->second->GetName()) || ("r_wrist_yaw" == it->second->GetName()))
this->jointControl->SetPositionTarget(it->first, 0.698);
else*/
that will ensure the iCub doesn’t make any large movements to that intiial arms up pose. You’ll need to run:
catkin_make
in GazeboRosPackages after editing that file to rebuild the plugin. You can also set custom targets, I tested that and the movement is really minimal. Let me know if that is good enough and I can file a bug to make the plugin more flexible so you can specify those pose values in the SDF.
If that is still too much movement (in my testing the robot shoulder joints move very slightly but that doesn’t seem to have any impact on the head/camera view), we may be able to mess around with the SDF some more to change the intertia/stiffness of just the neck or shoulder joints to prevent that kind of tiny movement. You could also mess around with the PID controller parameters in the plugin, but that’s much more work.
Kenny