Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

simplest multiple-robot scenario

Was having trouble getting multiple robots to work, so I tried to boil it down to the simplest possible scenario. Here's what I have for a launch file:

<?xml version="1.0" encoding="utf-8"?>
<launch>
  <group ns="ns0">
    <param name="robot_description" command="cat '$(find urdf_tutorial)/urdf/01-myfirst.urdf'"/>
    <node name="my_stp" pkg="tf" type="static_transform_publisher" args="-1 0 0 0 0 0 /map base_link 100"/>
    <node name="my_jsp" pkg="joint_state_publisher" type="joint_state_publisher"/>
    <node name="my_rsp" pkg="robot_state_publisher" type="state_publisher"/>
  </group>

  <group ns="ns1">
    <param name="robot_description" command="cat '$(find urdf_tutorial)/urdf/02-multipleshapes.urdf'"/>
    <node name="my_stp" pkg="tf" type="static_transform_publisher" args="1 0 0 0 0 0 /map base_link 100"/>
    <node name="my_jsp" pkg="joint_state_publisher" type="joint_state_publisher"/>
    <node name="my_rsp" pkg="robot_state_publisher" type="state_publisher"/>
  </group>

  <node name="rviz" pkg="rviz" type="rviz" respawn="false" output="screen" args="-d $(find xxx)/config/xxx.rviz"/>
</launch>

And my xxx.rviz is the same as default.rviz with the addition of two RobotModels:

- Alpha: 1
      Class: rviz/RobotModel
      Collision Enabled: false
      Enabled: true
      Links:
        All Links Enabled: true
        Expand Joint Details: false
        Expand Link Details: false
        Expand Tree: false
        Link Tree Style: Links in Alphabetic Order
      Name: RobotModel
      Robot Description: ns0/robot_description
      TF Prefix: ""
      Update Interval: 0
      Value: true
      Visual Enabled: true
    - Alpha: 1
      Class: rviz/RobotModel
      Collision Enabled: false
      Enabled: true
      Links:
        All Links Enabled: true
        Expand Joint Details: false
        Expand Link Details: false
        Expand Tree: false
        Link Tree Style: ""
      Name: RobotModel
      Robot Description: ns1/robot_description
      TF Prefix: ""
      Update Interval: 0
      Value: true
      Visual Enabled: true

I would expect this to show 01-myfirst.urdf at position (-1,0,0) and 02-multipleshapes.urdf at position (1,0,0). However, it shows 02-multipleshapes.urdf flickering back and forth between the two positions. 01-myfirst.urdf is not shown at all. Can anyone explain what I'm missing?

simplest multiple-robot scenario

Was having trouble getting multiple robots to work, so I tried to boil it down to the simplest possible scenario. Here's what I have for a launch file:

<?xml version="1.0" encoding="utf-8"?>
<launch>
  <group ns="ns0">
    <param name="robot_description" command="cat '$(find urdf_tutorial)/urdf/01-myfirst.urdf'"/>
    <node name="my_stp" pkg="tf" type="static_transform_publisher" args="-1 0 0 0 0 0 /map base_link 100"/>
    <node name="my_jsp" pkg="joint_state_publisher" type="joint_state_publisher"/>
    <node name="my_rsp" pkg="robot_state_publisher" type="state_publisher"/>
  </group>

  <group ns="ns1">
    <param name="robot_description" command="cat '$(find urdf_tutorial)/urdf/02-multipleshapes.urdf'"/>
    <node name="my_stp" pkg="tf" type="static_transform_publisher" args="1 0 0 0 0 0 /map base_link 100"/>
    <node name="my_jsp" pkg="joint_state_publisher" type="joint_state_publisher"/>
    <node name="my_rsp" pkg="robot_state_publisher" type="state_publisher"/>
  </group>

  <node name="rviz" pkg="rviz" type="rviz" respawn="false" output="screen" args="-d $(find xxx)/config/xxx.rviz"/>
</launch>

And my xxx.rviz is the same as default.rviz with the addition of two RobotModels:

- Alpha: 1
      Class: rviz/RobotModel
      Collision Enabled: false
      Enabled: true
      Links:
        All Links Enabled: true
        Expand Joint Details: false
        Expand Link Details: false
        Expand Tree: false
        Link Tree Style: Links in Alphabetic Order
      Name: RobotModel
      Robot Description: ns0/robot_description
      TF Prefix: ""
      Update Interval: 0
      Value: true
      Visual Enabled: true
    - Alpha: 1
      Class: rviz/RobotModel
      Collision Enabled: false
      Enabled: true
      Links:
        All Links Enabled: true
        Expand Joint Details: false
        Expand Link Details: false
        Expand Tree: false
        Link Tree Style: ""
      Name: RobotModel
      Robot Description: ns1/robot_description
      TF Prefix: ""
      Update Interval: 0
      Value: true
      Visual Enabled: true

I would expect this to show 01-myfirst.urdf at position (-1,0,0) and 02-multipleshapes.urdf at position (1,0,0). However, it shows 02-multipleshapes.urdf flickering back and forth between the two positions. 01-myfirst.urdf is not shown at all. Can anyone explain what I'm missing?