Using constants

We use constants inside this xacro to make robot descriptions shorter and more readable. Here, we define the degree to the radian conversion factor, PI value, length, height, and width of each of the links:

  <property name="deg_to_rad" value="0.01745329251994329577"/> 
  <property name="M_PI" value="3.14159"/> 
  <property name="elbow_pitch_len" value="0.22" /> 
  <property name="elbow_pitch_width" value="0.04" /> 
  <property name="elbow_pitch_height" value="0.04" /> 

Get Mastering ROS for Robotics Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.