Skip to content
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

Add frictionless LCP #61

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Add frictionless LCP #61

wants to merge 16 commits into from

Conversation

michguo
Copy link
Collaborator

@michguo michguo commented Dec 21, 2021

Add frictionless LCP.

@michguo michguo changed the base branch from master to mguo/multi-callback December 21, 2021 06:18
@michguo michguo changed the title Mguo/frictionless Support frictionless LCP Dec 21, 2021
@michguo michguo changed the title Support frictionless LCP Add support for frictionless LCP Dec 21, 2021
@michguo michguo changed the title Add support for frictionless LCP Add frictionless LCP Dec 21, 2021
@michguo michguo requested a review from keenon December 21, 2021 09:59
Copy link
Owner

@keenon keenon left a comment

Choose a reason for hiding this comment

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

I think we should think about the runLcpConstraintEngine() naming. What's the distinction with runConstraintEngine()? Seems that runLcpConstraintEngine() is one possible constraint engine you can use?

@@ -296,12 +296,20 @@ void World(py::module& m)
"runConstraintEngine",
+[](dart::simulation::World* self, bool _resetCommand) -> void {
return self->runConstraintEngine(_resetCommand);
})
},
::py::arg("resetCommand"))
Copy link
Owner

Choose a reason for hiding this comment

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

Do we want default args on this? Generally we have resetCommand = false as default everywhere.

.def(
"runLcpConstraintEngine",
+[](dart::simulation::World* self, bool _resetCommand) -> void {
return self->runLcpConstraintEngine(_resetCommand);
})
},
::py::arg("resetCommand"))
Copy link
Owner

Choose a reason for hiding this comment

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

Here's another place where we could have default args, if you want them

+[](dart::simulation::World* self, bool _resetCommand) -> void {
return self->runFrictionlessLcpConstraintEngine(_resetCommand);
},
::py::arg("resetCommand"))
Copy link
Owner

Choose a reason for hiding this comment

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

And the last place where we could put them

@@ -296,12 +296,20 @@ void World(py::module& m)
"runConstraintEngine",
Copy link
Owner

Choose a reason for hiding this comment

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

What's the difference between runConstraintEngine() and runLcpConstraintEngine()? It's not immediately obvious from reading it, so maybe we should make the names a bit more explicit?

Base automatically changed from mguo/multi-callback to master December 22, 2021 02:39
@michguo michguo requested a review from keenon December 22, 2021 03:17
Copy link
Owner

@keenon keenon left a comment

Choose a reason for hiding this comment

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

Happy Holidays! Seems good, I think just minor changes to the tests and we should be good to go.

{
mConstraintEngineFn(_resetCommand);
mRegisteredConstraintEngine(_resetCommand);
}

//==============================================================================
void World::runLcpConstraintEngine(bool _resetCommand)
Copy link
Owner

Choose a reason for hiding this comment

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

Does it actually make sense to have _resetCommand here? Doesn't the LCP create the impulses in the first place? Why would we ever not want to reset after that?


// Integrate velocities from solved impulses. Should have non-negative normal
// velocity after integration.
EXPECT_TRUE(box->getRelativeSpatialVelocity()[4] >= 0);
Copy link
Owner

Choose a reason for hiding this comment

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

I think we need one more check here to check that having no friction actually made a difference in this case. Maybe we apply a small horizontal velocity before we run the constraints engine, and check that it's still there afterwards?

It would make sense to apply the same small horizontal velocity to the test for the LCP with friction as well, and check that the friction ends up zeroing out the velocity.

Add python bindings for `Geometry/dAdInvT`
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.

None yet

2 participants