google-deepmind / mujoco

Multi-Joint dynamics with Contact. A general purpose physics simulator.
https://mujoco.org
Apache License 2.0
7.89k stars 791 forks source link

[Unity Plugin] Track separate kv property for position actuators #1696

Closed Balint-H closed 3 months ago

Balint-H commented 4 months ago

Added support for kv in position actuators in Unity, missing since 3.1.0 . At first I just reused the Kv property of the velocity actuators however that had some undesired quirks, such as the default value being 1 instead of 0 for position actuators, or that changing the parameter value when editing the actuator as a velocity actuator influenced the position actuator. For this reason, I seemingly redundantly declared the Kvp parameter, let me know if you have any issues or suggestions for this issue.

I'm also interested on any potential suggestions for the intvelocity actuators which are also missing at the moment, but have their own kp and kv. I'm considering not tracking all these parameters in MjActuator and its Editor at all in the first place, and have sibling classes for each different actuator type, drawing their own Editor and supplying their MJCF parsing/conversion separately.