Skip to content

setup dribbler interface#3732

Open
GrayHoang wants to merge 38 commits into
UBC-Thunderbots:masterfrom
GrayHoang:dribbler_fw
Open

setup dribbler interface#3732
GrayHoang wants to merge 38 commits into
UBC-Thunderbots:masterfrom
GrayHoang:dribbler_fw

Conversation

@GrayHoang
Copy link
Copy Markdown
Contributor

@GrayHoang GrayHoang commented May 22, 2026

Description

This PR adjusts our MotorService and powerboard firmware to incorporate the new dribbler motor.

Due to backward compatibility requirements and restrictions with the way dribble commands are packaged and sent to MotorService, this requires that the Stspin and Trinamic motor controllers handle dribble commands differently.

Namely, the Stspin motor controller is made aware of the PowerService instance owned by Thunderloop, and passes dribble commands to PowerService accordingly.

The effect is that Thunderloop must initiate the appropriate type of PowerService and feed it to the motor controller if needed (See thunderloop.cpp line 125 and stspin_motor_controller.cpp line 179).

Please look at the changed protobuf files, I have no idea if I setup message translation, uart framing, and protobuffer types correctly. (powerframe_msg.hpp/.proto).

Powerloop incorporates some rudimentary PWM ramping. RPM is expected to be passed down from somewhere in software. (powerloop_main.cc line 106).

Testing Done

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

@GrayHoang GrayHoang changed the base branch from tbots/motor to master May 25, 2026 23:47
@GrayHoang GrayHoang changed the base branch from master to tbots/motor May 25, 2026 23:47
@GrayHoang GrayHoang changed the base branch from tbots/motor to master May 29, 2026 03:05
@GrayHoang GrayHoang marked this pull request as ready for review May 29, 2026 05:12
Comment thread src/software/power/pins.h
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.

You should be able to see this on the Altium. This is the Power Board, on the ESP32. The pin number is 4 in our case, but being able to see this is a benefits of having Altium access.

}
else
{
power_service_ = std::make_unique<PowerServiceWithDribble>();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This needs to become a shared_ptr to be shared with the motor drivers, but in doing so it means that the trinamics instance also has to track a shared_ptr instead of a unique_ptr

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.

2 participants