Robotics StackExchange | Archived questions

How to create multiple instances of robot from single urdf file?

How can I create multiple instances of robot from single urdf file?

Asked by cybodroid on 2015-12-10 04:40:07 UTC

Comments

If you mean in simulation, just spawn them many times. The best practice is to have the corresponding launchfile section within a namespace.

Asked by Javier V. Gómez on 2015-12-10 05:18:05 UTC

I think javier means that you can have a single URDF on the parameter server under multiple names (likely separated by namespaces). If each parameter has corresponding joint state information available (and a robot_state_publisher) then they will all be viewable in rviz.

Asked by jarvisschultz on 2015-12-10 07:35:35 UTC

Alternatively, if you are interested in creating a single URDF that contains multiple instances of another URDF check out xacro. An example use case would be if you have a URDF for a robot arm, and you are interested in a robot that has two of these arms.

Asked by jarvisschultz on 2015-12-10 07:37:45 UTC

Yes, that is what I mean @jarvisschultz :)

Asked by Javier V. Gómez on 2015-12-10 07:56:32 UTC

I tried to spawn, following the tutorial on http://gazebosim.org/tutorials/?tut=ros_roslaunch I used the following command:rosrun gazebo_ros spawn_model -file rospack find azcar_sim/urdf/azcar.xacro -urdf -x 0 -y 0 -z 1 -model azcar_sim

But the output comes as model already exists. (1/2)

Asked by cybodroid on 2015-12-12 05:31:12 UTC

Note that, one model is already there on gazebo that has been spawned using model database by writing in launch file. (2/2)

Asked by cybodroid on 2015-12-12 05:32:30 UTC

Answers