MCPcopy Create free account
hub / github.com/ROBOTIS-GIT/turtlebot3 / joint_state_callback

Method joint_state_callback

turtlebot3_node/src/odometry.cpp:132–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132void Odometry::joint_state_callback(const sensor_msgs::msg::JointState::SharedPtr joint_state_msg)
133{
134 const rclcpp::Time current_time = joint_state_msg->header.stamp;
135 static rclcpp::Time last_time = current_time;
136 const rclcpp::Duration duration = current_time - last_time;
137
138 update_joint_state(joint_state_msg);
139 calculate_odometry(duration);
140 publish(current_time);
141
142 last_time = current_time;
143}
144
145void Odometry::joint_state_and_imu_callback(
146 const std::shared_ptr<sensor_msgs::msg::JointState const> & joint_state_msg,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected