|
Mujoco KDL Wrapper
0.1.0
MuJoCo + KDL bridge for robot kinematics and dynamics
|
Tests use GoogleTest and are registered with CTest. Build and run:
All tests self-skip if third_party/menagerie/ is absent. Fetch it with:
| Test | What it covers |
|---|---|
test_init | build_scene, init_robot_from_mjcf, cleanup |
test_dual_arm | multi-robot scene, independent KDL chains |
test_table_scene | MJCF table asset, SceneObject, runtime add/remove |
test_mjcf_load | arm-only model (nv=7) + arm+gripper model (nq>=13) |
test_mjcf_pos_ctrl | position trajectory tracking |
test_mjcf_vel_ctrl | velocity-style convergence control |
test_mjcf_trq_ctrl | gravity accuracy with gripper mass, impedance drift |
test_mjcf_pick | full pick-and-place with gripper: cube lifted > 0.20 m |
urdf_solver_probe | standalone Kinova URDF ACHD probe plus URDF-vs-MuJoCo RNEA torque comparison |
Scene: single Kinova GEN3 arm from Menagerie MJCF.
set_joint_pos() and mj_forward() complete without error.reset() returns joints to the model's default keyframe pose.reset() re-seeds jnt_pos_cmd / jnt_trq_cmd from measured state.Env::on_reset is called exactly once per reset(Env*) invocation.reset(Env*) with no hook set does not crash.reset(Env*) invokes the environment hook and syncs registered robot ports/forces.Scene: two Kinova GEN3 arms in a shared SceneSpec.
Robot handles and KDL chains.Scene: Kinova GEN3 arm on a table with box and sphere objects.
scene_add_object / scene_remove_object: model rebuilds cleanly.Two fixtures:
scene.xml): nv==7, nbody>=9, KDL chain has 7 joints, EE within workspace at home.nq>=13, nu>=8, KDL chain 7 joints, EE workspace, gripper driver range [~0, ~0.8] rad.CtrlMode::POSITION. Linearly interpolates from home to a target pose over 5 s, settles 1 s. Max joint error < 0.05 rad.
ctrlrange; out-of-range setpoints are rejected.qfrc_applied is never written in POSITION mode; torque commands from a prior TORQUE phase are not silently zeroed.Velocity-style control implemented by integrating a proportional velocity command into the position command accepted by the Menagerie actuator model. The arm converges from home to the target pose within the configured joint tolerance.
CtrlMode::TORQUE, arm + 2F-85 gripper attached.
qfrc_bias at q=0: max error < 5e-2 Nm.jnt_trq_msr reflects qfrc_actuator (not qfrc_bias) after update().Scene: GEN3 (MJCF) + Robotiq 2F-85 + 4 cm cube.
Standalone diagnostic binary, built when kdl_parser is available. It uses the repo-local Kinova URDF at third_party/kinova/GEN3_URDF_V12.urdf by default.
base_link -> EndEffector_Link and runs ChainHdSolver_Vereshchagin_Fixed_Joint with 6 Cartesian constraints at the home pose.base_link -> Bracelet_Link, builds the equivalent MuJoCo-derived KDL chain, and prints side-by-side RNEA gravity torques.Run directly: