KodlabPenn / kodlab_mjbots_sdk

Repo for kodlab SDK for use with mjbots ecosystem
Other
8 stars 7 forks source link

[RFC] Expanding Moteus Communication for Debug #90

Closed lucienpeach closed 11 months ago

lucienpeach commented 1 year ago

Introduces new accessor functions within joint_moteus.h to allow for inclusion of additional registers as defined in the moteus controller reference.md. Includes supporting architecture via options to allow user specification of desired registers to be read in controller definition.

Change List

Upcoming Changes

Testing

Hardware testing on the DOQ robot is planned to verify the effectiveness of this code in practice. This testing will primarily seek to validate logging of new registers from the moteus.

Questions

There are a number of ways to build off this code and optimize it. Discussion of changes proposed above and suggestions on additional new changes are greatly appreciated.

lucienpeach commented 1 year ago

Builds upon previous changes to allow requests to be sent via a QueryCommand struct that replaces the previous boolean method of requesting data while bolstering user optionality through resolution selection. Includes initial support for open-loop control and introduces safety checks via warning messages and kodlab::ActivateCtrlC() to alert the user of input resolution errors and to prevent unsafe and improper closed-loop control.

Change List

Testing

Testing on DOQ has confirmed proper communication with the robot and functionality of safety features in both open- and closed-loop control schemes (toggled via the open_loop option). Plotting has demonstrated reasonable values for all requested fields and control loop communications function without packet loss at 1000 Hz even with a fully comprehensive QueryCommand struct that returns all possible data fields.

Questions

Open to suggestions on QueryCommand library changes or additions. Interested in thoughts of more robust open-loop support in future PRs.