Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeline mixup when running bagfile #232

Closed
glpuga opened this issue Jun 19, 2023 · 4 comments · Fixed by #238
Closed

Timeline mixup when running bagfile #232

glpuga opened this issue Jun 19, 2023 · 4 comments · Fixed by #238
Assignees
Labels
bug Something isn't working needs-fix Bug confirmed, needs a fix

Comments

@glpuga
Copy link
Collaborator

glpuga commented Jun 19, 2023

Bug description

A few transforms and messages are getting stamped with unmatched timestamps, probably as a result of a mixup when the bagfile was generated.

As a result of this, amcl is publishing the map->odom tf in a totally different timescale than the odom->base and base->laser_front , causing RViz to fail to display the later.

See timestamps on the logs and on the two transforms on the right:

Screenshot from 2023-06-19 13-59-14

See timestamps on the /clock and /scan topics:

Screenshot from 2023-06-19 14-01-11

On RViz,

Screenshot from 2023-06-19 13-52-31

Platform (please complete the following information):

  • OS: Humble development container included in Beluga
  • Beluga version: ed7dfe3

How to reproduce

List steps to reproduce the issue:

  1. On a console: cd /ws && colcon build && source install/setup.bash && ros2 launch beluga_example perfect_odometry.launch.xml
  2. On another console: ros2 topic echo /tf, ros2 topic echo /clock, ros2 topic echo /scan
  3. On RViz, the TF visor will also show a warning for both base and laser_front.

Code snippets or minimal examples are always helpful, if not necessary.

Expected behavior

All message timestamps to be consistent when running out of a demo and test bagfile.

Actual behavior

Timestamps are not consistent with a single timeline, and some information fails to be displayed as a result.

@glpuga glpuga added the bug Something isn't working label Jun 19, 2023
@hidmic
Copy link
Collaborator

hidmic commented Jun 19, 2023

I think I saw this when working on #223. Messages carry some simulated clock stamp but rosbag2 stamped them on arrival using the system clock.

@glpuga
Copy link
Collaborator Author

glpuga commented Jun 20, 2023

This is probably related to beluga_benchmark being unable to measure NAV2 AMCL. The node crashes or dies out shortly after starting the playback, regardless of the configuration.

Bisecting with git the problem, it seems to have started after #211 when we refactored the bagfile and launchfiles.

@nahueespinosa
Copy link
Member

Ah, that was me.

I did two things that might have caused this:

  1. I removed the /clock topic messages from the ROS bag.
  2. I added the --clock option to the ROS bag play command.

The motivation was being able to play ROS bags that don't have /clock messages, like the ones we recorded in HQ (do you have any thoughts on how to do this correctly?).

Seems like it was not the right approach, we can definitely revert the changes to the ROS bag.

@nahueespinosa nahueespinosa self-assigned this Jun 24, 2023
@nahueespinosa nahueespinosa added the needs-fix Bug confirmed, needs a fix label Jun 24, 2023
@stwirth
Copy link

stwirth commented Jul 7, 2023

From my experience, you always must use --clock (with /clock topic) to be safe. There are many packages that mix the use of ROS time (which is current system time if no --clock is used) and message header stamps.

nahueespinosa added a commit that referenced this issue Jul 11, 2023
Fixes #232.

This patch fixes message timestamps and starting time in the rosbag to
match the header stamps recorded with sim time.

* The contents of the messages were not altered.
* The last messages where there was a collision against one of the walls
were deleted.

Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-fix Bug confirmed, needs a fix
Projects
None yet
4 participants