Also:
- Renamed recently introduced `mjvPerturb` member `reflocalpos` -> `refselpos` and corrected docstring.
- Added `mjvPerturb.localmass`: body spatial inertia at selection point.
- Removed `const` qualifier to `mjData` argument of `mjv_initPerturb()`, to facilitate spatial inertia computation.
- Improved `mj_Object{Velocity, Acceleration}` docstrings, clarifying that rotational velocities precede linear velocities.
- Removed redundant const qualifiers from non pointer arguments to `mju_dot` and `mju_writeNumBytes`.
PiperOrigin-RevId: 511002168
Change-Id: I27400f497947f330072d4abb7c9bf7e71e6c5d49
The `reset` function is called inside `mj_resetData`, before any physics forwarding call has been made. It is therefore an error to read anything from mjData at this stage.
The only valid operation on mjData during `reset` is for a plugin to write into its own state variable slots and data struct. We modify the function signature to only provide access to these.
PiperOrigin-RevId: 495032492
Change-Id: Ic6d2967d2571a9083cbca1ba239ca70a8a51f474
- Also change signatures of `mju_fill` and `mju_symmetrize` to conform to standard.
PiperOrigin-RevId: 485613824
Change-Id: I8dd618bac92ef40aa6c76380fa73302e81968687
If given two non-decreasing values, `springlength` specifies a deadband for spring stiffness, inside of which the force is 0 and outside of which force behaves like a regular spring, with the setpoint corresponding to the nearest value. This can be used to create tendons whose limits are enforced by springs rather than constraints, which are cheaper and easier to analyse. See test/engine/testdata/tendon_springlength.xml example model.
Spring-limited spatial tendons whose lower range value is 0 are rendered as catenaries.
Fixes#520.
PiperOrigin-RevId: 484509706
Change-Id: I6698e94ee36168f52d501e83057559805e05172d
- Added new `cable` composite type:
* The `initial` parameter specifies the joint at the starting boundary: `free`, `ball`, or `none`.
* The boundary bodies are exposed with the names:`B_left` and `B_right`.
* The vertex initial positions can be specified directly in the XML with the parameter `vertex`.
* The orientation of the body frame **is** the orientation of the material frame of the curve.
- Added new `cable` passive force plugin:
* Twist and bending stiffness can be set separately with the parameters `twist` and `bend`.
* The stress-free configuration can be set to be the initial one or flat with the flag `flat`.
* New cable example showing the formation of plectoneme.
* New coil example.
* New belt example showing interaction between twist and anisotropy.
* Added test using cantilever exact solution.
PiperOrigin-RevId: 480033694
Change-Id: I491271bce8fccb185961477e903e5a72d172c8a3
- Add private function `mj_arenaAlloc`. This is used internally to allocate memory from the arena.
- Add private function `mj_nefc` to count constraints. This function returns a tight upper bound on `d->nefc`. The number of counted constraints can be slightly bigger than exact `d->nefc` in the case of constraints with empty Jacobian, as when placing a frictional tendon between two world sites.
- Add new `memory` attribute to the `size` XML element for specification of arena memory size. This attribute is mutually exclusive with `nstack` and `njmax` specifications, which are now deprecated (but left around for the time being for legacy compatibility).
- Move `d->stack` to the end of the new arena space. The stack now grows in reverse from the end.
PiperOrigin-RevId: 479341539
Change-Id: Ie019c202e0908577ffc6f833a37920858116f667
- Before this change, an asymmetric Hessian would lead to solver failure. After this change the Hessian is symmetric by definition (upper triangle is ignored).
- API documentation was updated to reflect this contract.
PiperOrigin-RevId: 477135411
Change-Id: I60d011d36853afebac26c359771c217baf101360
Commit e3a82247c2 removed MJAPI in mujoco.h but not in engine_derivative.h, causing a linking error when building on Windows with MSVC.
PiperOrigin-RevId: 471639915
Change-Id: I6b965e23a19faee6f9f8f9c0168dc2774b19f310
- `anchor` determines the point of wrench application, in the frame of body2.
- `tfratio` scales applied torques relative to applied forces.
- Add visualisation of both anchor points to both weld and connect constraints.
- Add a test model showing how the new weld parameters behave.
PiperOrigin-RevId: 470021901
Change-Id: I3faba0e5dcab2e29ee81096f5ff71ff66d99758c
- `anchor` determines the point of wrench application, in the frame of body2.
- `tfratio` scales applied torques relative to applied forces.
- Add visualisation of both anchor points to both weld and connect constraints.
- Add a test model showing how the new weld parameters behave.
PiperOrigin-RevId: 469228149
Change-Id: I836b0791f10fb624607a12ef3c687da991c21789