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

Obtain time from node. #3032

Merged
merged 1 commit into from
Oct 16, 2024
Merged

Obtain time from node. #3032

merged 1 commit into from
Oct 16, 2024

Conversation

Jelmerdw
Copy link
Contributor

@Jelmerdw Jelmerdw commented Oct 15, 2024

Description

If I use the moveit_servo servo_node in combination with Gazebo simulation, the moveit_ros.current_state_monitor complains that it doesn't receive robot state with recent timestamp. I launch all nodes with the 'use_sim_time' set to True, however the current_state_monitor still seems to use wall time. A similar problem was explained in this issue, although not for moveit_servo:

#2906

My solution is to change the code from rclcpp::Clock(RCL_ROS_TIME).now() to node_->now(), such that the time is obtained from the node, which is launched with 'use_sim_time' set to True, so that it gives the sim time. This fixes my problem for the moveit_servo node, but will probably not fix the problem in the issue I mentioned.

This is my first contribution. I would like to hear feedback about this suggested change!

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

Signed-off-by: Jelmer de Wolde <[email protected]>
Copy link
Contributor

@sea-bass sea-bass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me -- thank you for this fix!

@sea-bass sea-bass added this pull request to the merge queue Oct 16, 2024
Merged via the queue into moveit:main with commit 7db58f8 Oct 16, 2024
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants