Implement adjustable center of gravity `[AARD-1921]`
Task
AARD-1921
This PR adds a config for robots that allows you to move their center of gravity, and allows you to adjust the torque output consequence (the functional equivalent of scaling the weight of the robot).
Symptom
A user may wish to observe the physical output of the robot when its weight is at a pre-calculated or desired position. This is most often used for setting safety limits on move/rotation speeds.
Solution
To simulate a modified center-of-gravity, we compute the lever arm between where the gravitational force acts and where it "should" act, and gives us a rotational moment (torque). This torque is calculated, dampened (to avoid Jolt-related inaccuracies), and then distributed to each rigid body.
Verification
Place the center-of-gravity at various points and observe the effect on the robot's balance. Verifying using real values is not feasible due to limitations in Jolt.
Before merging, ensure the following criteria are met:
- [ ] All acceptance criteria outlined in the ticket are met.
- [ ] Necessary test cases have been added and updated.
- [ ] A feature toggle or safe disable path has been added (if applicable).
- [ ] User-facing polish:
- Ask: "Is this ready-looking?"
- [ ] Cross-linking between Jira and GitHub:
- PR links to the relevant Jira issue.
- Jira ticket has a comment referencing this PR.
Doesn't look like the previous review was fully addressed
Yes, I disagree with your suggestion that the physics be paused because if the user creates a try-and-repeat test scenario that involves any form of movement when pinpointing their CoG, this feature would prevent them from doing so. There are few or no cases where perpetual robot movement significantly impacts the selection.
It also wasn't made clear where the code was duplicated from (hence the emoji reaction), I searched for 5 minutes and then stopped with the presumption that it didn't matter enough to spend more time on; if it's truly a concern, then I will address it I suppose.
@Dhruv-0-Arora I think this should probably have its own tutorial. Has a pretty specific use case. Easy to use wrong.