multiple robots in rviz with different urdfs - robot models not showing

asked 2018-10-02 09:29:31 -0600

canatan gravatar image

updated 2022-05-19 02:39:26 -0600

Andromeda gravatar image

I have a stage simulation with four robots. I wanted to add robot models to the rviz visualization. I was able to add a single urdf for all the robot models easily using:

 <param name="robot_description" command="cat $(arg urdf_file)"/>

in the launch file before the individual robot namespaces were defined. (https://answers.ros.org/question/4143...)

However when I do the following:

 <group ns="$(arg robot_id)"> 
<!-- set robot model--> 

<param name="tf_prefix" value="$(arg robot_id)"/>
<arg name="urdf_file" default="$(find multi_rob_sim)/models/$(arg robot_id)_model.urdf"/>

I can't see any of the robotmodels in rviz. I checked if the urdf was loaded using a rosparam get $robot_id/robot_description and it had the right urdfs. My urdfs for now are really simple - (since the robots in stage are just circles too)

 <?xml version="1.0"?>
 <robot name="robot_0">
 <link name="base_link">
  <visual>
  <geometry>
       <cylinder length="0.6" radius="1.0"/>
      </geometry>
     </visual>
    </link>
  </robot>

I don't understand why the robot models are not being displayed in rviz using this method. (https://answers.ros.org/question/2634...) uses a similar method.

edit retag flag offensive close merge delete

Comments

Did you fix this problem?

Andromeda gravatar image Andromeda  ( 2021-07-16 09:34:50 -0600 )edit

No but someone had a stage simulation that I ended up using.

canatan gravatar image canatan  ( 2022-02-04 04:33:26 -0600 )edit

Maybe is a stupid question, but did you check, whether your LC_NUMERIC en.EN_UTF-8 is? If not, the URDF file is not going to be parsed

Andromeda gravatar image Andromeda  ( 2022-05-19 02:40:44 -0600 )edit