URDF parsing and writing
RigidBodyDynamics.URDF.default_urdf_joint_types
— Functiondefault_urdf_joint_types()
Default mapping from URDF joint type name to JointType
subtype used by parse_urdf
.
RigidBodyDynamics.URDF.parse_urdf
— Functionparse_urdf(filename; scalar_type, floating, joint_types, root_joint_type, remove_fixed_tree_joints, gravity, revolute_joint_type, floating_joint_type)
Create a Mechanism
by parsing a URDF file.
Keyword arguments:
scalar_type
: the scalar type used to store theMechanism
's kinematic and inertial properties. Default:Float64
.floating
: whether to use a floating joint as the root joint. Default: false.joint_types
: dictionary mapping URDF joint type names toJointType
subtypes. Default:default_urdf_joint_types()
.root_joint_type
: theJointType
instance used to connect the parsedMechanism
to the world. Default: an instance of the the joint type corresponding to thefloating
URDF joint type tag iffloating
, otherwise in an instance of the joint type for thefixed
URDF joint type tag.remove_fixed_tree_joints
: whether to remove any fixed joints present in the kinematic tree usingremove_fixed_tree_joints!
. Default:true
.gravity
: gravitational acceleration as a 3-vector expressed in theMechanism
's root frame Default:[0.0, 0.0, -9.81]
.
RigidBodyDynamics.URDF.write_urdf
— FunctionSerialize 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 Mechanism
s do not store the required information to write these tags.
Keyword arguments:
robot_name
: used to set thename
attribute of the root<robot>
tag in the URDF. Default:nothing
(name attribute will not be set).include_root
: whether to includeroot_body(mechanism)
in the URDF. Iffalse
, joints withroot_body(mechanism)
as their predecessor will also be omitted. Default:true
.