Robotics StackExchange | Archived questions

spawn_model initial positions are temporary

I'm launching my robot with:

<node name="lander_model" pkg="gazebo_ros" type="spawn_model" output="screen"
args="-urdf -param robot_description -model lander -J j_shou_yaw -1.5708
-J j_shou_pitch 1.5708 -J j_prox_pitch -2.7 -J j_dist_pitch 3" />

The model starts with joints set to the initial positions I specified with -J, but they immediately spring back to their origin poses as described in my URDF. Each of my joints is wired up with an effort_controllers/JointPositionController. Is there a way to get these joints to hold the specified initial positions? I don't want them to move until I command their controllers.

Asked by mogumbo on 2019-02-28 12:12:47 UTC

Comments

Answers

The only solution I have found is to start gazebo paused and then use spawn_model's -unpause option to unpause it. This apparently delays some functions of Gazebo such that controllers absorb the specified joint positions instead of starting at zero.

I found this solution here: https://answers.ros.org/question/216420/initial-joint-angles/ This is very hacky, and it would be great if there was a more elegant solution. Does anyone have any idea how to improve this?

Asked by mogumbo on 2019-03-22 12:53:51 UTC

Comments