Skip to content

Commit

Permalink
feat: Add joint mapping for six axis robot
Browse files Browse the repository at this point in the history
which is needed for unambiguous assignment of the
joint state values to the joints.
  • Loading branch information
philipp-caspers committed Oct 7, 2024
1 parent 8a6c163 commit d359f43
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/ros_message_creation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ pub fn create_joint_state_msg(
stamp: create_time_msg(),
frame_id: "base_link".to_string(),
},
name: vec!["Joint States".to_string()],
name: vec![
"joint1".to_string(),
"joint2".to_string(),
"joint3".to_string(),
"joint4".to_string(),
"joint5".to_string(),
"joint6".to_string(),
],
position: positions.lock().unwrap().to_vec(),
velocity: velocities.lock().unwrap().to_vec(),
effort: efforts.lock().unwrap().to_vec(),
Expand Down Expand Up @@ -154,7 +161,14 @@ mod tests {
stamp: Time { sec: 1, nanosec: 2 },
frame_id: "base_link".to_string(),
},
name: vec!["Joint States".to_string()],
name: vec![
"joint1".to_string(),
"joint2".to_string(),
"joint3".to_string(),
"joint4".to_string(),
"joint5".to_string(),
"joint6".to_string(),
],
position: vec![1.0, 2.0, 3.0, 4.0, 5.0, 6.0],
velocity: vec![7.0, 8.0, 9.0, 10.0, 11.0, 12.0],
effort: vec![13.0, 14.0, 15.0, 16.0, 17.0, 18.0],
Expand Down

0 comments on commit d359f43

Please sign in to comment.