[ROS2] Sim time returns system time

asked 2019-08-21 04:19:14 -0600

madmax gravatar image

I am looking at this code here:

 tf2::TimePoint tf2_time( time_utils::toTimePoint( node.now()) );
   bool simTime;
   node.get_parameter("use_sim_time", simTime);
   RCLCPP_INFO( node.get_logger(), "canTransform for time %ld, sim time: %d", tf2_time.time_since_epoch().count(), simTime );

And I would expect it to return some time like x seconds after simulation started.
But instead I get:

canTransform for time 1566378606048445614, sim time: 1  

 Can not transform: Lookup would require extrapolation into the future.  Requested time 1566378606.04844 but the latest data is at time 119.27300,

So sim time is set, I get the nodes time, but its wrong.
Dont see where I am doing something wrong?

edit retag flag offensive close merge delete