URDF parsing and writing

URDF parsing and writing

parse_urdf(filename; scalar_type, floating, floating_joint_type, revolute_joint_type, root_joint_type, remove_fixed_tree_joints, gravity)

Create a Mechanism by parsing a URDF file.

Keyword arguments:

  • scalar_type: the scalar type used to store the Mechanism's kinematic and inertial properties. Default: Float64.
  • floating: whether to use a floating joint as the root joint. Default: false.
  • floating_joint_type: what JointType to use for floating joints. Default: QuaternionFloating{scalar_type}.
  • revolute_joint_type: what JointType to use for revolute joints. Default: Revolute{scalar_type}.
  • root_joint_type: the joint type used to connect the parsed Mechanism to the world. Default: floating_joint_type() if floating, Fixed{scalar_type}() otherwise.
  • remove_fixed_tree_joints: whether to remove any fixed joints present in the kinematic tree using remove_fixed_tree_joints!. Default: true.
  • gravity: gravitational acceleration as a 3-vector expressed in the Mechanism's root frame. Default: [0.0, 0.0, -9.81].
source

Serialize a Mechanism to the URDF file format.

Limitations:

  • for <link> tags, only the <inertial> tag is written; there is no support for <visual> and <collision> tags.
  • for <joint> tags, only the <origin>, <parent>, <child>, and <limit> tags are written. There is no support for the <calibration> and <safety_controller> tags.

These limitations are simply due to the fact that Mechanisms do not store the required information to write these tags.

Keyword arguments:

  • robot_name: used to set the name attribute of the root <robot> tag in the URDF. Default: nothing (name attribute will not be set).
  • include_root: whether to include root_body(mechanism) in the URDF. If false, joints with root_body(mechanism) as their predecessor will also be omitted. Default: true.
source