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

Pendulum fixes #385

Merged
merged 6 commits into from
Sep 23, 2019
Merged

Pendulum fixes #385

merged 6 commits into from
Sep 23, 2019

Conversation

clalancette
Copy link
Contributor

@clalancette clalancette commented Aug 9, 2019

This PR, along with ros2/realtime_support#81 , should fix an issue in the pendulum_control demo where we publish uninitialized data. There are three fixes in here, corresponding to the 3 commits:

  1. Remove some unused code in rtt_executor.hpp. This isn't strictly required here, but there is no reason for this code to be here since it is never used.
  2. Switch the min_latency and max_latency fields in the RttestResults.msg to be signed integers. The underlying latency data coming from realtime_tools is signed, so this should be signed as well.
  3. Make it so that we don't publish data if it hasn't yet been initialized.

With this in place, it looks to me like the uninitialized data problems that we have with pendulum_control tests should be gone. This may solve ros2/build_farmer#133 ; I'll see what happens when CI comes back. @cottsay FYI as current build farmer.

Fixes ros2/build_farmer#133
Fixes #386

@clalancette
Copy link
Contributor Author

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@clalancette
Copy link
Contributor Author

Given that this was failing on aarch64 every night for quite a while with a very similar configuration, I'd say this actually fixes it. Woohoo! I'll update the description.

@clalancette
Copy link
Contributor Author

I had a silly bug in here, so here is another CI run:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@clalancette
Copy link
Contributor Author

And there was one more bug. Now I think I really have it fixed. Another CI to see if I'm correct:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@dirk-thomas
Copy link
Member

Remove some unused code in rtt_executor.hpp. This isn't strictly required here, but there is no reason for this code to be here since it is never used.

It would be good to keep changes like this in a separate PR. Simply because it makes reviewing each PR easier and each one can iterate and get merged independently. (Doesn't have to be for this change now but please do that in the future.)

Switch the min_latency and max_latency fields in the RttestResults.msg to be signed integers. The underlying latency data coming from realtime_tools is signed, so this should be signed as well.

How can the values be signed? If they conceptionally can't I would advocate to keep the unsigned in the message and do the necessary conversion (or consider updating realtime_tools).

Make it so that we don't publish data if it hasn't yet been initialized.

👍

@clalancette
Copy link
Contributor Author

clalancette commented Aug 27, 2019

Switch the min_latency and max_latency fields in the RttestResults.msg to be signed integers. The underlying latency data coming from realtime_tools is signed, so this should be signed as well.

How can the values be signed? If they conceptionally can't I would advocate to keep the unsigned in the message and do the necessary conversion (or consider updating realtime_tools).

I struggled a bit with this. While I agree that latency should be an unsigned number, https://github.com/ros2/realtime_support/blob/master/rttest/src/rttest.cpp#L247 clearly wants to sometimes store it as a signed (which eventually gets assigned to {min,max}_latency). That was added in c5254392 (in 2015!), but it is not clear to me why.

@clalancette
Copy link
Contributor Author

As we had previously discussed, I tried putting the {min,max}_latency fields back to uint64, and adding an assert to ensure the data coming from rttest is always >= 0. Under certain circumstances (Opensplice on Linux, with the machine heavily loaded), that assert sometimes triggers. I'm not entirely sure why that is; I'll have to do some additional debugging.

Nobody was ever calling them.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
It is possible to try to collect statistics from the underlying
realtime_tools before they are available.  If we detect that is
the case, skip publishing the data and wait until the data
is available.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
rttest_finish() prints out statistics with an extra newline at
the end, so we need to expect that here.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
@clalancette
Copy link
Contributor Author

I finally figured this out; it was an overflow. This now requires ros2/realtime_support#82 , and should now fix the pendulum failures for real. Here's some more CI for it:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

One comment below, but LGTM!

@clalancette clalancette merged commit eaad786 into master Sep 23, 2019
@clalancette clalancette deleted the pendulum-fixes branch September 23, 2019 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants