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

[ROS2] tf publisher stamp #840

Closed
routiful opened this issue Nov 19, 2018 · 3 comments
Closed

[ROS2] tf publisher stamp #840

routiful opened this issue Nov 19, 2018 · 3 comments
Assignees
Labels

Comments

@routiful
Copy link

I have tried to make map using Cartographer but I found that the time is different between two nodes.

I ran a tf2_echo to show that the tf is working well. Left terminal shows tf2_echo between map frame and odom frame. Right terminal shows tf2_echo between odom frame and base_footprint.
You can find that the time has quite different.

screenshot from 2018-11-19 17-46-49

Because Cartographer using chrono or ROS time however the diff_drive in ROS2 package publishes odometry tf with gazebo common time.

msg.header.stamp = gazebo_ros::Convert<builtin_interfaces::msg::Time>(_current_time);

How can I sync this two nodes?

@chapulina chapulina added the ros2 label Nov 19, 2018
@chapulina chapulina self-assigned this Nov 19, 2018
@chapulina
Copy link
Contributor

You need to make sure that:

  • You launch Gazebo with the gazebo_ros_init plugin
  • Set use_sim_time on your Cartographer nodes

See the migration guide here.

@chapulina chapulina reopened this Nov 20, 2018
@chapulina
Copy link
Contributor

Let me know if that works for you and then we can close this issue.

@routiful
Copy link
Author

Great! It works :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants