Skip to content

Commit

Permalink
Reduce duplicated code
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Della Vedova <[email protected]>
  • Loading branch information
luca-della-vedova committed Dec 19, 2024
1 parent 387d3b4 commit 8d39c6b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions rmf_robot_sim_common/src/slotcar_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,10 +918,7 @@ double SlotcarCommon::compute_change_in_rotation(

void SlotcarCommon::publish_robot_state(const double time)
{
const int32_t t_sec = static_cast<int32_t>(time);
const uint32_t t_nsec =
static_cast<uint32_t>((time-static_cast<double>(t_sec)) *1e9);
const rclcpp::Time ros_time{t_sec, t_nsec, RCL_ROS_TIME};
const rclcpp::Time ros_time = rmf_plugins_utils::simulation_now(time);
if ((time - last_tf2_pub) > (1.0 / TF2_RATE))
{
// Publish tf2
Expand Down

0 comments on commit 8d39c6b

Please sign in to comment.