How to use a Python script to set the state of a robot urdf in Gazebo so that it stays that way?

asked 2023-06-29 06:16:15 -0500

tom_3997 gravatar image

I can change the position randomly with service('/gazebo/set_model_state) and keep it there by subscribing to (gazebo/model_states), but when I give any other commands to the robot model, it stays in the same place. If I stop subscribing (gazebo/model_states), the robot will go back to its starting point (0,0).

edit retag flag offensive close merge delete

Comments

The answer will depend on which gazebo model we are talking about. Is this a simulation of a robot arm? Are we talking about a revolute joint?

Please edit the question description to copy/paste 1) your urdf, and 2) your current python code.

You edit using the "edit" button near the end of the description. Format the urdf & code using the 101010 button.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-07-03 09:11:34 -0500 )edit