Changelog¶
Versioning¶
This project uses semantic versioning. This means that any incompatible changes increase the major version (X.y.z). This also includes breaking changes that MuJoCo itself introduced, thus even an update of MuJoCo alone can increase the major version.
5.0.0 (MuJoCo 3.9.0)¶
Breaking changes
MuJoCo FFI upgraded to 3.9.0
MuJoCo-rs now builds against MuJoCo 3.9.0 FFI. This is a breaking dependency-level change for consumers tied to older MuJoCo C ABI details. See MuJoCo’s changelog for this release: https://mujoco.readthedocs.io/en/3.9.0/changelog.html
(Potentially breaking) Changed raw pointer types of trait methods
Changed raw pointer types of trait methods. For example,
element_pointer(&self)now returns*const mjsElement. This is a change that should not affect most users, unless they explicitly opted in to using the C model-editing API of MuJoCo directly, or implemented/depended on the old trait method signature in advanced extension code.
MjrContext::upload_texture parameter type changed
MjrContext::upload_texture now accepts
texture_id: usizeinstead oftexid: u32.
MjrContext::upload_texture is now fallible
MjrContext::upload_texture now returns
Result<(), MjrContextError>instead of()and no longer panics. Pass an out-of-range ID to receiveMjrContextError::IndexOutOfBounds { id, len }instead of a panic.
MjrContext::add_aux / set_aux error type changed
MjrContext::add_aux and MjrContext::set_aux previously returned
Result<(), MjSceneError>(withMjSceneError::InvalidAuxBufferIndex); they now returnResult<(), MjrContextError>(withMjrContextError::IndexOutOfBounds).
MjSceneError::InvalidAuxBufferIndex / InvalidViewport / BufferTooSmall removed
MjSceneError::InvalidAuxBufferIndex,MjSceneError::InvalidViewport, andMjSceneError::BufferTooSmallhave been removed from MjSceneError. Code matching on these variants will fail to compile. Replace them with the corresponding MjrContextError variants (see migration guide).
MjrContext::read_pixels error type changed
MjrContext::read_pixels previously returned
Result<…, MjSceneError>(withMjSceneError::InvalidViewportandMjSceneError::BufferTooSmall); it now returnsResult<…, MjrContextError>(withMjrContextError::InvalidViewportandMjrContextError::BufferTooSmall).
MjModelError::InvalidIndex removed
MjModelError::InvalidIndex(usize, usize)has been removed from MjModelError. Code matching on this variant will fail to compile. Replace it with IndexOutOfBounds (see migration guide).
MjsTuple::set_objtype now takes ``&[MjtObj]`` and is fallible
MjsTuple::set_objtype now accepts
&[MjtObj]instead of&[i32]and is a safefnreturningResult<(), MjEditError>instead of(). Out-of-range object types are rejected withMjEditError::InvalidParameter. See the migration guide.
MjsSensor::set_objtype / set_reftype are now fallible
MjsSensor::set_objtype and MjsSensor::set_reftype now return
Result<(), MjEditError>instead of(), rejecting out-of-range object types withMjEditError::InvalidParameter. The builder counterpartswith_objtype/with_reftypekeep their signature but panic on a rejected value. See the migration guide.
MjsNumeric::set_size is now fallible
MjsNumeric::set_size now returns
Result<(), MjEditError>instead of(), rejecting a negative size withMjEditError::InvalidParameter(a negative size triggers an out-of-bounds write in the model compiler). See the migration guide.
Some index/size vector setters are now ``unsafe``
MjsFlex::set_elemtexcoord,MjsSkin::set_face,MjsMesh::set_userfacetexcoordandMjsMesh::set_userfacenormalare nowunsafe fn: each writes a value the model compiler or renderer later trusts as an unchecked array index, count, ormemcpylength, and the correct constraint is cross-field (it cannot be checked from the setter alone). Each carries a# Safetysection describing the caller’s obligation. See the migration guide.
MjData::history_mut is now an ``unsafe fn``
MjData::history_mut is now
unsafe. The signature is otherwise unchanged; existing calls only need anunsafeblock. The immutablehistoryaccessor remains safe. See the migration guide.
Mjs element handles and MjsDefault are no longer Send/Sync
The
Mjs*element handles (MjsBody,MjsGeom, …) andMjsDefaultare now!Send + !Sync; they previously carried a blanketunsafe impl Send/Sync. Each handle is only a raw pointer into one sharedmjSpec/mjCModelarena, so moving or sharing one across threads was unsound (see Bug fixes). Code that did so will no longer compile — move the owning MjSpec instead, which remainsSend(it is no longerSync; see below).
MjData::add_contact is now an ``unsafe fn``
MjData::add_contact is now
unsafe. It stores the caller-suppliedMjContactverbatim, and MuJoCo later uses it without validation, so a malformed contact can cause undefined behavior (see Bug fixes). The signature is otherwise unchanged; existing calls only need anunsafeblock.
MjData::reset_debug is now an ``unsafe fn``
MjData::reset_debug is now
unsafe. The debug fill writes raw bytes into arrays whose accessors expose types with validity invariants (bool, fieldless enums), so reading them afterwards can be undefined behavior (see Bug fixes). The signature is otherwise unchanged; existing calls only need anunsafeblock.
MjData::ray / ray_mesh now take &mut self
MjData::ray, MjData::ray_mesh, and MjData::try_ray_mesh now take
&mut self(previously&self). Their bounding-volume traversal mutatesdata.bvh_active(see Bug fixes), so callers holding a shared&MjDataneed an exclusive borrow instead.ray_flex/ray_hfieldare unaffected and remain&self;multi_rayalready took&mut self.
MjvScene::find_selection now takes &mut MjData
MjvScene::find_selection now takes
data: &mut MjData<M>(previously&MjData<M>). It callsmjv_select->mj_ray, whose bounding-volume traversal mutatesdata.bvh_active(see Bug fixes), so an exclusive borrow is required. This mirrors MjvScene’supdate(already&mut MjData) and theray/ray_meshchange above.
MjSpec is no longer Sync
MjSpec is now
Sendbut no longerSync(see Bug fixes). Several&selfmethods – notablyclone/try_clone– drive C-side writes to the spec, so sharing a&MjSpecacross threads is unsound. Code that requiredMjSpec: Sync(for example placing a&MjSpecin a type that demandsSync) will no longer compile; transfer ownership instead, asMjSpecremainsSend.
MjsTendon::wrap / wrap_mut no longer return Option
MjsTendon’s
wrapandwrap_mutnow return&MjsWrap/&mut MjsWrap(previouslyOption<&MjsWrap>/Option<&mut MjsWrap>) and panic if the index is out of bounds. The old signature documentedNoneon an out-of-range index, but the underlying Cmjs_getWrapaborts the process for such an index and never returns null, so theNonearm was unreachable. Drop the.unwrap()on existing calls and ensure the index is in range (< wrap_num()), or use the new fallibletry_wrap/try_wrap_mut.
Deprecations
Deprecated SpecItem::delete due to it relying on undefined behavior. Users are expected to use MjSpec::delete_element instead.
Deprecated MjsTendon’s
try_wrap_site,try_wrap_geom,try_wrap_joint, andtry_wrap_pulley— theirMjEditError::AllocationFailedarm is unreachable and an allocation failure cannot be recovered soundly (MuJoCo aborts the process, or writes through the null pointer before returning). Use the panickingwrap_site/wrap_geom/wrap_joint/wrap_pulleyinstead. These methods may be undeprecated in the future if MuJoCo’s upstream C++ code is changed to return null recoverably.
Error handling
New error types:
MjrContextError: new error enum for MjrContext operations, with variants:
IndexOutOfBounds { id, len }— an index passed to a rendering-context operation is out of range (covers GPU asset uploads and aux buffer index checks).InvalidViewport { width, height }— the viewport dimensions are invalid for pixel read-back.BufferTooSmall { name, got, needed }— the caller-supplied buffer is too small to hold the read-back data.
New error variants in pre-existing enums:
MjViewerError:
SignatureMismatch(model structure does not match the viewer’s passive model),IndexOutOfBounds { id, len }(asset ID out of range),ContextError(MjrContextError)(wraps a rendering-context error, e.g. from pixel read-back during screenshot capture).RendererError:
SignatureMismatch(model structure does not match the renderer’s current scene),ContextError(MjrContextError)(wraps a rendering-context error, e.g. an out-of-range asset ID).MjEditError:
InvalidParameter(String)(a value was rejected; the string describes the rejection). Returned by the newset_to_*actuator helpers (see New features and improvements) and by the now-validating settersMjsSensor::set_objtype/set_reftype,MjsTuple::set_objtypeandMjsNumeric::set_size(see Breaking changes).
New features and improvements
Fallible tendon wrap accessors
Added MjsTendon::try_wrap and MjsTendon::try_wrap_mut, the fallible counterparts of
wrap/wrap_mut. They returnResult<&MjsWrap, MjEditError>and yieldMjEditError::IndexOutOfBoundsfor an out-of-range index instead of panicking. A new MjEditErrorIndexOutOfBoundsvariant carries the offending index and length.
MjrContext GPU re-upload methods
MjrContext::upload_texture now takes
&selfinstead of&mut self, relaxing the mutability requirement.MjrContext now provides two additional GPU asset re-upload methods:
upload_mesh re-uploads a mesh to the GPU by mesh ID.
upload_hfield re-uploads a height field to the GPU by height-field ID.
Viewer GPU asset re-upload
The Rust viewer now supports re-uploading textures, meshes, and heightfields to the GPU at runtime, mirroring the behaviour of MuJoCo’s C++ Simulate viewer.
The singular methods MjViewer::update_texture_from, MjViewer::update_mesh_from, and MjViewer::update_hfield_from copy and mark one asset at a time. All methods return
Result<(), MjViewerError>.The plural methods MjViewer::update_textures_from, MjViewer::update_meshes_from, and MjViewer::update_hfields_from copy and mark all assets of that type. All methods return
Result<(), MjViewerError>.For multi-threaded programs the same singular and plural methods are available on the shared-state guard: ViewerSharedState::update_texture_from, ViewerSharedState::update_mesh_from, ViewerSharedState::update_hfield_from, ViewerSharedState::update_textures_from, ViewerSharedState::update_meshes_from, and ViewerSharedState::update_hfields_from.
Renderer GPU asset re-upload
The Rust renderer now supports re-uploading textures, meshes, and heightfields to the GPU at runtime.
The singular methods MjRenderer::update_texture_from, MjRenderer::update_mesh_from, and MjRenderer::update_hfield_from upload one asset immediately. All methods return
Result<(), RendererError>.The plural methods MjRenderer::update_textures_from, MjRenderer::update_meshes_from, and MjRenderer::update_hfields_from upload all assets of that type immediately. All methods return
Result<(), RendererError>.
Model-editing and utility API additions
Added mju_sym2dense as a wrapper for MuJoCo’s sparse-to-dense conversion utility. It is an
unsafe fn: the C routine indexesmat/colind/resfrom the caller-supplied sparse structure without bounds checks, and the only way to validate that structure would be to iterate the index arrays, so the consistency ofrownnz/rowadr/colindis documented as a# Safetyprecondition instead.Added model-editing convenience APIs:
timer for CTIMER values.
id for retrieving optional element IDs.
delete_element for deleting a spec element by its FFI pointer — the sound replacement for the deprecated
SpecItem::delete.
Added the missing frame-finding methods to MjSpec: frame and frame_mut.
MjsActuator now exposes the full family of actuator-configuration helpers covering MuJoCo’s
mjs_setToXC API:set_to_motor,set_to_position,set_to_int_velocity,set_to_velocity,set_to_damper,set_to_cylinder,set_to_muscle,set_to_adhesion, andset_to_dc_motor. Helpers whose C function takes nullable parameters take a dedicatedDefault-able config struct (PositionConfig,IntVelocityConfig,DcMotorConfig) in which the nullable parameters areOptionfields. Each config can be built either with struct-update syntax or with chainablewith_*builder methods (which take the inner value and wrap optionals inSome), so callers specify only the fields they need and unset optionals default toNone. For example:actuator.set_to_dc_motor(DcMotorConfig::default().with_motorconst([1.0, 1.0]).with_resistance(1.0))?. Helpers whose parameters are all mandatory keep simple positional arguments (e.g.set_to_velocity(kv),set_to_cylinder(timeconst, bias, area, diameter),set_to_muscle(...)). Helpers that MuJoCo can reject returnResult<(), MjEditError>(e.g.set_to_damper,set_to_muscle,set_to_dc_motor); those that cannot fail (set_to_motor,set_to_velocity,set_to_cylinder) return().
New examples
Asset re-upload — demonstrates animated heightfield, texture, and mesh GPU re-uploads with active physics: a ball falls onto a rippling terrain and bounces within a smooth-step wall. Physics and rendering run on separate threads.
Renderer asset re-upload — demonstrates the same animated assets using the offscreen renderer: heightfield, texture, and mesh are mutated each frame and immediately re-uploaded before rendering to PNG frames.
Bug fixes
Fixed MjsTendon’s
wrap/wrap_mut, which documented returningNonefor an out-of-bounds index but could never do so: the underlying Cmjs_getWrapaborts the process for such an index and never returns null, so theNonecase was unreachable. The accessors now reject an out-of-range index in Rust — panicking, or returningMjEditError::IndexOutOfBoundsvia the newtry_wrap/try_wrap_mut(see Breaking changes).Fixed a model-editing potential undefined behavior in MjsBody, which occurred when yielded references of body’s items were not destroyed before the next entry to the iterator. This was problematic if individual references of yielded items were stored and later used — technically a undefined behavior due to reuse of the
MjsBodyinside the iterator. TheMjsBodyparent is now stored as a raw FFI pointer to prevent such aliasing.Fixed an out-of-bounds read reachable from safe code in MjvCamera::frame: a fixed camera whose
fixedcamidwas outside the model’s camera range caused MuJoCo’smjv_cameraFrameto readcam_xpos/cam_xmatout of bounds.framenow validates the id against the model and panics on an out-of-range fixed camera id instead.Extended that same fixed-camera range check to MjvScene::update: an out-of-range
fixedcamidno longer reachesmjv_cameraFrame(whosemjCAMERA_FIXEDbranch readscam_xpos/cam_xmatbefore MuJoCo’s own range check). This also closes the same out-of-bounds read on the offscreen renderer and the viewer, which both update through this method.Fixed an out-of-bounds read reachable from safe code in MjvScene::update (and
update_with_catmask) when an active perturbation carried an out-of-rangeselectbody id. MuJoCo’smjv_updateSceneonly guardsselect <= 0(it has no upper-bound check) before indexingxpos/xmat/body_bvhnumbyselect, so a too-large id read out of bounds.updatenow validatesselectagainst the model’snbodyand panics on an out-of-range id.Fixed an out-of-bounds read reachable from safe code in MjvPerturb::move_ when the public
selectfield held an out-of-range body id.move_now validatesselectagainst the model’snbodyand panics on an out-of-range id.Closed an unsoundness in MjData::add_contact, which was safe but copied a caller-built
MjContactinto the data arena without validation. MuJoCo later uses the stored contact’s fields without bound checks (when building constraints and when reading forces), so a malformed contact could cause out-of-bounds access from safe code.add_contactis now anunsafe fn: the caller guarantees the contact is valid for the model. See the Breaking changes section and the migration guide.Closed an unsoundness in MjData::reset_debug, which was safe but filled
mjDataarrays with rawdebug_valuebytes that safe accessors could then read back as invalid values for types with validity invariants (e.g.bool, fieldless enums) — undefined behavior for anydebug_valueother than 0 or 1.reset_debugis now anunsafe fn: the caller guarantees such accessors are not read before the next reset. See the Breaking changes section and the migration guide.Fixed a thread-safety hole reachable from safe code in the model-editing handles. Every
Mjs*element handle andMjsDefaultcarried a blanketunsafe impl Send/Sync, although each is only a raw pointer into one sharedmjSpec/mjCModelarena. Together with the lending mutable iterators (which hand out several simultaneously-live&muthandles), safe code could move handles to different threads and call mutators such as SpecItem::set_name concurrently;mjs_setNamereaches model-global state (mjCModel::CheckRepeatand the shared error buffer), so the calls raced on the one arena – undefined behavior. The handles (andMjsDefault) are now!Send + !Sync, so such a mutation can no longer cross a thread boundary; the owning MjSpec staysSend(it is now!Sync; see below).Closed an unsoundness reachable from safe code in MjData::ray and MjData::ray_mesh, which took
&selfalthough their bounding-volume traversal (mju_rayTree) writesdata.bvh_activewhen the model’sbvactivevisualization flag is set. The MuJoCo C functions declareconst mjData*yet mutate through it, so the&selfsignature let safe code drive shared-state mutation: withMjData<M>: Synctwo threads could race onbvh_active, and a&[bool]borrowed from the safebvh_activeaccessor could be mutated while still live.ray,ray_mesh, andtry_ray_meshnow take&mut self. See the Breaking changes section and the migration guide.Closed an unsoundness reachable from safe code in MjvScene::find_selection, which took a shared
&MjDataalthough it callsmjv_select->mj_ray, whose bounding-volume traversal writesdata.bvh_active(the sameconst mjData*-but-mutating path asrayabove). The shared borrow let safe code drive that mutation: withMjData<M>: Synctwo threads could race onbvh_active, and a&[bool]from the safebvh_activeaccessor could be mutated while still live.find_selectionnow takes&mut MjData. See the Breaking changes section and the migration guide.Closed an unsoundness reachable from safe code in MjSpec, which carried an unconditional
unsafe impl Sync.clone/try_cloneproduce a faithful, independent copy, but the C++ copy constructor behindmj_copySpecis not strictlyconston the source: for each actuator it clears twostd::mapkeyframe-resolution caches (ForgetKeyframes). Those maps are empty for a normally-built spec, yetstd::map::clearrewrites the tree header unconditionally, so two threads sharing a&MjSpecand cloning concurrently raced on those writes (no spec data is lost). MjSpec is now!Sync(it staysSend). See the Breaking changes section and the migration guide.Closed an out-of-bounds write reachable from safe code in utility::mju_normalize when called with an empty slice. The wrapper now panics on an empty slice.
Closed an unsoundness reachable from safe code in
MjsMesh::set_userfacenormal, which stored unvalidated face-normal indices the renderer later dereferences without a bound check. It is now anunsafe fnwith a# Safetycontract. See the Breaking changes section and the migration guide.Closed a heap overflow reachable from safe code when compiling an MjSpec whose texture has a builtin pattern and
nchannel < 3(MuJoCo’s builtin generators write more bytes than such a buffer holds). MjSpec::compile now rejects this configuration withMjEditError::CompileFailed.Closed an out-of-bounds read reachable from safe code in MjData::history_mut, which exposed a cursor the sensor/control read path trusts as an array index. It is now an
unsafe fn; the immutablehistoryaccessor stays safe. See the Breaking changes section and the migration guide.
Other changes
Updated bool-typed wrappers to use
MjtBoolwhere MuJoCo usesmjtBool. This is not a Rust API breaking change becauseMjtBoolis a type alias tomjtBool, andmjtBoolisboolby default. Related struct fields and function parameters now avoid force-casting and use MuJoCo’s bool mapping directly. Fields that areMjtBytein MuJoCo remain byte-backed and are not part of theMjtBoolmigration.Added missing
mjt*type aliases for recently surfaced MuJoCo enums:MjtMeshBuiltin,MjtCTimer.Added auxiliary exposed aliases:
MjPreContact,MjfCollision,MjpResourceProvider.SpecItem::element_pointer and SpecItem::element_mut_pointer are no longer marked
unsafe.MjData::set_state is no longer marked
unsafe. MuJoCo 3.9.0 changedeq_activetomjtBool(Cbool), so writes throughmjSTATE_EQ_ACTIVEare booleanized on assignment and readingeq_active()afterwards can no longer cause undefined behavior. Existingunsafe { data.set_state(...) }call sites keep compiling and only produce anunused_unsafewarning.
4.0.1 (MuJoCo 3.8.0)¶
Bug fixes
When using the
auto-download-mujocofeature, the build script now checks for existence of the library before downloading it. When the library exists, its download and extraction are skipped.
4.0.0 (MuJoCo 3.8.0)¶
Breaking changes
MuJoCo upgraded to 3.8.0
MuJoCo-rs 4.0.0 is based on MuJoCo 3.8.0, upgraded from 3.6.0. MuJoCo 3.8.0 introduces breaking changes to its C API (renamed and removed constants, new struct fields). Code relying on specific MuJoCo enum values or internal constants may need to be updated.
MjData::geom_distance now requires mutable access
MjData::geom_distance and MjData::try_geom_distance now take
&mut selfinstead of&self. This follows MuJoCo 3.7.0, wheremj_geomDistancemutatesmjDatainternally.
Model-editing wrappers now expose polynomial stiffness and damping coefficients
MjsJoint:
stiffnessanddampingnow expose coefficient arrays instead of scalarf64values.MjsTendon:
stiffnessanddampingnow expose coefficient arrays instead of scalarf64values.
MjsFlex::vertcollide removed
MjsFlex::vertcollideis no longer available. MuJoCo 3.7.0 removed the upstreammjsFlex::vertcollidefield, so the wrapper no longer exposes it.
MjData::model_mut is now unsafe
Because the MjData::model_mut allows full model replacement in unsafe ways, it is now marked unsafe.
MjViewer::add_ui_callback closure now receives Box<MjModel>
The passive model stored inside the viewer changed from
Arc<MjModel>toBox<MjModel>. The closure passed to MjViewer::add_ui_callback now receives&mut MjData<Box<MjModel>>.
Error handling
Added a new variant for handling invalid indices in MjModel::try_max_contacts:
MjModelError::InvalidIndex.
New features and improvements
Updated FFI bindings and wrappers to match MuJoCo 3.8.0 headers.
MjModel now exposes the new joint, dof, tendon, and actuator coefficient arrays and actuator-linkage fields added in newer MuJoCo releases. MjsActuator now exposes its
dampingcoefficient array andarmaturefield.MjtLRMode is now exported for typed access to
MjLROpt.mode.In light of MjData::model_mut becoming unsafe, six new methods are created to allow safe access to model fields:
Immutable getters:
model_vis, and
Mutable accessors:
MjViewer model parameter synchronization
ViewerSharedState now provides methods to sync model parameters:
sync_model syncs all model parameters (physics options, visualization, and statistics) bidirectionally, detecting model changes via signature comparison.
sync_model_vis, and
allow syncing model physics options, visualization parameters, and statistics individually from the viewer’s passive state to external structures without requiring
unsafeaccess.Corresponding getter methods last_opt_sync_time, last_vis_sync_time, and last_stat_sync_time return when each parameter type was last synchronized, enabling UI warnings for out-of-sync parameters.
MjViewer now provides proxy methods (sync_model, sync_model_opt, sync_model_vis, sync_model_stat) that delegate to the corresponding ViewerSharedState methods, enabling convenient parameter synchronization without manual lock management.
Viewer camera tracking modal
The viewer UI now features an interactive camera tracking modal for selecting bodies to track. Select “Track” in the camera panel to open a modal with a scrollable grid of body buttons.
Other changes
Removed the
stl_meshexample. It existed in MuJoCo-rs 3.0.1 due to MuJoCo 3.6.0 requiring a plugin to load STL meshes. MuJoCo 3.7.0+ fixes this, thus the example is no longer required.Reduced default width of the viewer’s UI side panel to 200.0.
Physics options (integrator, cone, jacobian, solver) in the viewer UI display a yellow warning when model parameters (opt/vis/stat) are out of sync with their initial values, indicating that parameters have been modified in the viewer.
3.0.1 (MuJoCo 3.6.0)¶
New features and improvements
mujoco_rs::wrappers::mj_plugin: load_plugin_library new and load_all_plugin_libraries new load a single or all MuJoCo plugin shared libraries. load_all_plugin_libraries accepts an optional MjPluginLibraryLoadCallback new function pointer invoked for each loaded library.Added
stl_mesh.rsnew – demonstrates loading plugin libraries and loading a model with an STL mesh asset.
3.0.0 (MuJoCo 3.6.0)¶
Breaking changes
Methods now return Result instead of panicking
The following methods previously returned
()and panicked on error. They now returnResultdirectly:MjData:
reset_keyframe,set_state,copy_visual_to,copy_toMjrContext:
read_pixelsMjvFigure:
push,set_atMjRenderer:
set_font_scalenow returnsResult<(), RendererError>;with_font_scalenow returnsResult<Self, RendererError>.
Callers must now handle the
Result(e.g. append.unwrap()or?).
Default features changed
viewer,viewer-ui,renderer, andrenderer-winit-fallbackare no longer enabled by default. Enable them explicitly when needed (e.g.cargo add mujoco-rs --features "viewer-ui renderer-winit-fallback").
MjvScene is no longer generic
MjvScene is no longer generic over
M. It is now a plainstruct MjvScenewithout a type parameter.MjvScene::newnow takesmodel: MwhereM: Deref<Target = MjModel>(acceptsArc<MjModel>,&MjModel, etc.).MjvScene::update,MjvScene::update_with_catmask, andMjvScene::find_selectionnow take a generic<M>parameter on the method rather than on the struct. They panic ifdatawas created from a different model (signature mismatch).MjvSceneexposes a newsignature() -> u64method for the model signature the scene was built for.MjvPerturb::start/move_andMjvCamera::move_now take&MjvScenewithout a type parameter.MjvPerturb::startandMjvPerturb::applyno longer take amodel: &MjModelparameter (the model is now obtained internally viadata.model()).vis_common::sync_geomsis now non-generic.MjvScene now derives
Send + Syncunconditionally.
MjRenderer is no longer generic
MjRenderer and MjRendererBuilder are no longer generic over
M. Remove the<M>type parameter from all usage sites.MjRenderer::sync_data and MjRenderer::new retain
<M: Deref<Target = MjModel>>as method-level generics; call sites are unchanged.MjRendererBuilder no longer requires
M: Clone; anyM: Deref<Target = MjModel>is accepted.syncis deprecated; usesync_data+renderinstead.
MjViewer, MjViewerBuilder, ViewerSharedState are no longer generic
MjViewer, MjViewerBuilder, and ViewerSharedState are no longer generic over
M. Remove the<M>type parameter from all usage sites.The viewer stores a passive
Arc<MjModel>internally (analogous to the existing passiveMjDatacopy).sync_data,sync_data_full, andbuild_passiveretain<M: Deref<Target = MjModel>>as method-level generics, so the call sites are unchanged.MjViewerBuilder::build_passivenow accepts anyM: Deref<Target = MjModel>(e.g.&MjModel,Arc<MjModel>,Rc<MjModel>).The closure passed to
MjViewer::add_ui_callbacknow receives&mut MjData<Arc<MjModel>>instead of&mut MjData<M>. Update callback signatures accordingly.
Viewer and renderer sync model automatically
MjViewer::sync_data / ViewerSharedState::sync_data and MjRenderer::sync_data now detect when
datawas created from a different model than the viewer/renderer was initialized with. Instead of panicking or returning an error, both automatically recreate the scene(s) for the new model and update their internal model reference.
Separate renderer sync and render
MjRenderer: new MjRenderer::sync_data method updates the scene without rendering. Call MjRenderer::render separately afterwards. This replaces the combined
syncmethod, which is now deprecated.
MuJoCo upgrade
Updated MuJoCo from 3.3.7 to 3.6.0. C FFI bindings and all generated wrappers have been regenerated. See Installation for the matching release.
Error handling: io::Error replaced with typed enums
All methods that previously returned io::Error or bare types now return typed
Result variants. Six new error enums have been added to the
error module (all #[non_exhaustive], re-exported from
the prelude): MjDataError, MjSceneError, MjEditError, MjModelError,
MjVfsError, GlInitError. Pre-existing RendererError and MjViewerError
gained new variants. See Error handling below for the full method list.
Type and signature changes
get_mujoco_version has been renamed to ~~mujoco_rs::mujoco_version. The old name is deprecated.
MjData::get_state has been renamed to MjData::state. The old name is deprecated.
MjvFigure::new has been renamed to MjvFigure::new_boxed. The old name is deprecated.
MjData::copy_to and MjData::copy_visual_to now accept a destination of a different model type:
destination: &mut MjData<N>whereN: Deref<Target = MjModel>. Previously the source and destination had to share the sameM.set_name now returns
Result<(), MjEditError>instead of(). Append?to call sites. with_name still returns&mut Selfbut now panics on duplicate names.SpecItem is now a sealed trait. External implementations are no longer permitted.
MjsOrientation::switch_quatno longer has a type parameter. Replaceswitch_quat::<[f64; 4]>()withswitch_quat().MjModel now implements the standard
Clonetrait. The oldclone()returningOption<MjModel>has been removed; usemodel.clone()(panics on failure) or the newtry_clone()for a fallible version.MjModel::save(filename, buffer)removed. Use the newsave_to_fileandsave_to_buffermethods.MjModel::size returns
usize(wasi32).MjModel::save_last_xml now accepts
AsRef<Path>(was&str) and returnsErr(MjModelError::InvalidUtf8Path)for non-UTF-8 paths (previously impossible to pass since&stris always UTF-8).MjViewerCpp<M>(cpp-viewerfeature) is no longer generic overM. Remove the type parameter from all usage sites. Thelaunch_passiveassociated function retains<M: Deref<Target = MjModel>>as a method-level generic.MjModel::state_size returns
usize(wasi32).MjModel::name_to_id returns
Option<usize>(wasi32;-1is nowNone).MjModel::totalmass renamed from
get_totalmass.MjrContext::set_buffer renamed from
mjr_set_buffer.-
MjData::reset_keyframe now takes
key: usize(wasi32) and returnsResult<(), MjDataError>. Out-of-range keys that previously silently fell back to a plain reset now return an error.MjData::runge_kutta now takes
n: u32(wasi32) and panics ifn < 1(previously passed negative or zero values silently to C).MjData::maxuse_threadstack returns
&[MjtSize; mjMAXTHREAD](was&[MjtSize]).MjData::jac, MjData::jac_body, MjData::jac_body_com, MjData::jac_subtree_com, MjData::jac_geom, MjData::jac_site, MjData::angmom_mat, MjData::object_velocity, MjData::object_acceleration, MjData::geom_distance, MjData::local_to_global: object-id / body-id / geom-id / site-id parameters now take
usize(wasi32). The>= 0guard is implicit in the type; passbody_id as usizeat call sites.MjData::ray, MjData::multi_ray:
bodyexcludechanged fromi32toOption<usize>. Replace-1withNoneandbody_idwithSome(body_id as usize).MjData::ray now returns
(Option<usize>, MjtNum)instead of(i32, MjtNum). The returned geom id isNonewhen the ray misses all geometry (previously-1).MjData::multi_ray now returns
(Vec<Option<usize>>, Vec<MjtNum>)instead of(Vec<i32>, Vec<MjtNum>)(usetry_multi_rayfor aResult-returning alternative). Each element of the geom-id vector isNonewhen the corresponding ray misses all geometry (previously-1).MjData::ray gained a new
normal_out: Option<&mut [MjtNum; 3]>parameter. PassNoneto preserve previous behaviour.MjData::multi_ray gained
normals_outand now panics on invalid input (usetry_multi_rayfor a fallible alternative). PassNonefor the new parameter.MjData::jac_subtree_com no longer accepts
jacp: bool(the Jacobian is always computed); now panics on invalid input (usetry_jac_subtree_comfor a fallible alternative).MjData::print and MjData::print_formatted now accept
AsRef<Path>and returnResult.
MjModel: MjModel::id_to_name:
idtakesusize(wasi32).mju_ray_geom gained
normal_out: Option<&mut [MjtNum; 3]>.MjvPerturb::update_local_pos takes
selection_xyzby&[MjtNum; 3](was by value).MjvPerturb::move_ no longer takes a separate
modelparameter;datachanged from&mut MjData<M>to&MjData<M>.MjvScene::find_selection returns SceneSelection (was a 5-tuple
(i32, i32, i32, i32, [MjtNum; 3])).SceneSelectionfields (body_id,geom_id,flex_id,skin_id) areOption<usize>(None= no selection). Useif let Some(id) = sel.body_idinstead ofif sel.body_id >= 0.MjvCamera:
new_fixed,new_tracking,track,fixnow takeusize(wasu32). Removeas u32casts at call sites.TryFrom<i32> for MjtCameranow usesMjSceneErroras its error type (was()). ReplaceErr(())matches withErr(MjSceneError::InvalidCameraType(_)).MjvScene::update: the
pertubparameter has been renamed toperturb(typo fix).MjvGeom::set_label now returns
Result<(), MjSceneError>.MjViewer::render now returns
Result<(), MjViewerError>.MjModel:
print/print_formattednow acceptAsRef<Path>and returnResult<(), MjModelError>.MjModel:
tuple_objtypeaccessor now returns&[MjtObj]instead of&[i32].MjCameraModelView/MjCameraModelViewMut: camera fieldprojection(typeMjtProjection) replaces the old booleanorthographicfield, matching MuJoCo’scam_projectionrename.MjsTendon:
limitedandactfrclimitedare nowMjtLimited(tri-state:FALSE/TRUE/AUTO) instead ofbool, matching the CmjtLimitedsemantics.MjsTexture::set_data now requires
T: bytemuck::NoUninit.
New unsafe requirements
MjrContext::new is now
unsafe fn. A valid OpenGL context must be current on the calling thread.MjData::set_state is now
unsafe fnand returnsResult<(), MjDataError>. WhenspecincludesmjSTATE_EQ_ACTIVE, MuJoCo writes rawf64bytes into theeq_activearray without booleanization; callingeq_active()afterwards is UB until the state is re-validated (e.g. viamj_forward/mj_step).MjViewerCpp::render is now
unsafe fn, must be called from the main thread, no longer acceptsupdate_timer, and returnsResult<(), &'static str>.MjViewerCpp::launch_passive is now
unsafe fn. Model and data must remain alive and at a stable address for the lifetime of the viewer.
Thread-safety bound tightening
MjData<M>:Send/Syncnow requireM: Send/M: Sync. Previously the bounds were unconditional, makingMjData<Rc<MjModel>>incorrectlySend + Sync. (MjvSceneis now non-generic and unconditionallySend + Sync.)MjViewerCpp::launch_passive now requires
M: Send + Sync(previously onlyDeref<Target = MjModel> + Clone).
Mutable accessor restrictions
*_mut() methods on MjModel, MjData, and MjvScene array fields are now
unsafe fn where unrestricted writes can corrupt MuJoCo’s internal state. Two
categories of fields are affected:
Structural invariants — topology, address, and engine-computed arrays that must not be changed at runtime: 199 fields on MjModel, 43 on MjData, 12 on MjvScene.
Companion-index fields — type/mode fields whose values control which array a companion index (
*id,*adr) indexes into; writing inconsistent values causes out-of-bounds access: 17 fields on MjModel (jnt_type,actuator_trntype,actuator_dyntype,eq_type,eq_objtype,wrap_type,wrap_prm,sensor_type,sensor_objtype,sensor_reftype,skin_matid,tendon_matid,tendon_treeid,body_plugin,actuator_plugin,geom_plugin,sensor_plugin), 4 on MjData (efc_type,iefc_type,tree_asleep,wrap_obj).Null-terminated string buffers — concatenated
c_chararrays where each entry is null-terminated; removing a'\\0'byte allows MuJoCo’s C string functions (andCStr::from_ptr) to read past the buffer boundary: 4 fields on MjModel (names,plugin_attr,text_data,paths).
info_with_view! generated ViewMut types expose the companion-index fields as
PointerViewUnsafeMut; mutation requires
as_mut_slice
inside an unsafe block. See migration for full field
lists and before/after examples.
Removed APIs
MjViewerCpp::__raw()removed (exposed internal C++ binding pointers).MjvFigure:
figurerenamed todraw.MjViewer::syncremoved (deprecated in 2.2.0; usesync_data+render).MjViewer::user_scn/user_scn_mutremoved (deprecated in 1.3.0).MjViewer::user_scene/user_scene_mutremoved (deprecated in 2.2.0; access viaViewerSharedState::user_scene/user_scene_mutthroughviewer.state()).Removed deprecated methods:
Type
Removed
Replacement
warning_statstimer_statsType aliases
MjJointInfo,MjJointView,MjJointViewMut,MjGeomInfo,MjGeomView,MjGeomViewMut,MjActuatorInfo,MjActuatorView,MjActuatorViewMutUse the current
MjJointData*,MjGeomData*,MjActuatorData*types.resetname2idnewnew_free,new_fixed,new_tracking, ornew_user
MjTendonDataInfo field removal
MjTendonDataInfono longer exposesJ_rownnz,J_rowadr, orJ_colind; these fields moved upstream tomjModelin MuJoCo 3.6.0 and are now accessible viaMjTendonModelInfo(i.e.model.tendon()).
Error handling
New error types in error
(all #[non_exhaustive], re-exported from the prelude):
Type |
Methods |
Error type |
|---|---|---|
|
||
|
||
|
||
|
||
MjvScene / MjvGeom / MjvFigure / MjrContext |
|
|
|
||
|
Methods marked new are new in 3.0.0; the rest existed in 2.x and previously
returned bare types or io::Error.
New error variants in pre-existing enums:
RendererError:
RgbDisabled,DepthDisabled,DimensionMismatch,ZeroDimension,IoError,SceneError,GlInitFailed.MjViewerError:
PainterInitError,GlInitFailed,SceneError.
The six new enums (all #[non_exhaustive]) have the following variants:
MjModelError:
InvalidUtf8Path,LoadFailed,SaveFailed,AllocationFailed,StateSliceLengthMismatch,SpecNotSubset,BufferTooSmall,SignatureMismatch,VfsError.MjDataError:
IndexOutOfBounds,UnsupportedObjectType,AllocationFailed,BufferTooSmall,LengthMismatch,SignatureMismatch,NoHistoryBuffer,ContactBufferFull,InvalidUtf8Path.MjVfsError:
AlreadyExists,LoadFailed,NotFound,InvalidUtf8Path,BufferTooLarge,Unknown.MjEditError:
AllocationFailed,InvalidUtf8Path,ParseFailed,CompileFailed,SaveFailed,NotFound,AlreadyExists,UnsupportedOperation,DeleteFailed,XmlBufferTooSmall— returned bysave_xml_stringwhen the supplied buffer is too small; therequired_sizefield carries thesnprintf-style byte count (excluding NUL), so retry withrequired_size + 1.MjSceneError:
SceneFull,LabelTooLong,InvalidAuxBufferIndex,InvalidViewport,BufferTooSmall,FigureBufferFull,FigureIndexOutOfBounds,InvalidPlotIndex,NonAsciiLabel,InvalidCameraType.GlInitError (requires
viewerorrenderer-winit-fallbackfeature):DisplayBuild,NoWindow,WindowHandle,ContextCreation,SurfaceAttributes,SurfaceCreation,MakeCurrent.New
try_methods paired with existing infallible counterparts (infallible variants now delegate totry_.``expect()``):MjData:
try_new,try_clone,try_read_state_into,try_swap_model,try_read_ctrl,try_read_sensor_fixed,try_read_sensor,try_jac,try_jac_body,try_jac_body_com,try_jac_subtree_com,try_jac_geom,try_jac_site,try_angmom_mat,try_object_velocity,try_object_acceleration,try_geom_distance,try_local_to_global,try_multi_rayMjModel:
try_clone,try_make_data,try_extract_state,try_extract_state_intoMjSpec / MjsTendon /
MjsBody:try_new,try_clone,try_add_frame,try_wrap_site,try_wrap_geom,try_wrap_joint,try_wrap_pulley,try_add_default, macro-generatedtry_add_*MjRenderer:
try_rgb,try_depthMjvScene:
try_create_geomMjData:
try_ray_flexnew,try_ray_hfieldnew,try_ray_meshnewMjvFigure:
try_fullnew,try_emptynew,try_pop_frontnew,try_pop_backnew,cut_frontnew,cut_endnew
New MjData methods that return
Resultdirectly (no separatetry_variant):copy_state_from_data,apply_ft.
New features and improvements
MjRenderer: PNG compression is now configurable via MjRendererBuilder::png_compression (builder) and MjRenderer::set_png_compression (runtime setter). Defaults to
png::Compression::NoCompression. Affects MjRenderer::save_rgb and MjRenderer::save_depth. Thepngcrate is re-exported asmujoco_rs::renderer::pngfor namingpng::Compression.MjModel:
extract_state/extract_state_into,try_make_data.MjData:
swap_modelnew (validates model signature),model_mutnew (-> &mut MjModel, available whenM: DerefMut),forward_kinematics,apply_ft,copy_state_from_data,ray_flex/ray_mesh/ray_hfield,init_ctrl_history/init_sensor_history,read_ctrl/read_sensor/read_sensor_into/read_sensor_fixed,model_clonenew (-> M, available whenM: Clone).MjSpec:
from_parse/from_parse_vfs.from_parse,from_parse_vfs, andsave_xmlnow acceptAsRef<Path>(was&str); returnsErr(MjEditError::InvalidUtf8Path)for non-UTF-8 paths.MjSpecandSpecItemare also re-exported from mujoco_rs::wrappers.MjsTendon:
wrap/wrap_mut/wrap_num.MjsWrap:
coef,divisor,side_site,side_site_mut.MjVfs:
add_file/add_file_fromreplaceadd_from_file(which is now deprecated).add_from_bufferanddelete_filenow acceptAsRef<Path>; returnsErr(MjVfsError::InvalidUtf8Path)for non-UTF-8 paths.MjvScene:
update_with_catmask(exposescatmaskfilter parameter).MjvCamera:
frame,frustum.New SceneSelection struct (returned by
find_selection); implementsDefault.The vis_common module is now public (requires
viewerorrendererfeature), exposingsync_geoms,write_png,flip_image_vertically.MjModel and MjData views expose additional fields from MuJoCo 3.6.0. New MjModel view types added for
exclude,mesh, andskin.dof_bodyidanddof_treeidare now exposed in per-dof joint model view types (the fields existed in MuJoCo 3.3.7 but were not previously accessible via per-object view types).MjsMaterial: MjsMaterial::set_texture / MjsMaterial::with_texture set a texture name by MjtTextureRole, correctly targeting the pre-sized slot the MuJoCo renderer reads (e.g.mjTEXROLE_RGB). The existingset_textures/append_texturesmethods are retained but should generally be avoided for role-indexed vectors.MjsTexture: MjsTexture::set_cubefile / MjsTexture::with_cubefile set a cube-map face file by MjtCubeFace. The existingset_cubefiles/append_cubefilesmethods are retained.info_with_view!structs now havetry_view/try_view_mutmethods.Trait additions:
Clonefor MjSpec;Defaultfor MjVfs, MjSpec,MjOption,MjRendererBuilder,MjViewerBuilder;Send+Syncfor MjVfs;FusedIteratorfor all model-editing iterators;EqforPointerView/PointerViewMut;DropforMjRenderer.PointerView::new,PointerViewMut::new,MjrRectangle::neware nowconst fn.MjModel and MjData now use
NonNull<mjModel>/NonNull<mjData>internally, encoding the non-null invariant at the type level and enabling niche optimisation forOption<MjModel>/Option<MjData>.MjData:
contacts()is deprecated; usecontact()instead.
MjViewer
Added support for the
Depthrendering flag (mjRND_DEPTH).Added a “Print camera” button that prints the camera as an MJCF element.
Added a “Screenshot” panel with: a Screenshot button (timestamped PNG), a Viewport only checkbox (captures before UI is drawn), and a Depth checkbox (16-bit grayscale depth PNG).
Bug fixes
MjvCamera
new_fixed/new_trackingand MjvScenenew:debug_assert!guards on user-suppliedcamera_id,tracking_id, andmax_geom(checking they fit ini32) were silently skipped in release builds. Changed toassert!so the precondition is always enforced. The# Panicsdocumentation now correctly states panics occur in all builds, not only debug builds.MjModel: MjModel::save_last_xml: a
_ => unreachable!()arm would panic if MuJoCo ever returned a value other than0or1; changed to_ => Err(MjModelError::SaveFailed(...))so any unexpected return code is surfaced as an error instead of aborting the process.mju_is_bad: now tests
!= 0instead of== 1.-
save_depth: guards against division by zero when the depth range is zero.rgb,rgb_flat,save_rgb,save_depth,save_depth_raw: images were output vertically flipped (OpenGL reads bottom-up); now corrected.MjRendererBuilder:font_scalesetting was silently ignored duringbuild(); now applied.
PointerView and PointerViewMut
PartialEqnow compares both pointer and length (previously pointer only).MjModel:
key_mposandkey_mquatarray accessors were missing; added.MjViewer: mouse normalization now uses
inner_size()instead ofouter_size(), fixing cursor mapping with window decorations.MjViewer now implements
Dropto make the GL context current before cleanup (prevents resource leaks on some platforms).-
FFI declaration used
boolforstate_only(should bec_int); fixed.Could be called after the viewer window was closed, causing UB; now returns early if not running.
MjViewerCpp::launch_passive: asserts the C++ simulate handle is non-null after allocation.
MjvPerturb::update_local_pos: now uses bounds-checked slice indexing instead of raw pointer arithmetic.
MjrContext:
set_auxnow has amjNAUX-based index bounds check.Fixed potential UB when parsing null string pointers from MuJoCo C++ wrappers.
Added strict runtime signature check to view creation (panics with
model signature mismatchon mismatch).ViewerSharedState: on model change, ViewerSharedState::sync_data / ViewerSharedState::sync_data_full no longer spuriously write back the new model’s default pose (
qpos0) to the incomingdata. Previously, models with free joints, ball joints, or joints with a non-zerorefattribute would have their simulation state silently reset to the default pose on the first sync after a model switch. Active perturbations are also cleared on model change to prevent stale body-index references from the previous model being applied.
Other changes
Fixed security issue:
model_signaturefield on all*Infostructs (e.g.MjJointDataInfo) was public, allowing the signature to be overwritten to bypass the bounds guard intry_view/try_view_mut, which could cause out-of-bounds raw-pointer arithmetic (UB). The field is now private; use themodel_signature()getter instead.Fixed RendererError
Displayimpl: the four wrapper variants (GlutinError,GlInitFailed,IoError,SceneError) were discarding the inner error message, making error output non-actionable (e.g."scene error"instead of the actual cause). They now include the inner error: e.g."scene error: …".EventLoopErrorin bothRendererErrorandMjViewerErrorhad the same issue and was also fixed.Updated enum type aliases to match MuJoCo 3.6.0 definitions.
Added examples: simulation/tippe_top.rs, simulation/chaotic_pendulum.rs, visualization/renderer/contact_forces.rs, model_editing/multi_legged_creatures.rs, model_editing/procedural_tree.rs, testing/miri_test.rs, visualization/viewer/model_switch.rs, simulation/model_parameters.rs.
2.3.5 (MuJoCo 3.3.7)¶
Fixed #161: actuator views could crash when a non-muscle actuator followed a muscle actuator.
Internal: minor performance improvement in
sync_geoms(early exit when no geoms are added).
2.3.4 (MuJoCo 3.3.7)¶
3D viewer bug fixes and usability improvements:
Keyboard events are now ignored whenever an egui input widget has focus.
Fixed a logic error where pressing an unhandled mouse button would drop subsequent events.
Ctrl+C no longer toggles camera visualization (reserved for copy).
2.3.3 (MuJoCo 3.3.7)¶
Fixed #144: the viewer caused high stack usage, potentially problematic on Windows (1M stack limit).
2.3.2 (MuJoCo 3.3.7)¶
Small performance improvement by removing mutex contention during scene render.
2.3.1 (MuJoCo 3.3.7)¶
2.3.0 (MuJoCo 3.3.7)¶
-
Added
add_ui_callback_detachedfor passive UI widgets.Added
with_ui_egui_ctxfor scoped egui context access.Replaced panicking mutex handling with automatic unpoison logic.
Performance optimizations.
MjModel and MjSpec: version check against the MuJoCo shared library on instantiation; panics on mismatch.
2.2.2 (MuJoCo 3.3.7)¶
2.2.1 (MuJoCo 3.3.7)¶
Fixed #119: borrow tracker tracked the wrong lifetime.
Reset more OpenGL state after egui draw (figures now render correctly).
2.2.0 (MuJoCo 3.3.7)¶
3D renderer now uses EGL on Linux by default (true offscreen rendering). New feature flag
renderer-winit-fallbackfor compatibility (enabled by default).-
add_ui_callbackfor custom egui UI widgets.Info menu (F2): smoothed FPS, simulation time, used memory.
Realtime warning (F4): shows realtime factor when sync time deviates ≥ 2%.
Separate sync and render:
sync_data(deprecatessync) +render.Added ViewerSharedState for multi-threaded viewer/simulation sync.
New MjData methods:
copy_visual_to,copy_to,set_state,get_state,read_state_into.New example:
rust_viewer_threaded.Deprecated:
user_scene()/user_scene_mut()(replaced byViewerSharedState::user_scene/user_scene_mut).
2.1.0 / 2.1.1 (MuJoCo 3.3.7)¶
Option to automatically download MuJoCo (
auto-download-mujocofeature).pkg-config support for Linux and macOS.
Optional egui UI for MjViewer (enabled by default).
2.0.1 (MuJoCo 3.3.7)¶
Fixed the
rendererfeature not enabling all needed crates.
2.0.0 (MuJoCo 3.3.7)¶
Breaking changes:
Updated MuJoCo to 3.3.7.
Model editing: items no longer wrapped (just aliased types); attributes made private; immutable iterators added;
_mut()methods added.Viewer / renderer: switched from GLFW to Winit + Glutin.
Wrapper of MuJoCo’s C++ 3D viewer: moved to
mujoco_rs::cpp_viewer; build target changed toglfw libmujoco_simulate.MjData and related types now generic over model handle (
Deref<Target = MjModel>).Various
c_int→i32/booltype replacements.Removed
mujoco_rs::wrappers::mj_interface.
Other: additional getters / setters / array slice methods for MjData, MjModel, MjvScene.
1.5.0 (MuJoCo 3.3.5)¶
MjvScene:
pop_geommethod added.Model editing: iterators added to MjSpec and
MjsBody.
1.4.2 (MuJoCo 3.3.5)¶
Fixed segfault when model specification is invalid (#65).
1.4.1 (MuJoCo 3.3.5)¶
Added missing MjSpec named accessors:
geom,site,camera,light.
1.4.0 (MuJoCo 3.3.5)¶
MjModel: added views for
key,tuple,texture,site,pair,numeric,material,light,hfield,equality.Model editing support added (
mujoco_rs::wrappers::mj_editingmodule).MjRenderer /
MjRendererBuilderimprovements.MjViewer: new key bindings and visualization toggles; visual-geom headroom increased from 100 to 2000.
fix added.
1.3.0 (MuJoCo 3.3.5)¶
Added mujoco_rs::renderer module with
MjRenderer.Deprecated
MjvCamera::new(); replaced bynew_free,new_fixed,new_tracking,new_user.Added
MjData::maxuse_stack,maxuse_threadstack,warning_stats,timer_stats,time,energy.Added
MjModel::signature,opt/opt_mut,vis/vis_mut,stat/stat_mut.Added joint view attributes:
qfrc_spring,qfrc_damper,qfrc_gravcomp,qfrc_fluid.
1.2.0 (MuJoCo 3.3.5)¶
Function wrappers for utility and derivative functions (mujoco_rs::wrappers::fun).
Completed virtual file system wrapper:
add_from_file,delete_file,from_xml_vfs.
1.1.0 (MuJoCo 3.3.5)¶
Fixed data-race bug #18.
Fixed MjGeomDataView / MjGeomDataViewMut pointing to wrong address (#17).
Fixed spurious scene-buffer warning on some models (#19).
Added mujoco_rs::wrappers::mj_primitive module.
More MjData views: actuator, body, camera, geom, joint, light, sensor, site, tendon.
More MjModel views: actuator, body, camera, geom, joint, sensor, tendon.
1.0.1 (MuJoCo 3.3.5)¶
Bug fixes in
Dropimplementations.
1.0.0 (MuJoCo 3.3.5)¶
Breaking: all
ffi_mut()methods now requireunsafe.Viewer: help overlay (F1), user scene, mouse perturbation.
0.4.3 (MuJoCo 3.3.5)¶
Removed unnecessary header files (smaller crate size).
0.4.2 (MuJoCo 3.3.5)¶
Renamed env vars:
MUJOCO_DYNAMIC_LINK_LIB→MUJOCO_DYNAMIC_LINK_DIR,MUJOCO_STATIC_LINK_LIB→MUJOCO_STATIC_LINK_DIR.
0.4.1 (MuJoCo 3.3.5)¶
Fixed event handling.
0.4.0 (MuJoCo 3.3.5)¶
Renamed package to
mujoco-rs.
0.3.0 (MuJoCo 3.3.5)¶
Initial public release.