Skip to content

Commit

Permalink
Avoid unecessary time conversions. (#635)
Browse files Browse the repository at this point in the history
Signed-off-by: Guilherme Rodrigues <guilherme.rodrigues@ait.ac.at>
  • Loading branch information
AiVerisimilitude authored Nov 13, 2023
1 parent e8a7223 commit e07648f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tf2_ros/include/tf2_ros/message_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ class MessageFilter : public MessageFilterBase, public message_filters::SimpleFi
*/
void add(const MConstPtr & message)
{
builtin_interfaces::msg::Time t = node_clock_->get_clock()->now();
auto t = node_clock_->get_clock()->now();
add(MEvent(message, t));
}

Expand Down
2 changes: 1 addition & 1 deletion tf2_ros/test/listener_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ TEST(tf2_ros_test_listener, transform_listener)

geometry_msgs::msg::TransformStamped out_rootc = buffer.lookupTransform(
"a", "b",
builtin_interfaces::msg::Time());
rclcpp::Time());

EXPECT_EQ(1, out_rootc.transform.translation.x);
EXPECT_EQ(2, out_rootc.transform.translation.y);
Expand Down

0 comments on commit e07648f

Please sign in to comment.