-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding HaltMotion (Or new suggested name) to physics plugin #728
Conversation
Signed-off-by: Tomas Lorente <[email protected]>
Signed-off-by: Tomas Lorente <[email protected]>
Codecov Report
@@ Coverage Diff @@
## ign-gazebo4 #728 +/- ##
================================================
- Coverage 77.37% 67.16% -10.21%
================================================
Files 217 241 +24
Lines 12217 18893 +6676
================================================
+ Hits 9453 12690 +3237
- Misses 2764 6203 +3439
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, the kinetic energy monitor should not be concerned with halting a vehicle. If we adhere to the separation of concerns principle, I would think another System in SubT (eg. GameLogicPlugin) would monitor the output of the kinetic energy monitor and set the state of the HaltMotion
component.
I also left some comments in case we decide to proceed with keeping that logic in the kinetic energy monitor.
I do agree with moving the HaltMotion logic into the GameLogicPlugin, but that would require adding A PreUpdate there. @nkoenig Do you have a strong feeling for either of them? |
Agreed. @Lobotuerk , can you remove the logic for halting motion from the Kinetic Energy Monitor and place it in the SubT Game Logic Plugin? |
Adding a PreUpdate to the GameLogicPlugin sounds good. |
@azeey When moving the halting logic to GameLogic, should I leave the HaltMotion component creation inside KineticEnergyMonitor? |
Signed-off-by: Tomas Lorente <[email protected]>
Signed-off-by: Tomas Lorente <[email protected]>
IMO, We don't need to modify |
Signed-off-by: Tomas Lorente <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! It would be great if you can add a test showing that a vehicle stops once the HaltMotion
component is set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if this functionality couldn't be achieved using components::JointVelocityReset
/ components::JointPositionReset
?
Signed-off-by: Tomas Lorente <[email protected]>
Signed-off-by: Nate Koenig <[email protected]>
It's better for a long time halt to simply stop the physics layer before applying forces, than trying to reset the joint every single timestep |
Signed-off-by: Tomas Lorente [email protected]
🎉 New feature
Summary
Adds the functionality to stop a model's joint's movement in other cases than the battery being 0. By adding a HaltMotion component to the model, its joints movement can be turned on/off. Also added some QoL to kineticEnergyMonitor plugin with profilers and some checking.
(Updates)
19acc8d
adds the capability to turn movement halting off if you only need the advice (and making it backward compatible).4a9f551 Moved everything into GameLogicPlugin, just left here the halt component evaluation in physics and the QoL changes in kineticEnergyMonitor
Test it
TO-DO tested it with SubT worlds for now
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge