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

Revision history [back]

click to hide/show revision 1
initial version

With help from a colleague:

When a xacro property is read from a yaml file, it is in a dictionary format.

When used for xacro calculations, the parameter needs to be extracted from the dictionary:

<?xml version="1.0"?>
<robot name="robot_name" xmlns:xacro="http://ros.org/wiki/xacro">
  <xacro:property name="a" value="${load_yaml('robot_parameters.yaml')}" />

  <link name="left_front_wheel_link">
    <visual>
      <origin xyz="0.123 0.456 0.101" rpy="${a['PI']/2} 0 0" />
      <geometry>
        <cylinder radius="0.101" length = "0.0254"/>
      </geometry>
    </visual>
  </link>
</robot>