Robot description · repose-robot-description

Apply an SRDF

An SRDF adds semantics to a URDF: which joints form the arm, which link pairs never need checking, and named poses like "home". Repose uses all three for a single serial group.

Import with a group

rust
let robot = CuRobotDescription::<6, 16>::from_urdf_srdf(
    urdf_xml,
    srdf_xml,
    CuSrdfImport::new("manipulator"),
)?;

The group must describe exactly one serial base-to-tip chain (a <chain> element). Composed groups made of other groups are rejected. The URDF and SRDF must name the same robot.

Already imported from a URDF? robot.apply_srdf(srdf_xml, "manipulator")? applies the same semantics afterwards.

Disabled collision pairs

Every <disable_collisions link1=".." link2=".."/> between links of the group disables the matching shape pairs in the collision model. This is how adjacent-link contact and other never-colliding pairs (MoveIt's setup assistant generates this list) carry over, so you don't have to rely on the blunt skip_adjacent_links rule.

Named states

rust
let mut home = [CuJointPosition::default(); 6];
robot.write_named_state("home", &mut home)?;

<group_state> entries for the group become named configurations you can copy into typed joint arrays at startup, for program start positions, planner goals and tests. A state must set every joint of the group, only joints of the group, and respect their limits; otherwise import fails.

Full example

The serial_robot example imports a mixed revolute/prismatic arm, reads two named states, round-trips FK and IK, checks the result for collisions, and plans between the states with RRT*:

rust
let robot = CuRobotDescription::<2, 6>::from_urdf_srdf(urdf, srdf,
    CuSrdfImport::new("manipulator").with_collision(CuCollisionModelParams {
        safety_margin: Length::new::<meter>(0.005),
        skip_adjacent_links: false,
    }))?;

let (mut start, mut goal) = ([CuJointPosition::default(); 2], [CuJointPosition::default(); 2]);
robot.write_named_state("home", &mut start)?;
robot.write_named_state("reach", &mut goal)?;
// … FK/IK, collision check, then plan start → goal

API reference