Skip to content

Added per-motor control to thunderscope diagnostics. (new)#3423

Merged
Muxite merged 8 commits into
UBC-Thunderbots:masterfrom
Muxite:per-motor-new
May 27, 2025
Merged

Added per-motor control to thunderscope diagnostics. (new)#3423
Muxite merged 8 commits into
UBC-Thunderbots:masterfrom
Muxite:per-motor-new

Conversation

@Muxite

@Muxite Muxite commented Jan 25, 2025

Copy link
Copy Markdown
Contributor

Description

Added per motor control as a set of radio buttons in thunderscope diagnostic. Direct velocity and per motor control will switch depending on which radio button is pressed. The two control widgets will not appear at the same time, since both inputs are not allowed at the same time. Pressing the button for per-motor control will shut off direct-velocity control and reset those sliders, then switch the widget for per-motor control. Vice versa also applies.

Testing Done

It was tested on a robot in the mezz on Jan 25th. Test was made on all sliders of direct-velocity, switching to per-motor without using reset, changing sliders on per-motor, and switching back to direct-velocity. Back-and-forth was done twice. The robot did all the commands it was told to on all motors. It was also tested using print() on the terminal.

Resolved Issues

resolves #3320

Length Justification and Key Files to Review

drive_and_dribbler_widget.py
Added functions similar to existing ones, but that apply to per-motor controls as opposed to direct-velocity controls. Also added an enum for the control mode.

Review Checklist

This PR was reviewed before, but since it was a long time ago, I decided to make a new branch instead of resolving all the merge conflicts on the old one.

  • 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

@Muxite Muxite changed the title Added per-motor control to thunderscope diagnostics. Added per-motor control to thunderscope diagnostics. (new) Jan 25, 2025
@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions Bot added the Stale Inactive pull requests label Feb 25, 2025
)
motor_control.dribbler_speed_rpm = int(self.dribbler_speed_rpm_slider.value())
if self.control_mode == ControlMode.VELOCITY:
motor_control.ClearField("direct_per_wheel_control")

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.

Do you actually need this line? Because I thought the if and the else statements handles this already.

I could be wrong entirely.

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.

It could be possible to move the ClearField to toggle_control_mode, i will try that.

@Mr-Anyone

Copy link
Copy Markdown
Contributor

Looks good.

@github-actions github-actions Bot removed the Stale Inactive pull requests label Feb 26, 2025

@itsarune itsarune 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.

Have you had a change to field test @Muxite ?

Also, merging in upstream will fix your CI issue.

@github-actions

github-actions Bot commented Apr 8, 2025

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions Bot added the Stale Inactive pull requests label Apr 8, 2025
@itsarune itsarune removed the Stale Inactive pull requests label Apr 9, 2025
@github-actions

github-actions Bot commented May 9, 2025

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions Bot added the Stale Inactive pull requests label May 9, 2025
@GrayHoang GrayHoang removed the Stale Inactive pull requests label May 13, 2025

@williamckha williamckha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested on robot, works great!

@williamckha williamckha requested a review from Andrewyx May 24, 2025 20:09
@Muxite Muxite merged commit 28ffa52 into UBC-Thunderbots:master May 27, 2025
6 checks passed
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.

Implement per-motor robot control in Thunderscope

5 participants