Robotics StackExchange | Archived questions

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

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

Asked by tom_3997 on 2023-06-29 06:16:15 UTC

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.

Asked by Mike Scheutzow on 2023-07-03 09:11:34 UTC

Answers