Hi all, I am trying to create a custom environment for my UR5e robot and having a little bit of a problem understanding the file structure.
- I would like to have a fixed, not moving object around 1 meter away from the UR
- I want to see both the robot and my fixed object in Gazebo and RViz setups
So far, I have extracted the CAD model of my object in .stl format, and created a URDF file where I read that .stl file and I am able to spawn the object both in Gazebo and RViz.
My question is merging that URDF file with the UR setup.
Both xacro files here says that they should not be modified: https://github.com/fmauch/universal_robot/tree/calibration_devel/ur_gazebo/urdf
How can I merge them together with my new URDF file?
Where should I call that new xacro file? Here? https://github.com/fmauch/universal_robot/blob/calibration_devel/ur_gazebo/launch/inc/load_ur.launch.xml#L33
Is that correct/normal that the new object will be a part of robot_description or should I see robot_description and object_description separately? Since my object is not attached to the robot but rather something that should spawn in the environment, it didn't feel quite correct that it is a part of the robot_description.
I am using ROS Noetic with Ubuntu 20.04
Thank you in advance
Originally posted by rosberrypi on ROS Answers with karma: 75 on 2022-01-18
Post score: 0
Original comments
Comment by aarsh_t on 2022-01-18:
you can try editing this file and use something like this
<node name="spawn_model" pkg="gazebo_ros" type="spawn_model"
args=" -file /path/to/urdf_file/with/stl -urdf
-x 0 -y 0 -z 0 -model model_name"
respawn="false" output="screen"/>
Comment by rosberrypi on 2022-01-20:
Thank you for the answer. I am able to spawn the object in gazebo like this, however how do I also attach it to RViz and let the robot know not to plan a path that intersects with that object?
Comment by aarsh_t on 2022-01-20:
one simple way I can suggest is to use parameter such as <param name="/object/robot_description" textfile=" /path/to/urdf_file" />
and then in rviz add new robotModel with topic /object/robot_description
.
For the rviz to know the object you might need to put some sensors or you can remove that part from the robot's workspace. I haven't used universal_robot package focusing this problem so I won't be able to comment on that. Perhaps its a good idea to raise new question for that rather than asking in comments.