@@ -264,7 +264,8 @@ impl MjcfRobotHandles<Option<MultibodyJointHandle>> {
264264 rb. set_position ( free_pose ( qp, dof. scale , robot. base_shift ) , true ) ;
265265 }
266266 if let Some ( qv) = qvel {
267- let lin = Vector :: new ( qv[ 0 ] as Real , qv[ 1 ] as Real , qv[ 2 ] as Real ) * dof. scale ;
267+ let lin =
268+ Vector :: new ( qv[ 0 ] as Real , qv[ 1 ] as Real , qv[ 2 ] as Real ) * dof. scale ;
268269 let ang = Vector :: new ( qv[ 3 ] as Real , qv[ 4 ] as Real , qv[ 5 ] as Real ) ;
269270 rb. set_linvel ( lin, true ) ;
270271 rb. set_angvel ( ang, true ) ;
@@ -279,7 +280,9 @@ impl MjcfRobotHandles<Option<MultibodyJointHandle>> {
279280 // Articulated DoF (hinge / slide / ball): write to the multibody's
280281 // generalized coordinates.
281282 let Some ( jidx) = dof. joint else { continue } ;
282- let Some ( jh) = self . joints . get ( jidx) else { continue } ;
283+ let Some ( jh) = self . joints . get ( jidx) else {
284+ continue ;
285+ } ;
283286 // `joint` is `None` for a joint that was dropped as a loop closure.
284287 let Some ( handle) = jh. joint else { continue } ;
285288 if let Some ( link) = multibody_joints. rigid_body_link ( jh. link2 ) {
@@ -292,7 +295,9 @@ impl MjcfRobotHandles<Option<MultibodyJointHandle>> {
292295 // Compute the displacement (target − current) under an immutable
293296 // borrow, then apply it under a mutable one.
294297 let ( assembly_id, ndofs, disp) = {
295- let Some ( link) = mb. link ( link_id) else { continue } ;
298+ let Some ( link) = mb. link ( link_id) else {
299+ continue ;
300+ } ;
296301 let joint = link. joint ( ) ;
297302 let coords = joint. coords ( ) ;
298303 let disp = qpos. map ( |qp| match dof. kind {
@@ -375,7 +380,8 @@ impl MjcfRobotHandles<ImpulseJointHandle> {
375380 world[ dof. body ] = free_pose ( qp, dof. scale , robot. base_shift ) ;
376381 }
377382 if let Some ( qv) = qvel {
378- let lin = Vector :: new ( qv[ 0 ] as Real , qv[ 1 ] as Real , qv[ 2 ] as Real ) * dof. scale ;
383+ let lin =
384+ Vector :: new ( qv[ 0 ] as Real , qv[ 1 ] as Real , qv[ 2 ] as Real ) * dof. scale ;
379385 let ang = Vector :: new ( qv[ 3 ] as Real , qv[ 4 ] as Real , qv[ 5 ] as Real ) ;
380386 free_vels. push ( ( dof. body , lin, ang) ) ;
381387 }
@@ -402,8 +408,10 @@ impl MjcfRobotHandles<ImpulseJointHandle> {
402408 // joint's parent body is already positioned. This mirrors rapier's
403409 // multibody `body_to_parent`: world₂ = world₁ · frame1 · q · frame2⁻¹.
404410 for ( jidx, j) in robot. joints . iter ( ) . enumerate ( ) {
405- world[ j. link2 ] =
406- world[ j. link1 ] * j. joint . local_frame1 * joint_tf[ jidx] * j. joint . local_frame2 . inverse ( ) ;
411+ world[ j. link2 ] = world[ j. link1 ]
412+ * j. joint . local_frame1
413+ * joint_tf[ jidx]
414+ * j. joint . local_frame2 . inverse ( ) ;
407415 }
408416
409417 for ( i, handle) in self . bodies . iter ( ) . enumerate ( ) {
@@ -445,7 +453,7 @@ impl MjcfRobotHandles<ImpulseJointHandle> {
445453
446454 /// Like [`apply_controls`](Self::apply_controls) but uniformly scales every
447455 /// actuator's strength by `gain_scale` (gains and force limits; see
448- /// [ `configure_actuator_motor`] ). `gain_scale < 1` softens the actuation —
456+ /// `configure_actuator_motor`). `gain_scale < 1` softens the actuation —
449457 /// e.g. to ease servo-driven moves that would otherwise saturate and snap.
450458 pub fn apply_controls_scaled (
451459 & self ,
@@ -471,7 +479,7 @@ impl MjcfRobotHandles<Option<MultibodyJointHandle>> {
471479 /// [`apply_controls`](MjcfRobotHandles::<ImpulseJointHandle>::apply_controls):
472480 /// it reproduces MuJoCo's "actuation" by writing each actuator's motor
473481 /// onto the multibody link it drives. The per-actuator interpretation is
474- /// identical (see [ `configure_actuator_motor`] ); call it once per frame
482+ /// identical (see `configure_actuator_motor`); call it once per frame
475483 /// before `pipeline.step`.
476484 ///
477485 /// `ctrl` is a flat array of one scalar per actuator, in the order of
@@ -493,7 +501,7 @@ impl MjcfRobotHandles<Option<MultibodyJointHandle>> {
493501
494502 /// Like [`apply_controls_multibody`](Self::apply_controls_multibody) but
495503 /// uniformly scales every actuator's strength by `gain_scale` (gains and
496- /// force limits; see [ `configure_actuator_motor`] ). `gain_scale < 1` softens
504+ /// force limits; see `configure_actuator_motor`). `gain_scale < 1` softens
497505 /// the actuation, so a servo-driven move (e.g. easing between keyframes)
498506 /// ramps in instead of saturating to its force limit and arriving instantly.
499507 pub fn apply_controls_multibody_scaled (
@@ -507,7 +515,9 @@ impl MjcfRobotHandles<Option<MultibodyJointHandle>> {
507515 // `H` is `Option<MultibodyJointHandle>` here, so `ah.joint` is
508516 // `Option<Option<_>>`: the outer `None` means "no actuator joint",
509517 // the inner `None` means "joint dropped as a loop closure".
510- let Some ( Some ( handle) ) = ah. joint else { continue } ;
518+ let Some ( Some ( handle) ) = ah. joint else {
519+ continue ;
520+ } ;
511521 let Some ( ( mb, link_id) ) = multibody_joints. get_mut ( handle) else {
512522 continue ;
513523 } ;
0 commit comments