Move some aspects of eq
from Model to Data
#876
Replies: 3 comments 11 replies
-
Yup this is a good idea that we've discussed before. However, removing things from My proposal would be to add |
Beta Was this translation helpful? Give feedback.
-
I think we should add eq_enable to mjData, initialize it to
mjModel.eq_enable in mj_reset(), and then use it at runtime to
enable/disable constraints. Making it float does not work, since the
constraint forces are computed by the solver and it is not a good idea to
scale them afterwards.
Incidentally, in the new soft bodies I am adding, it also makes sense to do
this in mjData so as to cut/tear soft bodies. I will have to add a similar
field for collision elements in mjData (something like elem_enable) so
that both collisions and equality constrains can be disabled at runtime.
In that case though, there is no corresponding field in mjModel.
…-- Emo
On Fri, May 19, 2023 at 10:40 AM Yuval Tassa ***@***.***> wrote:
Ya control implies applying forces which is not what this is. Also the
reason it has to be eq_data_input. You can't delete the _data since we're
not touching the constraint forces, just parameters. _param would have
been better than _data but too late now I guess.
The more I roll with _input the more I like it. Override is more precise
but long and clunky.
Another thought I'm having is that eq_active should be a float. 0 means
the same thing, remove from efc, but in (0, 1] it weakens the constraint
force proportionally. Maybe @emotodorov <https://github.com/emotodorov>
knows of a principled way of doing this.
—
Reply to this email directly, view it on GitHub
<#876 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2V4L2Y6NGX6LSVD2SEI73XG6A45ANCNFSM6AAAAAAYGSBM5Y>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Fixed by ee78b8f |
Beta Was this translation helpful? Give feedback.
-
I'm working on manipulation of deformable objects (rope) and I've found myself using
m.eq_active
andm.eq_data
in ways that feel more like data than they do model. Generally speaking, things in model should not change during the simulation. However, using equality constraints to simulate simplified grasping is very handy, and means you probably want to changeeq_data
andeq_active
during the simulation. Right now if I want to save/restore/copy the simulation state I have to also remember to do those fields frommodel
in addition to the entiredata
object. Might it make sense to move them to the MjData structure instead?Beta Was this translation helpful? Give feedback.
All reactions