ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Cartographer Check failed: time >= imu_tracker->time()

asked 2019-04-05 13:05:15 -0500

alane gravatar image

updated 2019-04-05 23:11:50 -0500

jayess gravatar image

I am working in roscpp and publishing odometry data to a cartographer-ros node. Two classes are responsible for publishing this data. For safety reasons, it is sometimes necessary to call the destructor on the primary class and post still data (an odometry pose that uses the same values to let ros know the robot is standing still) from the other class.

When I switch initially it works correctly, however when I switch back to the primary class (and stop posting from the secondary class) I get this error message:

F0403 09:40:53.584676  2898 pose_extrapolator.cc:229] Check failed: time >= imu_tracker->time() (636898956535400370 vs. 636898956535779478)

*** Check failure stack trace: ***

    @       0x7f8efa52c8  cartographer::mapping::PoseExtrapolator::ExtrapolateRotation()
    @       0x7f8efa55dc  cartographer::mapping::PoseExtrapolator::AddOdometryData()
    @       0x7f8f08e468  cartographer_ros::Node::HandleOdometryMessage()

I am having a hard time locating the cause of this. It appears to me that either the odom topic or imu topic are running into problems regarding their timestamps, but I have checked the rostopic echo output and the timestamps appear to be in the correct order.

edit retag flag offensive close merge delete

Comments

This reads like an xy-problem:

For safety reasons, it is sometimes necessary to call the destructor on the primary class and post still data (an odometry pose that uses the same values to let ros know the robot is standing still) from the other class.

Is your goal to publish different messages based on some (external) event? If so, if you can describe your current approach better, and your requirements, we might be able to suggest an alternative.

gvdhoorn gravatar image gvdhoorn  ( 2019-04-06 03:08:17 -0500 )edit

My overall goal is to continuously post odometry/imu data to cartographer. My immediate issue is the transition between the classes causes the error above.

I may call the destructor on class A, this is the class that posts the messages to cartographer while the robot is operating normally. However, cartographer needs to have data sent to it at all times to work properly. So I start posting from class B by copying each message that is sent to cartographer and continuously posting the most recent message upon destruction of class A. When class A is reconstructed, I want to stop posting messages from the class B and return to posting live data from class A. The transition from class A to class B works well, but the transition from class B back to class A causes this error.

Unfortunately, I can't move the live data posting to class ...(more)

alane gravatar image alane  ( 2019-04-08 07:28:57 -0500 )edit

A more ROS/component based approach could be something like this: a node B that subscribes to the topics that carry the msgs that you want to "fake" and then use a mux that switches between the real topics and the ones from node B. Switching the mux is part of your (higher-level) coordination system.


Edit: it's still not completely clear why "the most recent message" must be sent to Cartographer when the robot "isn't operating normally". That I believe is the xy-problem here. But let's not go into that now.

If Cartographer is complaining then wouldn't it make sense to debug that? If the messages you are sending from your class A and class B are identical (save the timestamps most likely), then either you're violating some (implicit) assumption in Cartographer, or there is an actual bug in Cartographer. Both cases would seem to ...(more)

gvdhoorn gravatar image gvdhoorn  ( 2019-04-08 07:33:00 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-04-10 10:12:00 -0500

alane gravatar image

Thank you gvdhoorn, I just got it working. I did something very similar to the mux idea you suggested.

I made class A post all of its data to class B, then class B forwards it onto carographer. This way, when I would have switched class B already has the message saved, so it just continues posting that until class A sends a new message. As far as cartographer is concerned, class B is the only class that posts messages.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-04-05 13:05:15 -0500

Seen: 640 times

Last updated: Apr 10 '19