Best practices of URDF/Xacro modeling
Here are some best practices and tips for developing a robot model using URDF/Xacro:
- Use Xacro for modeling: As you know, Xacro provides more flexibility than URDF. It increases modularity and also enables code reuse. So, Xacro is the best choice for starting robot modeling in ROS 2.
- Follow REP (ROS Enhancement Proposals) conventions: Use REP [25] to name the links and joints in URDF.
- Follow the modular design of models: Split the robot model into macros, which can be kept inside separate Xacro files and organized inside a package properly.
- Use the proper naming convention: Using proper naming for joints and links avoids complexity in the URDF modeling.
- Use TF prefixing: It is important to use prefixes in Xacro in case you want to use multiple sensors at the same time or multiple robots. For example, in this macro definition,
<xacro:macro name="sensor_macro" params="prefix">
, we can...