ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

can't spawn 2 bins in gazebo

asked 2021-12-30 11:19:51 -0600

umar_anjum gravatar image

updated 2022-01-31 08:37:02 -0600

lucasw gravatar image

Hi all hope you al are fine.

I am using Ubuntu 16.04 LTS and ROS Kinetic version. I am working on UR5 robot simulation in Gazebo for which I made a custom catkin space and my own pkg named "ur5_custom" in this pkg I made launch file "custom_initialize.launch file" in which I am using the following:

node name="bin" pkg="gazebo_ros" type="spawn_model" args="-file $(find ur5_notebook)/urdf/bin.urdf -urdf -model bin -y 0.8 -x -0.5 -z 0.05"

node name="bin1" pkg="gazebo_ros" type="spawn_model" args="-file $(find ur5_notebook)/urdf/bin1.urdf -urdf -model bin -y 1 -x -1.5 z 0.05"

This is to spawn 2 bin in gazebo but it is not working. I received the following error: I have tried same name different names, same urdf files and different(duplicate) URDF files also but no success at all. please tell me how to spawn 2 same objects at different positons in gazebo using a single URDF file.

Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2022-01-01 05:36:05 -0600

umar_anjum gravatar image

This issue was resolved by adding a URDF directory in my workspace package and putting in box.urdf in it, where as it was in an other workspce in another package from which I was accessing it. probably that was the problem. This is the piece of code I used instead of the above:

node name="bin" pkg="gazebo_ros" type="spawn_model" args="-file $(find ur5_notebook)/urdf/bin.urdf -urdf -model bin -y 0.8 -x -0.5 -z 0.05"

node name="bin1" pkg="gazebo_ros" type="spawn_model" args="-file $(find ur5_notebook)/urdf/bin.urdf -urdf -model bin1 -y 1 -x -1.5 -z 0.05"

node name is different also name just after -model before describing its coordinates.

edit flag offensive delete link more
1

answered 2021-12-31 06:18:02 -0600

ljaniec gravatar image

In your second piece of code you don't have a minus next to z. There are no error pasted too. Can you add it?

By this only the name of the models should differ. You can use the same URDF many times. Does the part with $(find ur5_notebook) work correctly too? Can you try your launch file with the URDF file in the same folder?

edit flag offensive delete link more

Comments

1

I must have missed the - with z in the 2nd line of code but I have tried code with -z 0.05 too.

there are actually no errors just an error saying can't create a node of type spawn_model.

This code is creating 1 bin so I assume $(find ur5_notebook) is working as it is creating a bin.

I will try launching urdf within same folder havent yet tried that.

umar_anjum gravatar image umar_anjum  ( 2022-01-01 02:45:27 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2021-12-30 11:19:51 -0600

Seen: 115 times

Last updated: Jan 01 '22