Function k::urdf::link_to_joint_map

source ·
pub fn link_to_joint_map(urdf_robot: &Robot) -> HashMap<String, String>
Expand description

Useful function to deal about ‘Links’ of URDF

k deals only Joints of URDF. But links is connected to joint always, it is easily find which joint is the parent of the link.

Examples

let urdf_robot = urdf_rs::read_file("urdf/sample.urdf").unwrap();
let map = k::urdf::link_to_joint_map(&urdf_robot);
assert_eq!(map.get("root_body").unwrap(), k::urdf::ROOT_JOINT_NAME);
assert_eq!(map.get("r_wrist2").unwrap(), "r_wrist_pitch");
assert!(map.get("no_exist_link").is_none());