Commit Graph

9 Commits

Author SHA1 Message Date
Nimrod Gileadi 48e95817e4 Don't compute sensors in mjd_transitionFD, if not requested.
PiperOrigin-RevId: 507878658
Change-Id: I97ece521fd177d97fa5758dda1eb012ba26bcabe
2023-02-07 14:02:45 -08:00
Yuval Tassa 06557c1489 Set time correctly in mjd_transitionFD, to support time-dependent user code.
PiperOrigin-RevId: 502380864
Change-Id: Ief36135a900c091d95e4450992c7c73e86de267c
2023-01-16 07:52:17 -08:00
Alessio Quaglino 9fc9823a8c Speed improvements in mj_solveLD (14% on Intel Skylake Xeon 36 cores).
PiperOrigin-RevId: 486960670
Change-Id: I8fce96427158ec36069dea893500059e93bd40db
2022-11-08 08:38:45 -08:00
Yuval Tassa e3a82247c2 Add sensor matrices to mjd_transitionFD.
- Also add missing `mj_jacSubtreeCom` to Python bindings.

PiperOrigin-RevId: 471610181
Change-Id: I31410d194527ce6a7bdbd01e176f3a41efa52d84
2022-09-01 13:00:36 -07:00
Yuval Tassa 52d78f8d24 Remove unused mjData argument in private function mj_solveLD.
PiperOrigin-RevId: 464087933
Change-Id: Ibe9e9713680a02bfe098c39191f9b706e2c70c12
2022-07-29 08:53:04 -07:00
Yuval Tassa ea956dfe34 Derivatives of ellipsoid fluid model.
PiperOrigin-RevId: 459751881
Change-Id: I52db87d82e20e10698b13065df2e983b9841bd7a
2022-07-08 07:19:48 -07:00
Yuval Tassa 228264c92b Add efficient finite-difference Jacobians of mj_step.
- Add `qH` and `qHDiagInv` to `mjData` to save factorized modified inertia.
- Add `mj_EulerSkip`, `mj_implicitSkip`, to `engine_forward.c`.
- Using the above functions, implement `mj_stepSkip` in `engine_derivative.c`.
- Add `mjd_stepFD` and `mjd_transitionFD` to `engine_derivative.c` to compute `mj_step` Jacobians.
  - Exploit "Skip" functionality for speed.
  - Correctly handle quaternion derivatives.
  - Handle warmstarts and control limits.

PiperOrigin-RevId: 456584811
Change-Id: Iee8541f11e7b66feb8f431cb102d9bbe65461f79
2022-06-22 12:48:48 -07:00
Alessio Quaglino 307cf692e5 Add <damper> actuator shortcut and related mjGAIN_AFFINE.
**Rationale**

A general `mjGAIN_AFFINE` actuator adds the term `force = (c + kp * length + kv * velocity) * ctrl`. The damper shortcut restricts it to `kv * velocity * ctrl` and sets the `ctrllimited` attribute to true.

**API**

```xml
<actuator>
  <damper ctrlrange="0 1" kv="1"/>
</actuator>
```

* Required attributes: `ctrlrange` (>=0)
* Optional attributes: `kv` (>=0)

PiperOrigin-RevId: 455366866
Change-Id: I88773abbeccabb6442f215c9fc05e205df63f692
2022-06-16 06:21:17 -07:00
DeepMind 64bc6d27b2 Add implicit integrator.
Added analytic derivatives of smooth (unconstrained) dynamics forces, with respect to velocities:
  - Centripetal and Coriolis forces computed by the Recursive Newton-Euler algorithm.
  - Damping and fluid-drag passive forces.
  - Actuation forces.

A new implicit-in-velocity integrator is implemented using the analytic derivatives. This integrator lies between the Euler and Runge Kutta integrators in terms of both stability and computational cost.

PiperOrigin-RevId: 450377010
Change-Id: Ie192b441876c22e732fb749333926f296e0a09cc
2022-05-23 01:22:15 -07:00