You can do non-physical movements like this:
rostopic pub -1 /gazebo/set_model_state gazebo_msgs/ModelState '{model_name: testbot, pose: { position: { x: -0.32, y: 0, z: 2.1 }, orientation: {x: 0.0, y: 0.0, z: -0.766, w: 0.643 } }, reference_frame: world }'
It's okay for setting model positions while time is stopped but intersecting two things will explode the sim. It might be better to set velocities instead of positions but the model state has both, so any publish is going to overwrite both (in my example the velocities are going to be zero by default). More advanced stuff can be done with GazeboJS, but C++ plugins are going to be the most powerful.
The rawest controller plugins are the effort ones, in order to achieve a position you would have to write your own controller around them. Are those not usable for your application?
Originally posted by lucasw with karma: 8729 on 2015-03-21
This answer was ACCEPTED on the original site
Post score: 3
Original comments
Comment by SVS on 2015-03-21:
Thank u lucasw. It is useful.
Comment by FabianD on 2017-12-20:
For reference, wth gazebojs and gazebo8 it would the equivalent would be:
gazebo.publish('gazebo.msgs.Model', '/gazebo/default/model/modify', {name: 'testbot, pose: { position: { x: -0.32, y: 0, z: 2.1 }, orientation: {x: 0.0, y: 0.0, z: -0.766, w: 0.643 } } })