Skip to content

Adds multi (joint) state validation service #3426

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

riv-ljames
Copy link

@riv-ljames riv-ljames commented Apr 10, 2025

Description

The normal state validation service is not very fast if you want to check a lot of joint states. This is significantly faster.

Requires moveit/moveit_msgs#186

Please could this be backported to humble

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

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.

Looks great!

One question here: I assume a good bit of this code is copy pasted from the single state validation service, but done in a loop to prevent calling multiple services. Is there an opportunity to factor out the common code into a reusable utility function?

moveit::core::RobotState rs = ls->getCurrentState();
moveit::core::robotStateMsgToRobotState(robot_state, rs);

for(int i=0; i<req->joint_states.size(); i++){
Copy link
Contributor

Choose a reason for hiding this comment

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

Use ++i as in other loops

}
}

// No need to check any more joint states after the first invalid one
Copy link
Contributor

Choose a reason for hiding this comment

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

Not necessarily, depends on whether users want speed or a complete list of the states that were invalid.

You could consider adding an "early stop" boolean in the service request?

Copy link

codecov bot commented Apr 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (0d84edb) to head (754873f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #3426       +/-   ##
==========================================
- Coverage   45.85%   0.00%   -45.84%     
==========================================
  Files         717     415      -302     
  Lines       62630   38645    -23985     
  Branches     7580    5352     -2228     
==========================================
- Hits        28715       0    -28715     
- Misses      33749   38645     +4896     
+ Partials      166       0      -166     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sea-bass sea-bass added backport-humble Mergify label that triggers a PR backport to Humble backport-jazzy Mergify label that triggers a PR backport to Jazzy labels Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble Mergify label that triggers a PR backport to Humble backport-jazzy Mergify label that triggers a PR backport to Jazzy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants