Ask Your Question
2

Controlling robots in gazebo without using gazebo plugins [closed]

asked 2015-03-21 00:47:18 -0500

SVS gravatar image

Is there a way to control robot models in gazebo by using external controller? I know usually it is controlled using plugins which we are adding in urdf file.

I mean, without using a gazebo control plugin is there a way to control robot model?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by SVS
close date 2016-07-13 08:55:40.762265

Comments

I'm interested in the answer too. I would ask on Gazebo's forum http://answers.gazebosim.org/questions/

130s gravatar image130s ( 2015-03-21 03:12:09 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2015-03-21 08:01:00 -0500

lucasw gravatar image

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?

edit flag offensive delete link more

Comments

Thank u lucasw. It is useful.

SVS gravatar imageSVS ( 2015-03-21 10:14:59 -0500 )edit

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 } } })
FabianD gravatar imageFabianD ( 2017-12-20 22:53:58 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2015-03-21 00:47:18 -0500

Seen: 428 times

Last updated: Mar 21 '15