Skip to content

Implement new prim exec logic using motion controllers#3760

Merged
nycrat merged 50 commits into
masterfrom
avah/prim_exec_motion_controller
Jun 11, 2026
Merged

Implement new prim exec logic using motion controllers#3760
nycrat merged 50 commits into
masterfrom
avah/prim_exec_motion_controller

Conversation

@nycrat

@nycrat nycrat commented Jun 4, 2026

Copy link
Copy Markdown
Member

Description

This is was a stacked PR: #3756 #3758 #3759 #3760.

This PR implements using the new motion controllers to get target velocities in the primitive executor. While the responsibility of getting target velocity shifts more to the motion controllers, most of the actual logic is the same with a few additions:

  • Position/orientation controllers apply a control effort using PID get the target linear/angular velocity
  • There is a check for if the target velocity exceeds the maximum acceleration of the robot (currently just logs a warning, will need to resolve this issue in separate PR)

There are some necessary changes in this PR that are not in prim exec:

  • Bugfix where erforce simulator passes in non-inverted worlds to yellow team primitive executors (supposed to be inverted)
  • Motion controller changes
  • Robot constant adjustments

Testing Done

image

New test was made to check robot movement in straight line. There are still issues with too large of acceleration.

Resolved Issues

Length Justification and Key Files to Review

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

  • Function & Class comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

@nycrat nycrat changed the base branch from avah/prim_exec_update_state to master June 5, 2026 04:49
@nycrat nycrat marked this pull request as draft June 5, 2026 04:52
@nycrat nycrat force-pushed the avah/prim_exec_motion_controller branch from 835883c to b5ac171 Compare June 9, 2026 20:57
@nycrat nycrat force-pushed the avah/prim_exec_motion_controller branch from b5ac171 to bc2f713 Compare June 9, 2026 20:58
@nycrat nycrat force-pushed the avah/prim_exec_motion_controller branch from 5f96ef5 to e7bb4a3 Compare June 10, 2026 20:29
@nycrat nycrat marked this pull request as ready for review June 10, 2026 20:37
Comment thread src/shared/robot_constants.h
Comment thread src/software/ai/hl/stp/tactic/attacker/attacker_tactic_test.py

@GrayHoang GrayHoang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm excited to see the effects of this on the field

return std::make_unique<TbotsProto::DirectControlPrimitive>();
}

void PrimitiveExecutor::sendLinearMotionToPlotJuggler(const Vector& target_local_velocity,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we move this to another pr? It feels out of place here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It was useful for debugging the new behaviour of the primitive executor, I feel like its useful. Perhaps will move it somewhere else later

@nycrat nycrat merged commit 32df2dc into master Jun 11, 2026
8 checks passed
Andrewyx added a commit to Andrewyx/Software that referenced this pull request Jun 12, 2026
Resolve conflicts from master's UBC-Thunderbots#3760 (new prim-exec logic using motion
controllers), UBC-Thunderbots#3769, and the field renames, which overlapped with this
branch's own controller/prim-exec rework.

Resolution:
- Adopt master's UBC-Thunderbots#3760 implementation for primitive_executor, thunderloop,
  and the motion controllers (PositionController/OrientationController,
  non-templated PidController + pid_controller.cpp). Drops the branch's
  parallel close-PID / start_angle / stall-detection variant.
- Take master's robot_constants field names (robot_trajectory_max_* ) and
  2026 tuning values (trajectory speed 2.5, decel 2.0).
- Take master's tbots_protobuf createAngularTrajectoryFromParams signature
  (uses params.start_angle()) and master's move_primitive.cpp.
- Keep robot_localizer.cpp/.h as a standalone library for separate
  re-integration; removed the now-unused thunderloop -> robot_localizer dep.

Verified building: proto translation, move_primitive, motion_control/...,
robot_localizer, primitive_executor, thunderloop.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

5 participants