Skip to content

Populate MoveItErrorCodes.message in pilz_industrial_motion_planner - #3998

Open
vijaykoundinya wants to merge 1 commit into
moveit:mainfrom
vijaykoundinya:pilz-populate-error-code-message
Open

vijaykoundinya wants to merge 1 commit into
moveit:mainfrom
vijaykoundinya:pilz-populate-error-code-message

Conversation

@vijaykoundinya

@vijaykoundinya vijaykoundinya commented Nov 25, 2026 •

Copy link
Copy Markdown

Description

pilz_industrial_motion_planner currently logs detailed planning failure diagnostics (specific joint name and violated velocity/acceleration/deceleration limit, IK failure, invalid blend radius, request validation errors, etc.) via RCLCPP_ERROR*, while leaving MoveItErrorCodes.message empty on the returned MotionPlanResponse / MotionSequenceResponse.

This PR populates and propagates error_code.message across pilz_industrial_motion_planner:

  • Add an ABI-compatible verifySampleJointLimits overload accepting std::string* error_message and populate error_code.message in both generateJointTrajectory overloads (clearing it on SUCCESS).
  • Include error_code.message in LinTrajectoryConversionFailure / CircTrajectoryConversionFailure thrown by LIN, CIRC, and POLYLINE generators.
  • Populate res.error_code.message = ex.what() in TrajectoryGenerator::generate() (and clear it in setSuccessResponse()).
  • Populate and propagate error_code.message through TrajectoryBlenderTransitionWindow, PlanComponentsBuilder, CommandListManager, MoveGroupSequenceAction, MoveGroupSequenceService, and CommandPlanner::getPlanningContext.
  • Add unit test assertions covering verifySampleJointLimits, generateJointTrajectory, TrajectoryGeneratorCommonTest, and TrajectoryGeneratorLINTest.

Related:

  • #3899 (propagating error_code.message)
  • #3894 (preserves error_code.val in CommandListManager; this PR intentionally leaves error_code.val unchanged there to avoid conflicts)

This change is ABI-compatible (adds a new overload without changing existing signatures) and is a good candidate for backport-jazzy.

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

Summary by CodeRabbit

  • Bug Fixes
    • Planning and trajectory-generation failures now include clearer, more specific error messages, including details about joint-limit violations, invalid planning groups, and missing planning pipelines.
    • Successful planning responses clear stale error messages.

Pilz trajectory generators, trajectory conversion helpers, blender, and
sequence action/service capabilities currently log detailed error
messages (such as the specific joint and velocity/acceleration limit
violated, IK failure, or invalid blend radius) while leaving
MoveItErrorCodes.message empty on the returned response.

Populate error_code.message across pilz_industrial_motion_planner:
- Add an ABI-compatible verifySampleJointLimits overload taking an
  optional std::string* error_message and return the limit violation
  details from generateJointTrajectory in error_code.message.
- Append error_code.message when throwing trajectory conversion failures
  in LIN, CIRC, and POLYLINE generators.
- Set res.error_code.message = ex.what() in TrajectoryGenerator::generate
  and clear it on success.
- Propagate error_code.message through TrajectoryBlenderTransitionWindow,
  PlanComponentsBuilder, CommandListManager, MoveGroupSequenceAction,
  MoveGroupSequenceService, and CommandPlanner::getPlanningContext.
- Add unit test assertions covering verifySampleJointLimits,
  generateJointTrajectory, TrajectoryGeneratorCommonTest, and
  TrajectoryGeneratorLINTest.

Signed-off-by: Vijay Koundinya <[email protected]>
Co-authored-by: Cursor <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds diagnostic text to Pilz planning and blending failures. It exposes joint-limit and IK details through error messages, carries exception and pipeline-resolution text into sequence responses, and clears messages on successful trajectory generation or blending. Existing error-code values and failure paths remain unchanged in the described cases.

Changes: Planning and blending error diagnostics

Layer / File(s) Summary
Trajectory diagnostic output
moveit_planners/pilz_industrial_motion_planner/include/pilz_industrial_motion_planner/trajectory_functions.hpp, moveit_planners/pilz_industrial_motion_planner/src/trajectory_functions.cpp, moveit_planners/pilz_industrial_motion_planner/test/unit_tests/src/unittest_trajectory_functions.cpp
verifySampleJointLimits has an overload that returns failure details. Both trajectory-generation overloads store IK and joint-limit diagnostics in the error code. Tests check the returned messages.
Trajectory error propagation
moveit_planners/pilz_industrial_motion_planner/src/trajectory_generator.cpp, moveit_planners/pilz_industrial_motion_planner/src/trajectory_generator_{circ,lin,polyline}.cpp, moveit_planners/pilz_industrial_motion_planner/test/unit_tests/src/unittest_trajectory_generator_{common,lin}.cpp
Trajectory generator responses store caught exception text and clear messages on success. CIRC, LIN, and polyline conversion failures append available error details. Tests check failure messages.
Blend error diagnostics
moveit_planners/pilz_industrial_motion_planner/src/trajectory_blender_transition_window.cpp, moveit_planners/pilz_industrial_motion_planner/src/plan_components_builder.cpp
Blend validation failures store descriptive messages. Blend responses preserve trajectory error details, and blend exceptions include available response messages.
Planning request error propagation
moveit_planners/pilz_industrial_motion_planner/src/{command_list_manager,move_group_sequence_action,move_group_sequence_service,pilz_industrial_motion_planner}.cpp
Sequence action and service responses record pipeline-resolution and exception messages. Planning-context and command-list failures also include available diagnostic text.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Suggested reviewers: henningkayser, sea-bass, ct2034

Merge Risk: Minimal · up to c51a9

This change adds more detailed failure messages to Pilz planning and sequence responses without altering error codes or failure behavior. No concrete merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Populate MoveItErrorCodes.message in pilz_industrial_motion_planner" matches the main change. The PR fills the error_code.message field across Pilz trajectory generation, blending, sequence…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "Populate MoveItErrorCodes.message in pilz_industrial_motion_planner" matches the main change. The PR fills the error_code.message field across Pilz trajectory generation, blending, sequence planning, and command-list paths, and adds a verifySampleJointLimits overload that returns the failure reason. The title names the package and the field, so a reviewer scanning history can identify the primary change.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5399d29 and c51a9a8.

Files selected for processing: 15

  • moveit_planners/pilz_industrial_motion_planner/include/pilz_industrial_motion_planner/trajectory_functions.hpp
  • moveit_planners/pilz_industrial_motion_planner/src/command_list_manager.cpp
  • moveit_planners/pilz_industrial_motion_planner/src/move_group_sequence_action.cpp
  • moveit_planners/pilz_industrial_motion_planner/src/move_group_sequence_service.cpp
  • moveit_planners/pilz_industrial_motion_planner/src/pilz_industrial_motion_planner.cpp
  • moveit_planners/pilz_industrial_motion_planner/src/plan_components_builder.cpp
  • moveit_planners/pilz_industrial_motion_planner/src/trajectory_blender_transition_window.cpp
  • moveit_planners/pilz_industrial_motion_planner/src/trajectory_functions.cpp
  • moveit_planners/pilz_industrial_motion_planner/src/trajectory_generator.cpp
  • moveit_planners/pilz_industrial_motion_planner/src/trajectory_generator_circ.cpp
  • moveit_planners/pilz_industrial_motion_planner/src/trajectory_generator_lin.cpp
  • moveit_planners/pilz_industrial_motion_planner/src/trajectory_generator_polyline.cpp
  • moveit_planners/pilz_industrial_motion_planner/test/unit_tests/src/unittest_trajectory_functions.cpp
  • moveit_planners/pilz_industrial_motion_planner/test/unit_tests/src/unittest_trajectory_generator_common.cpp
  • moveit_planners/pilz_industrial_motion_planner/test/unit_tests/src/unittest_trajectory_generator_lin.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@mergify

mergify Bot commented Nov 25, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request once it meets the queue conditions

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.

1 participant