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

Fix uncaught exception in joint_state_controller #630

Merged

Conversation

rhaschke
Copy link
Contributor

Using sim time in Gazebo, the starting time is close to zero, such that time - ros::Duration(1/publish_rate_) becomes negative. This causes an exception to be thrown: "Time is out of dual 32-bit range".

@bmagyar
Copy link
Member

bmagyar commented Feb 29, 2024

Thank you!

Would you like a release of this or happy with it being merged for now?

Using sim time in Gazebo, the starting time is close to zero,
such that time - ros::Duration(1/publish_rate_) is negative.
This causes an exception to be thrown: "Time is out of dual 32-bit range".
@rhaschke rhaschke force-pushed the fix-joint-state-controller branch from a83f841 to 98b5ab3 Compare February 29, 2024 19:11
@rhaschke
Copy link
Contributor Author

A merge would be fine for now. Sorry for pushing broken code initially. It should work now.

@01binary
Copy link

01binary commented Feb 29, 2024

Totally forgot about this. I also have a fix in #629, but the unit tests are failing and I couldn't find a way to fix them.

We can close that pull request and delete the branch if this version of the fix gets merged instead.

One small note: I see that you fixed the issue by catching an exception instead of ensuring it doesn't occur by performing a greater-than check. This code could potentially execute in a tight (update) loop, so throwing an exception and catching it every loop iteration, in a loop that's supposed to run at a specific frequency may not be the best thing long-term.

@rhaschke
Copy link
Contributor Author

rhaschke commented Mar 1, 2024

@bmagyar, can you please rerun the CI tests? I think the test JointStateControllerTest.valuesOk is flaky. Locally, it works for me most of the time but occasionally fails.

@bmagyar bmagyar merged commit 678b92a into ros-controls:noetic-devel Mar 1, 2024
2 of 4 checks passed
@rhaschke rhaschke deleted the fix-joint-state-controller branch March 1, 2024 11:55
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.

3 participants