ROS tests with robot description

I am not sure if this is what you are looking for… but I created generic xacro files for testing description of different components in our lab.

I call this script with different parameters from a roslaunch test file. this is just test for parsing and if you want one can test also the description in rviz.

<?xml version="1.0"?>
<launch>
    <arg name="type" default="tools"/>
    <arg name="object_to_test" default="measurement_tool"/>

  <!-- send urdf to param server -->
  <param name="object_description" command="$(find xacro)/xacro --inorder '$(find iirob_description)/$(arg type)/urdf/$(arg object_to_test)/test_$(arg object_to_test).urdf.xacro'"/>

  <!-- robot state publisher -->
  <node pkg="robot_state_publisher" type="robot_state_publisher" name="tool_state_publisher">
      <param name="publish_frequency" type="double" value="50.0" />
      <remap from="robot_description" to="object_description" />
  </node>

  <node pkg="rviz" type="rviz" args="-d $(find iirob_description)/common/rviz/test_objects.rviz" name="test_objects" required="true">
  </node>

</launch>

If you want to test robots with non-static joints you could use something like this:

<?xml version="1.0"?>
<launch>

  <arg name="pkg" default="iirob_kuka_bringup"/>
  <arg name="file_name" default="r5"/>

  <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find iirob_kuka_bringup)/urdf/$(arg file_name).urdf.xacro'" />

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

  <!-- robot state publisher -->
  <node pkg="robot_state_publisher" type="robot_state_publisher" name="tool_state_publisher">
      <param name="publish_frequency" type="double" value="50.0" />
  </node>

  <node name="test_robots" pkg="rviz" type="rviz" args="-d $(find iirob_description)/common/rviz/test_robots.rviz" />

</launch>

I hope this can help you further…

2 Likes