From aeae51ff481fd8e30b0b81cb58079afc1b9f6a9a Mon Sep 17 00:00:00 2001 From: Jan-Niklas Burfeind Date: Tue, 9 Jul 2024 13:04:25 +0000 Subject: [PATCH] feat!: Drop unused node parameter from create_joint_state_msg which was previously used to access the systemclocks timestamp, an information rust can access itself. Co-authored-by: Philipp Caspers --- src/main.rs | 2 +- src/ros_publisher.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 7838f70..f14cc54 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,7 +21,7 @@ fn main() -> Result<(), RclrsError> { let mut increment = 0.0; thread::spawn(move || loop { thread::sleep(Duration::from_micros(publisher_thread_throttle_us)); - let joint_state_msg = create_joint_state_msg(&node, increment); + let joint_state_msg = create_joint_state_msg(increment); joint_state_publisher .publish_data(&joint_state_msg) .unwrap(); diff --git a/src/ros_publisher.rs b/src/ros_publisher.rs index 4c61732..746f0de 100644 --- a/src/ros_publisher.rs +++ b/src/ros_publisher.rs @@ -25,7 +25,7 @@ impl RosPublisher { } } -pub fn create_joint_state_msg(_node: &Node, data: f64) -> JointStateMsg { +pub fn create_joint_state_msg(data: f64) -> JointStateMsg { let system_timestamp = SystemTime::now().duration_since(UNIX_EPOCH).unwrap(); // Workaround for https://github.com/ros2-rust/ros2_rust/issues/385 let time_msgs = TimeMsg {