Migrate Behaviors from shared_resources_ to getBehaviorContext()#773
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe changes replace ChangesBehavior context migration
Possibly related issues
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
|
|
|
19e5921 to
35f72ae
Compare
…rces_ MoveIt Pro 10.0 (PickNikRobotics/moveit_pro#20288) privatizes SharedResourcesNode::shared_resources_ behind the public getBehaviorContext() accessor. Update the example and lab_sim Behaviors to the new API so they compile against the 10.0 base image. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
35f72ae to
ef9d6b5
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/lab_sim_behaviors/src/compute_tray_place_positions_using_apriltags.cpp (1)
171-178: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOptional: cache
getBehaviorContext()locally.
getBehaviorContext()is invoked twice back-to-back here (and multiple more times later intick()). If the accessor is cheap (e.g., returns a member pointer), this is purely cosmetic; consider caching it in a local variable at the top oftick()for readability.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/lab_sim_behaviors/src/compute_tray_place_positions_using_apriltags.cpp` around lines 171 - 178, Optionally cache the result of getBehaviorContext() in a local variable at the start of tick(), then reuse that variable throughout the method, including the transform_buffer_ptr and logger accesses, without changing behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/lab_sim_behaviors/src/compute_tray_place_positions_using_apriltags.cpp`:
- Around line 171-178: Optionally cache the result of getBehaviorContext() in a
local variable at the start of tick(), then reuse that variable throughout the
method, including the transform_buffer_ptr and logger accesses, without changing
behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8a912001-1ba4-45b1-b0c7-395b5b30994d
📒 Files selected for processing (7)
src/example_behaviors/src/example_convert_mtc_solution_to_joint_trajectory.cppsrc/example_behaviors/src/example_create_string_msg.cppsrc/example_behaviors/src/example_delayed_message.cppsrc/example_behaviors/src/example_fibonacci_action_client.cppsrc/example_behaviors/src/example_hello_world.cppsrc/example_behaviors/src/example_publish_color_rgba.cppsrc/lab_sim_behaviors/src/compute_tray_place_positions_using_apriltags.cpp
|
|
[written by AI]
Problem
MoveIt Pro 10.0 (PickNikRobotics/moveit_pro#20288) removes
protectedacross the C++ API and privatizesSharedResourcesNode::shared_resources_behind the publicgetBehaviorContext()accessor. Behaviors in this workspace that dereferenceshared_resources_->no longer compile against the 10.0 base image —lab_sim_behaviorsfails first (compute_tray_place_positions_using_apriltags.cpp:109: 'shared_resources_' was not declared in this scope).Change
Mechanical migration of every
shared_resources_member reference to thegetBehaviorContext()accessor acrossexample_behaviorsandlab_sim_behaviors(7 files, 16 call sites).#include <.../shared_resources_node.hpp>lines are unchanged — the base class and header keep their names; only the member access moved behind an accessor. This is the migration documented in the moveit_pro 10.0 user-workspace migration guide.Validation rides on the paired moveit_pro PR: the
needs:token below pinsexample_ws / integrationto that PR's backend image (which definesgetBehaviorContext()), not the releasedmainimage. Merge order is moveit_pro first, then this PR.needs: moveit_pro/#20288