Home | Tutorials | Wiki | Issues
Ask Your Question

How can I represent a anake robot with many identical segmens in SDF?

asked 2017-07-12 16:48:04 -0600

pilotniq gravatar image

I'd like to model a snake robot consisting of many identical segments consisting of a hobby servo with a mounting bracket (having with one DOF). The modules can be attached either in a straight fashion or rotated 90 degrees, such that the axis of rotation are perpendicular to the previous axis.

I'm trying to understand how I can represent such a robot in SDF.

I tried making one segment consisting of two links, one with the servo, and the other attached to the servo's rotational axis. Such a segment then becomes one model:

image description

Then I wanted to attach models to each other with a fixed joint, but discovered that this was not possible (only links can be attached with fixed joints?).

What is a good representation of a robot like this in SDF, without having to repeat many identical links in the model file, and ideally using Gazebo's Model Editor?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-01-15 11:24:28 -0600

Duckfrost gravatar image

updated 2018-01-15 13:38:21 -0600

So first of all, its not a good idea to create this in SDF due to its repeated structure. For this model you have to use XACROS. It will also help you in the control and ROS integration.

image description

Here I leave a video tutorial explaining all you need to create it: VIDEO Tutorial

Here I've done an example code of a snake made up of eight main cylinders and seven joint cylinders. In your case it would be the same but replacing the cylinders by meshes. This snake is made so that it has 2 DOF in each "joint", having roll and pitch. It has also position control to move it around and of course the joint states are published, so that you will be able to see it in RVIZ TFs and the Robot Model.

Here I leave the code with the launches and also the control parameters. Hope it helps. Sorry for the false extensions, but here some file formats are not allowed. Launch the **init_snake.launch" in an empty world to spawn the robot with the controlers.







edit flag offensive delete link more


Cool :) The video link is broken though... Worth noting that Xacro is useful in the ROS context, but there are other more generic approaches to generating parametrized SDF, like for example using embedded Ruby: https://bitbucket.org/osrf/gazebo_models/src/605a402bd4c23232002b4a2ba7113ae885051bbe/cart_front_steer/?at=default

chapulina gravatar imagechapulina ( 2018-01-15 13:19:38 -0600 )edit

Happy you liked it ;). I think I fixed the video now. Tell me if you can see it now. Wow, cool hadn't used that system before. Are there any tutorials about Ruby embedding of SDF?

Duckfrost gravatar imageDuckfrost ( 2018-01-15 13:42:49 -0600 )edit

The video is working now, thanks! There is a brief mention of ERB on a [tutorial](http://gazebosim.org/tutorials?tut=model_structure&cat=build_robot#ModelSDF.ERB). For a more complex example including many files, randomization and command line options, see [srcsim](https://bitbucket.org/osrf/srcsim/wiki/world_generator), for example.

chapulina gravatar imagechapulina ( 2018-01-15 15:31:47 -0600 )edit

Great thanks ;). I see here some nice application for world generation where you need sdfs no doubt. Thanks ;).

Duckfrost gravatar imageDuckfrost ( 2018-01-16 01:33:38 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-07-12 16:48:04 -0600

Seen: 103 times

Last updated: Jan 15