[−][src]Function k::urdf::link_to_joint_map
pub fn link_to_joint_map(urdf_robot: &Robot) -> HashMap<String, String>
Useful function to deal about 'Links' of URDF
k
deals only Joint
s of URDF. But links is connected
to joint always, it is easily find which joint is the
parent of the link.
Examples
extern crate urdf_rs; extern crate k; 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());