Commit Graph

217 Commits

Author SHA1 Message Date
Kyle Bayes 056e849273 Provide improved mju_sqrMatTDSparse implementation that doesn't require dense memory allocation for sparse matrices.
PiperOrigin-RevId: 516812783
Change-Id: Ieb43337831d8d3b2c7f18a7facd8e0a0f2b0eff5
2023-03-15 06:56:16 -07:00
Yuval Tassa fe18e58ad2 Rendering of mjGEOM_LINE respects size[0] (width argument of mjv_makeconnector), denominated in pixels.
- Before this change, line width was hardcoded to 3 pixels and the width argument of mjv_makeConnector was ignored.
- After this change, the width argument is respected and interpreted in units of pixel. The non-standard width unit is ok since lines can only be drawn programmatically.

PiperOrigin-RevId: 516529265
Change-Id: I27bffabba69cde415d2ada67263a887c9240efbf
2023-03-14 08:17:36 -07:00
Alessio Quaglino ae2c530d8b Tighter axis-aligned bounding box for meshes.
PiperOrigin-RevId: 516166936
Change-Id: Ie99217f8894bdd4bb093900fc0df9d4a1e5030d3
2023-03-13 03:54:33 -07:00
Kyle Bayes d3d789cf7d Convert mju_error and mju_warning to variadic functions, supporting printf-like arguments. The functions mju_error_i, mju_error_s, mju_warning_i, and mju_warning_s are now deprecated.
PiperOrigin-RevId: 515431052
Change-Id: I440de0cb417ce216b6d636a5d86dc9ef6cc1fc06
2023-03-09 13:51:27 -08:00
Kevin Zakka bddc4b88b2 Fix comment typos.
PiperOrigin-RevId: 514360878
Change-Id: If119beec09d7eae568d8f6d8e3fa150ec7de88b6
2023-03-06 06:37:42 -08:00
Kyle Bayes 49dd6b4193 Clean up mj_id2name and mj_name2id.
PiperOrigin-RevId: 514340647
Change-Id: Idf895b2d7a4a8833725afbe5c71c777081b42d9e
2023-03-06 06:36:48 -08:00
Yuval Tassa 222ee00a66 Break out passive force functions into a new file engine_passive.c
PiperOrigin-RevId: 513834952
Change-Id: I5347440f24d767a7dc81a34e48e1e17d8c10173f
2023-03-03 08:32:16 -08:00
Yuval Tassa fd1070cf03 Delete remaining code related to now-removed distance equality constraint.
PiperOrigin-RevId: 513391064
Change-Id: I47fc344708a580c1e99bd2753113aaa408812966
2023-03-01 17:57:54 -08:00
Kyle Bayes 50bebcb4ee Precount number of non-zeros for constraint Jacobian sparse matrix.
PiperOrigin-RevId: 512947632
Change-Id: I9605e81b4e51fbc90854c13153e4fee38ad48fb9
2023-02-28 08:57:56 -08:00
Kyle Bayes 90b5dd14ca Fix issue where mj_addConstraint was writing values into efc_J_rowadr and efc_J_rownnz that are not needed.
PiperOrigin-RevId: 512919818
Change-Id: I8ee7443a2bf2265934899673f8943a83cdd4ef69
2023-02-28 06:47:56 -08:00
Alessio Quaglino f2413a5d55 Remove overwriting of particle geoms as spheres that was restored by mistake in commit d0b1a97.
PiperOrigin-RevId: 512597403
Change-Id: Ifa29ccc405d1c98ffadf65b2cefa164067f95220
2023-02-27 05:09:39 -08:00
Alessio Quaglino 7e5419f806 Remove trailing spaces in printArray, printArrayInt, printVector, and printSparse.
PiperOrigin-RevId: 512596881
Change-Id: Icfa955628b9a2955df73093b6c8df7751260adfb
2023-02-27 05:06:33 -08:00
Yuval Tassa 7e7cb177a4 Cosmetic changes.
PiperOrigin-RevId: 511008317
Change-Id: Id8d7cd4f4e22e0658857d16b47d51053f1477bb9
2023-02-20 09:23:32 -08:00
Yuval Tassa 7542c90cd2 Improved behaviour of mouse-spring interactions.
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
2023-02-20 08:40:33 -08:00
Alessio Quaglino 9756ed0d80 Read normals and textures from OBJ, do not duplicate vertices.
PiperOrigin-RevId: 510461549
Change-Id: I19245d691e722a8371e61153383f275f599353d6
2023-02-17 10:15:25 -08:00
Yuval Tassa 2607e67f8d Add contact labels showing which geom pairs are in contact.
PiperOrigin-RevId: 510422404
Change-Id: Ia73570098752e7c7175e4b5a5f2a0f8b08a6c006
2023-02-17 07:03:19 -08:00
Saran Tunyasuvunakool ace5b74f83 Rename inteval attribute in mjLROpt to interval.
PiperOrigin-RevId: 509275105
Change-Id: I0ffb9cf485a504843ed255f0b4f24e9285a1c273
2023-02-13 10:54:25 -08:00
Saran Tunyasuvunakool db28c31f05 Rename <required> tag to <plugin>.
PiperOrigin-RevId: 509237786
Change-Id: I35e812830b479004ac5025cbd9477888f51fb43e
2023-02-13 08:41:52 -08:00
Saran Tunyasuvunakool 239e00e3b1 Fix typo in the error message for distance equality constraints.
PiperOrigin-RevId: 509227257
Change-Id: Ibf501f267e513c504e527f3fe7a26d4f29e78273
2023-02-13 07:58:03 -08:00
Saran Tunyasuvunakool 5e989d18c3 Enable compiler errors for implicit switch case fallthroughs.
Also unify warning options across Clang and GCC and fix minor issues that was surfaced by this.

PiperOrigin-RevId: 508619655
Change-Id: I59b777bf2dfea4422485670e2427c7d3f5cf6405
2023-02-10 03:49:00 -08:00
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
Alessio Quaglino dd632b7ccc Bump MuJoCo version to 2.3.2.
PiperOrigin-RevId: 507720557
Change-Id: I7a5b577094ac1a7f468a84c484f62f61dc6b409f
2023-02-07 02:35:17 -08:00
Copybara-Service 6b80b010af Merge pull request #705 from hartikainen:bug/mj_deleteFileVFS-infinite-loop
PiperOrigin-RevId: 507544780
Change-Id: Ie5819d4cc567dce44ceb59624a889a06ecdd7c1b
2023-02-06 12:01:11 -08:00
Saran Tunyasuvunakool 9a7f4a768a Remove control plugin API.
This is a rollback of f937ffd93326b2964e33689b0dc6024124776a9e.

PiperOrigin-RevId: 507456400
Change-Id: I2026510e6065eb440c0c899fcc5a2cc8ff5afd49
2023-02-06 05:52:17 -08:00
Nimrod Gileadi dc3a900809 Apply body pair filtering at broadphase.
mj_contactFilter removed geom pairs where their bodies share the same weldid, but this check can be applied at broadphase instead of at geom-geom level.

PiperOrigin-RevId: 507435848
Change-Id: Ia37c741071dc5e1c26686dd319f42c9bd334d305
2023-02-06 03:46:20 -08:00
Yuval Tassa 79fffdc0ae Draw body label at the body frame rather than inertial frame, unless inertia is being visualised.
PiperOrigin-RevId: 507424290
Change-Id: I72ca68e2e47f76c0f70959a1a2c8b5f4b6b6b290
2023-02-06 02:38:51 -08:00
Saran Tunyasuvunakool 7251e7b900 Remove superfluous TINYXML2_LIB declaration.
PiperOrigin-RevId: 506867694
Change-Id: I701def961046c46f3cffe4fad2b1b9436bc1deef
2023-02-03 04:24:36 -08:00
Kyle Bayes ffe27d9680 Extract AVX code from sparse utils.
PiperOrigin-RevId: 506851218
Change-Id: I23cc3ffb26face97fc2380bc9cb702cc41b8b29d
2023-02-03 02:42:39 -08:00
Yuval Tassa a7888d473c mju_transposeSparse: extract local integer, remove extra blank line.
PiperOrigin-RevId: 506243573
Change-Id: Ia573c9289ef1deb1cc7b5477d441752370caa470
2023-02-01 01:27:46 -08:00
Yuval Tassa 7feecf6e94 Improve behaviour of set-pose mouse interactions with free and mocap bodies.
PiperOrigin-RevId: 506051745
Change-Id: If666757deb743f7bf3af4113d10976c3294e0879
2023-01-31 10:57:19 -08:00
DeepMind 929e09f84a Improve URDF geom name loading API.
PiperOrigin-RevId: 505112774
Change-Id: I866e58e664089256a41908dddab9ad79745fb1da
2023-01-27 07:29:45 -08:00
Kyle Bayes c741dfce7d Implement a more performant mju_transposeSparse that doesn't require dense memory allocation.
PiperOrigin-RevId: 505044194
Change-Id: Ibe0e39e3ad711b2b5bdad45180ca4f83b5c8fc82
2023-01-27 00:20:01 -08:00
Kristian Hartikainen d35670932f Fix for-loop syntax to match style convention 2023-01-25 19:11:13 +00:00
Kristian Hartikainen 436fc6e77c Fix infinite loop in mj_deleteFileVFS 2023-01-21 17:26:01 +00:00
Alessio Quaglino 6ba4d6f0de Fix a bug that was causing a mismatch between the orientation of the mesh frame and the vertex coordinates.
PiperOrigin-RevId: 502624466
Change-Id: Ib28fd2a118b6572be98fadb078fa2262b21cbfc0
2023-01-17 10:31:50 -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
Yuval Tassa 6e02c19ebb Print contacting geom names, if non-empty, in mj_printData output.
PiperOrigin-RevId: 502340142
Change-Id: I6359a1ea8fb515e13cb434e31d9592b9d6ce9181
2023-01-16 03:08:33 -08:00
Yuval Tassa 5b942329d2 Fix various typos.
PiperOrigin-RevId: 500951615
Change-Id: I3c61ef4328d77457d12091bbf75514872b53c2d0
2023-01-10 03:59:27 -08:00
DeepMind 703b33c064 Add geom names to URDF parsing in MuJoCo.
Fixes #566

PiperOrigin-RevId: 500750288
Change-Id: I00f94ee37bb2f15be59df3933d0d4dba583f0921
2023-01-09 10:34:22 -08:00
Alessio Quaglino 19b6c70e13 Use global coordinates for computing the frame position of a primitive geom fitted to a mesh.
PiperOrigin-RevId: 500720200
Change-Id: I0a564aff1fe6943002db14f46f789cfdaef4d2de
2023-01-09 08:29:27 -08:00
Yuval Tassa f19d5d2f28 Fix typo in mujoco.h
PiperOrigin-RevId: 500675056
Change-Id: Ie4958609563b2826cc4965b42ad4d22248c733ef
2023-01-09 04:04:25 -08:00
Saran Tunyasuvunakool 1215067f5c Add an option in mjrContext for mjr_readPixels output format.
PiperOrigin-RevId: 500342924
Change-Id: I43e8c6208db341e2bdbef10382b7293c35bdca65
2023-01-07 00:11:01 -08:00
Kyle Bayes 048bd43724 Fix various typos.
PiperOrigin-RevId: 499888205
Change-Id: I38ccf9edb2a745fe8087f14b67ecccca872f7743
2023-01-05 08:29:49 -08:00
Nimrod Gileadi f85f3fba2f Avoid duplicate contact points in compound bodies.
Sometimes broadphase returns the same body pair multiple times. In those cases, avoid creating every contact twice.

PiperOrigin-RevId: 499869235
Change-Id: I58606168b0723d40b4fdd43b1fafad79bf35d76d
2023-01-05 07:28:05 -08:00
Kyle Bayes 0c463366a0 Reduce internal names hash map from factor of 1 to 0.5.
PiperOrigin-RevId: 499762072
Change-Id: Id4ea606b5c534c55665485c9f71412523164d2ed
2023-01-05 01:29:14 -08:00
Kyle Bayes f1007df013 Implement hash map for mj_name2id using djb2 and linear probing.
PiperOrigin-RevId: 499485127
Change-Id: I5aed6549db18b92d7c8a3b7590e50a00ce13a439
2023-01-04 07:57:55 -08:00
Kyle Bayes 5261cceb30 Fix typo in engine_io.c.
PiperOrigin-RevId: 499422793
Change-Id: Ic3a0d6dcc9119041267555efd6a8addb944d6639
2023-01-04 01:35:28 -08:00
Yuval Tassa 4bc76c93ae Remove "name" attribute from plugin specifiers.
PiperOrigin-RevId: 499187319
Change-Id: I0755a071eb4eee917fdf32db49a47fd16afa58f9
2023-01-03 05:03:20 -08:00
Tom Erez 45184bfa55 Fix Typo.
PiperOrigin-RevId: 499185052
Change-Id: I159271a229c90f38836d607511459edbe1d501bb
2023-01-03 04:49:48 -08:00
Yuval Tassa 95b9a0f215 Fix typo, improve error message.
PiperOrigin-RevId: 498473694
Change-Id: I9b04df14f4afbe7148c3083da26451020bd2ebc9
2022-12-29 17:15:10 -08:00