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

asked 2015-12-10 03:40:07 -0500

cybodroid gravatar image

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

edit retag flag offensive close merge delete

Comments

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

Javier V. Gómez gravatar image Javier V. Gómez  ( 2015-12-10 04:18:05 -0500 )edit

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.

jarvisschultz gravatar image jarvisschultz  ( 2015-12-10 06:35:35 -0500 )edit

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.

jarvisschultz gravatar image jarvisschultz  ( 2015-12-10 06:37:45 -0500 )edit

Yes, that is what I mean @jarvisschultz :)

Javier V. Gómez gravatar image Javier V. Gómez  ( 2015-12-10 06:56:32 -0500 )edit

I tried to spawn, following the tutorial on http://gazebosim.org/tutorials/?tut=r... 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)

cybodroid gravatar image cybodroid  ( 2015-12-12 04:31:12 -0500 )edit

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

cybodroid gravatar image cybodroid  ( 2015-12-12 04:32:30 -0500 )edit