Commit Graph

13 Commits

Author SHA1 Message Date
Kevin Zakka 0b2f19bbe7 Fix "actrange" parsing for "intvelocity" actuators.
PiperOrigin-RevId: 468759706
Change-Id: I1d9eeb723d28cccb64a6112b103345fcf451700f
2022-08-19 12:22:55 -07:00
Yuval Tassa 3d77eb1ef4 Add adhesion actuators.
- Adhesion actuators using contact normals as force transmission mechanism.
- Related video: https://youtu.be/HdBue4MUZys

Closes #229

PiperOrigin-RevId: 464389367
Change-Id: I9f69b3cd152d957e8f65870d208788463c036a6d
2022-07-31 08:54:06 -07:00
Alessio Quaglino 5c5449bf82 Compute moment of inertia for concave and boundary meshes. Resolve #338.
- Mesh inertias can now be computed exactly for well-formed (no holes) non-convex meshes.
- To activate this feature, set `<compiler exactmeshinertia="true">` (defaults to `false`). This default may change in the future.
- Added `<geom shellinertia="true/false">` (defaults to `false`). When true, geom inertia is computed assuming all the mass is concentrated on the surface, and `density` is interpreted as surface density (mass/area). Currently only mesh geoms are supported.

PiperOrigin-RevId: 464368395
Change-Id: I17afd99b9b221c9d24ae951f6e63d5c61ff89820
2022-07-31 04:32:28 -07:00
Alessio Quaglino 2d0995b47c Add visualisation groups to skins.
PiperOrigin-RevId: 458441645
Change-Id: I14324e8efda5142b2718a5cc9215228c7556dbf7
2022-07-01 04:57:34 -07:00
Saran Tunyasuvunakool 0e5ce18cff Manually parse inf and nan.
The C++ standard library `std::istringstream` is not guaranteed to parse "inf" and "nan" as valid floating point numbers. In our testing, libc++ does this, but libstdc++ and MSVCRT do not.

PiperOrigin-RevId: 455435431
Change-Id: I99c00303b08c2e4e62acfa3ca52a21a3008f4545
2022-06-16 11:57:52 -07:00
Alessio Quaglino 69a506e6ba Use C++ strcpy_arr in xml_native_reader_test.
PiperOrigin-RevId: 455375707
Change-Id: Ia3dbb11886ab29c4ad3192e4f78b4b60b94baad0
2022-06-16 07:15:14 -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
Alessio Quaglino e0b6ba4a13 Raise warning if there are NaNs in the XML.
For Windows, throw an error if NaNs are present.

PiperOrigin-RevId: 455340787
Change-Id: Ibd95e2335ab15b706ee3328816983e5b57b2315e
2022-06-16 03:09:24 -07:00
Kevin Zakka 6048a55daf Add intvelocity actuator shortcut.
PiperOrigin-RevId: 454899823
Change-Id: I9b5494baacfab5a7d03bd680d0ded06a7790e75e
2022-06-14 10:36:58 -07:00
Alessio Quaglino 16baac9353 Throw an error if multiple orientation specifiers are used in the same element.
- Applies to [orientation specifiers](https://mujoco.readthedocs.io/en/latest/modeling.html#frame-orientations) in `body`, `inertial`, `geom`, `site`, `camera`.
- Before this change the check was done only for multiple *alternative* specifiers, but not for `quat` and an alternative specifier.
- Moved the check from the compiler to the parser.
- Added tests.

PiperOrigin-RevId: 453201981
Change-Id: I20907361f211dae904e734cd083e9df0efe4f654
2022-06-06 08:13:06 -07:00
Alessio Quaglino 8902c2089a Add dyntype to IncompleteActlimited test.
The test is meant to illustrate a failure of an incomplete actrange when the rest of the line is correct.

PiperOrigin-RevId: 451895379
Change-Id: I9782fae7055c9bed87ccbc0fda18495aacb2ae8a
2022-05-30 10:37:10 -07:00
Alessio Quaglino f3453cf87f Stricter parsing of XML array attributes.
PiperOrigin-RevId: 451456510
Change-Id: I2556d4365762378261c04d3c9f1942166fbd156e
2022-05-27 12:51:02 -07:00
Saran Tunyasuvunakool 1913a02b40 Initial open sourcing of MuJoCo.
PiperOrigin-RevId: 450374687
Change-Id: Ie3225a46ce095fc28ae8e63c326a640261f562bb
2022-05-23 01:08:49 -07:00