This enables to find the spec associated with the compiler option stored in the objects, which do not necessarily belong to the model that owns them.
PiperOrigin-RevId: 713259419
Change-Id: I579c770147ff07ed2a5edd20e7a795ee7cc27147
This can happen when a body is detached without compiling or recompiling.
Also added error catching when trying to delete a body instead of detaching it.
Fixes#2327
PiperOrigin-RevId: 712526730
Change-Id: I4b48df83120fca12d475c85b3a54893841449653
Fast lookup is not possible since mjOBJ_FRAME > mjNOBJECT, which is the size of the objects maps used for the search.
Fixes#2328.
PiperOrigin-RevId: 712479460
Change-Id: I7bcfa75ff8a1e288183d60ed4a44cab5bc6f4173
All instances of mujoco_test in the code base were followed by
a call to target_link_libraries(<testname> fixture gmock).
As anyhow mujoco_test already was calling target_link_libraries
to some predefined list of targets (mujoco and gtest_main),
this PR adds to the list of default linked targets also fixture
and gmock, to reduce the boilerplate.
Furthermore, to completly remove the need for calling
target_link_libraries after a call to mujoco_test, this PR also
add to the mujoco_test macro the ADDITIONAL_LINK_LIBRARIES
argument, that can be used if a given test needs to link some
additional targets beside the default ones.
To permit to use these new features also for mujoco benchmarks,
this PR adds a MAIN_TARGET parameter to mujoco_test, to select
if gtest_main or another target is used to provide the main
entry point to the test executable.
This is required to have parent body info during attach and during body to frame tranformation for uncompiled models.
PiperOrigin-RevId: 703038426
Change-Id: Ib482059ba419a020860c649d6ea1b1088045f2e1
Also associate all children that need a parent body to the parent of the deleted body.
This is a bug that was causing the former children of the body that gets transformed to a frame to not be children of the new frame.
PiperOrigin-RevId: 702702853
Change-Id: I36d48f0446bc87c665b18d34e0b0609d82c70f51
Spec were copied after bodies are attached, so the reference to the source spec got lost during mj_copySpec().
PiperOrigin-RevId: 701287267
Change-Id: I55eff53c7ae9d42b03957be48ea506b80d274e03
This function extracts the 3D rotation from an arbitrary 3x3 matrix by refining the input quaternion. It is based on the paper "A robust method to extract the rotational part of deformations" by Müller, Matthias, Jan Bender, Nuttapong Chentanez, and Miles Macklin.
PiperOrigin-RevId: 700006006
Change-Id: I77550993233dea9cdf68601762a3ae7ded749bdf
This functionality is meant for fast copying of `mjModel` when synchronizing the visualization state, as in the Python passive viewer.
PiperOrigin-RevId: 699199743
Change-Id: I13a5160063eb09139ec1aee9c4969bc1c6f547f1
Note: frameless_contact_hfield.xml doesn't work with libccd nor nativeccd on ARM as expected.
PiperOrigin-RevId: 698317464
Change-Id: I4c57e04639b9870b416c67d79a16a313c5276cf6
Also, fix a bug with Flex textures that was causing an incorrect allocation of the textures in mjModel. Fixes#2013.
PiperOrigin-RevId: 692510858
Change-Id: If781716216974e085244da27bc3aa57d91c3458c