Conversation
…trol - Swap car body XY dims so car faces +X (longer) instead of +Y (wider) - Lower car body (z=0.22) and wheels (rel z=-0.1) so wheels touch ground - Replace axisangle body rotation with fromto on cylinder geoms for correct wheel orientation - Change actuator_force to ctrl so motor control signals aren't overwritten by mj_step - Add camera marker spheres (topdown red, firstperson green) - Adjust firstperson camera pos/fovy for forward-facing view
…ree.js Replace backend MuJoCo (Python + JPEG streaming) with browser-native simulation using @mujoco/mujoco WASM bindings and Three.js rendering, enabling multi-user independent training. Fix React StrictMode duplicate canvas rendering issue.
…rientation axes gizmo - Add WASD/Arrow keyboard controls for driving the car - Add first-person camera overlay in bottom-right corner - Add orientation axes gizmo in bottom-left corner - Simplify car model to wheels + chassis, remove robotic arm - Add wheel spoke geometry for visible rotation - Fix setControl to use manual actuator name resolution - Add multi-substep physics (16 substeps per frame) - Clean up debug logging
…es gizmo The mjToThree quaternion maps MuJoCo body orientation correctly for geoms but not for cameras — it mapped the camera's look direction to the wrong axis. Compute look/up vectors explicitly and use camera.lookAt() instead. Also add X/Y/Z text sprites at the tips of the orientation axes gizmo.
…ntation - Reduce SUBSTEPS from 16 to 5 for slower, more stable physics - Fix axes gizmo labels: Z (blue) on vertical, Y (green) on horizontal to match MuJoCo coordinate system (X=forward, Y=left, Z=up) - Correct first-person camera euler to "90 -90 0" so it looks forward (+X) instead of toward ceiling - Add debug logging for car ctrl, wheel velocities, yaw, and quaternion - Adjust camera visual indicator geom direction
…non-wheel cylinders - Wrap camera, box, and cylinder in camera_body so they move as one unit - Only add cross-spokes to wheel-like cylinders (radius >= halfHeight) to avoid artifacts on thin indicator cylinders
- Render hinge joint axes as red cylinders in 3D scene using d.jnt() accessor - Add "Show Joints" checkbox in ControlPanel to toggle overlay visibility - Fix wheel hinge axis to Y (0 1 0) for correct forward motion - Clean up legacy debug logging from animation loop
… axis with MuJoCo Z axis Three.js CylinderGeometry extends along Y by default, but MuJoCo cylinder geom local Z is the axis direction. Compose a +90° X-axis pre-rotation quaternion in the animation loop for all cylinder-type geoms so their visual axis matches the physics orientation.
T * R * Tinv mapped MuJoCo Rz(+θ) (left turn) to Three.js Ry(+θ) (right turn), causing car body and wheels to rotate in opposite directions. Fix to Tinv * R * T, which correctly maps to Ry(-θ) (left turn). Removes all cylinder-specific quaternion adjustments and geomTypesRef as they are no longer needed.
- Replace mjToThree formula with direct axis extraction from geom_xmat and makeBasis(gx, -gz, gy) for proper rotation (det=+1) - Fix cam_xmat column indexing: look direction = column 2 (Z axis), up vector = column 1 (Y axis), not row-major indices - Detect fromto cylinders by comparing position with same-body geoms, compute correct cylinder axis direction from midpoint offset - Track geom types via geomTypesRef for cylinder-specific handling
Replace flat geom-xpos/xmat placement with standard body hierarchy: - Each MuJoCo body -> THREE.Group, parented by m.body_parentid - Geom meshes as children of body groups with LOCAL pos/quat from m.geom_pos / m.geom_quat (includes fromto and euler) - Body world transforms updated from d.xpos / d.xquat each frame - Add mjPosToThree / mjQuatToThree coordinate conversion helpers - Remove obsolete mjToThree, makeBasis, fromto detection, geomTypesRef Net: -92/+46 lines, no special-case geom orientation code needed
d.xpos is world position, so all body groups must be direct children of world (body 0) to avoid double-applying parent transforms. Matches muwanx approach: bodyGroups[b].add(mesh) for geoms, but all body groups added to world group.
- Ground + wheel friction: 1.5/0.005/0.0001 (more grip, less roll) - Freejoint damping: 0.5 (prevent oscillation) - Motor gear: 5→3, ctrlrange: ±10→±5 (reduce torque, prevent wheelies)
- Ground friction: 1.5/0.005/0.0001 - Wheel friction: 1.5/0.005/0.0001 - Freejoint damping: 0.5
freejoint does not support damping in MuJoCo. Only friction changes remain.
- 8x8 maze with 2m corridors, box geom walls - Car starts at safe position (3, -3) - Removed contype/conaffinity=0 from car body for collision - Ground plane expanded to 100x100
- mazeXml.ts: ground plane + maze walls (independently editable)
- carArmXml.ts: imports MAZE_XML and composes car + camera + actuators
- Combined at runtime via template literal ${MAZE_XML}
- Remove non-existent motor_yaw/pitch/roll sliders - Remove redundant wheel sliders (WASD handles driving) - Add Drive Speed and Turn Speed sliders with real-time effect - Keep Reset and Show Joints toggle
- Replace fake '60' FPS with real requestAnimationFrame counter - Use capture:true on keydown to intercept before browser scrolls - Add Space to blocked keys list + brake functionality - Add stopPropagation for reliable event capture
- Wheel hinge joints: damping=1.5 (natural slowdown when releasing throttle) - Ground plane friction: 1.5→2.5 (less sliding in turns)
…tter driving feel
…kthrough - Add docs/src/MuJoCo/No_5.md covering FSM controller, cubic polynomial trajectory, PD tracking, and ctrl channel mapping - Update SUMMARY.md to include No.5 entry - Fix no_5.py: load doublependulum_fsm.xml (not .py) and add 1ms frame pacing - Fix doublependulum_fsm.xml: remove deprecated sensornoise flag attribute
…ough - Add docs/src/MuJoCo/No_7.md covering state-space formulation, numerical linearization, LQR design (CARE solver), and noise-injection robustness test - Update SUMMARY.md to include No.6 and No.7 entries (No.6 was missing) - Fix doublependulum.xml: remove deprecated sensornoise flag attribute
…an walkthrough - Add docs/src/MuJoCo/No_6.md covering IK control, Jacobian inverse, site/framepos sensor, and position servo - Track previously untracked No.6 source files (XML + Python)
…h FSM walkthrough - Add docs/src/MuJoCo/No_8.md covering connect equality, efc_J/efc_force, force-handoff trick, and FSM release - Update SUMMARY.md to include No.8 entry - Fix hybrid_pendulum.py: reshape efc_J from 1D to 2D (MuJoCo 3.x API change) - Track No.8 source files (XML + minimal no_8.py + full hybrid_pendulum.py)
…with full walkthrough - Add docs/src/MuJoCo/No_9.md covering Raibert hopper 4-state FSM, runtime actuator_gainprm modification, foot/torso state detection, and elastic energy storage/release pattern - Update SUMMARY.md to include No.9 entry - Track No.9 source files (hopper.py + hopper.xml)
…) example - Add docs/src/MuJoCo/No_11.md covering offline trajectory optimization, COBYLA solver, simulator-as-constraint-evaluator pattern, and open-loop playback - Update SUMMARY.md to include No.11 entry - Track No.11 source files (ball.xml + projectile_opt.py)
- Add docs/src/MuJoCo/No_12.md covering NLopt-based numerical IK, Lemniscate of Bernoulli trajectory, separate data_sim for FK, and matplotlib trajectory comparison - Update SUMMARY.md to include No.12 entry - Track No.12 source files (manipulator.xml + manipulator_ik.py) - Document 3 bugs in original code: duplicate forward_kinematics function, dead ctrl setting, commented-out set_mjcb_control
…+ ramp gravity) example - Add docs/src/MuJoCo/No_13.md covering parallel FSM coordination (hip + knee1 + knee2), quat2euler state estimation, tilted gravity for ramp walking, and joint frame visualization - Update SUMMARY.md to include No.13 entry - Track No.13 source files (biped.py + biped.xml) - Document 3 bugs: unused 'pin' joint, suspicious init_controller assignment, hardcoded body indices
- Add 4-DOF arm to car.xml: shoulder_pan, shoulder_lift, elbow, wrist_pitch + gripper (slide) - Add 5 position servos for arm (kp=30-100, kv=3-10) - Add armature=0.05 + damping=0.5 to arm joints for numerical stability - Create walker.py with GLFW keyboard control: - WASD: differential drive (left/right wheels) - Space: brake - 1-5: select arm joint, Up/Down: adjust - G: toggle gripper, 0: home pose - Backspace: reset simulation - Camera follows car position - Verify: arm reaches stable home pose (no NaN, qvel → 0 within 2s)
…lation - car.xml: bump gravity to -15, add 3-point studio lighting, and add a fixed pedestal + free-jointed target_box at world (1.5, 0, 0.45) for the M2 mobile-manipulation task. - auto_sim.py: keyboard-less 9-state FSM runner (DRIVE_TO_TARGET → REACH → LOWER → GRASP → LIFT → DRIVE_BACK → PLACE → RELEASE → DONE) using 2-link IK, position servos, and data.xpos for arm_base/target state estimation. Run with: mjpython auto_sim.py.
…ata logging, and fix joint range/lit - Add auto_sim_v2.py with numerical Jacobian 3D IK, P-controlled driving, active braking, mouse camera callbacks, FSM safety timeouts, weld grasp, and matplotlib data logging - Fix car.xml arm joint ranges from degrees to proper radian-equivalent degrees (1.57 -> 90, 2.0 -> 115) — arm was locked at ~1.6 range - Increase position servo kp/kv (50/5 -> 200/10) for faster arm response - Replace asymmetric 3-point shadowed lighting with balanced 5-point shadow-free lighting; add headlight diffuse/specular
…and-place + data collection - Add demo_collect.py: single-file MuJoCo demo exercising all 12 course concepts (model loading, GLFW pipeline, position servos, dynamics extraction, FSM, cubic trajectories, Jacobian IK, state-feedback, constraint management, contact triggers, numerical IK, separate FK, quaternion estimation) - Auto pick-and-place FSM (9 states) with multi-episode data collection to .npz - Scale arm 2x (1.06m reach), widen all joint ranges to ±150°/±180° - Remove pedestal — box now on ground for easier reaching - Remove first-person camera body from model - Delete redundant files (auto_sim.py, auto_sim_v2.py, walker.py, test.py) - Add episodes/.gitignore for collected data, fix root .gitignore
…uning - Replace single-box gripper with parallel two-finger gripper (palm + 2 sliding fingers) - Add 28-channel sensor suite: joint pos/vel ×10, EE pos/vel, finger touch - Expand arm joint ranges to ±360° for full rotation - Sync Q_MIN/Q_MAX in demo_collect.py to match - Fix ground friction (2.5/1.0/0.001) and wheel damping (0.5) - Add site + sensor demo (pendulum) in mujoco/demo/ - Fix demo pendulum: joint name for jointvel sensor, initial push, correct euler - Log sensordata in collected .npz files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.