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

cant load 2 description files to visualize 2 models in Rviz

asked 2020-10-28 05:25:00 -0500

yogev gravatar image

Hi I tried to load 2 models in Rviz without success.

when I load each model on Rviz Seperately It works fine.

But when I try to load them together the robot_state_publisher pkg wont load the description file with the param name "robot_description2"

what can I do to visualize the 2 robots in Rviz together?

heres launch file:

<launch>

  <param name="robot_description" command="$(find xacro)/xacro.py '$(find manipulator_h_description)/urdf/manipulator_h1.xacro'" />
  <param name="robot_description2" command="$(find xacro)/xacro.py '$(find manipulator_h_description)/urdf/manipulator_h2_rviz.xacro'" />


  <!-- Combine joint values -->
  <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher">
 <param name="tf_prefix" type="string" value="first" />
  </node>

<node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher2">
 <param name="tf_prefix" type="string" value="second" />
  </node>


  <node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher2">
    <param name="use_gui" value="TRUE"/>
   </node>

<node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher2">
    <param name="use_gui" value="TRUE"/>
   </node>



</launch>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-10-30 05:33:47 -0500

Weasfas gravatar image

Hi @yogev

In order to achieve what you want you will need to lauch each individual robot description in different namespaces. Here is a quick introduction for ROS names.

It would be something like:

<?xml version="1.0"?>
<launch>
<group ns="robot1">
    <param name="robot_description" command="$(find xacro)/xacro.py '$(find manipulator_h_description)/urdf/manipulator_h1.xacro'" />
    <node pkg="robot_state_publisher" type="state_publisher" name="rst_robot1" />
    <node pkg="joint_state_publisher" type="joint_state_publisher" name="jsp_robot1">
        <param name="use_gui" value="TRUE"/>
    </node>
</group>

<group ns="robot2">
    <param name="robot_description2" command="$(find xacro)/xacro.py '$(find manipulator_h_description)/urdf/manipulator_h2_rviz.xacro'" />
    <node pkg="robot_state_publisher" type="state_publisher" name="rst_robot2" />
    <node pkg="joint_state_publisher" type="joint_state_publisher" name="jsp_robot2">
        <param name="use_gui" value="TRUE"/>
    </node>
</group>
</launch>

Hope this can help you.

Regards.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-10-28 05:18:58 -0500

Seen: 67 times

Last updated: Oct 30 '20