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

Added container size check for joint states #92

Merged
merged 1 commit into from
Oct 18, 2022

Conversation

kmdalal
Copy link
Contributor

@kmdalal kmdalal commented Oct 18, 2022

This is just the addition of a small and simple safety check that is unlikely to fail for any user, however it's motivated by a user who integrated a different lander arm and didn't update JointMap. We now compare the number of actual joints to the number of known joints before iterating their containers.

In addition, one small improvement: replaced int with auto as the size type for the map. (Using auto because the actual type is long and not particularly useful).

And, incidentally, there are several lines that just have trailing whitespace removed -- this is automatically done by Emacs.

To test:

  1. Start any sim world, then the ow_exec node, and run any plan that does both antenna and arm moves (e.g. ReferenceMission1) just long enough to see each move, and see that there are no errors in the ow_exec terminal.
  2. (Optional) Comment out a line in JointMap in ow_autonomy/ow_plexil/src/plexil-adapter/OwInterface.cpp, build ow_autonomy, and repeat test 1. You should see the new error shorty after starting the ow_exec node.

@kmdalal kmdalal changed the title compare actual and known number of joints before iterating through them Added container size check for joint states Oct 18, 2022
@kmdalal kmdalal assigned AstroStucky and kmdalal and unassigned AstroStucky Oct 18, 2022
Copy link
Contributor

@AstroStucky AstroStucky left a comment

Choose a reason for hiding this comment

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

Performed both tests. The error triggers when it should.

@kmdalal kmdalal merged commit 1b2548c into noetic-devel Oct 18, 2022
@kmdalal kmdalal deleted the joint-array-size-fix branch October 18, 2022 23:24
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