Upload third-party source (skip LFS pointer assets) (part 5)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_23dof.xmlAdded+477
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_29dof.xmlAdded+296
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_29dof_old.xmlAdded+521
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_29dof_with_hand.xmlAdded+743
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_23dof.xmlAdded+23
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_29dof.xmlAdded+29
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_29dof_with_hand.xmlAdded+23
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_empty.xmlAdded+28
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/observation_config_example.yamlAdded+150
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config.yamlAdded+80
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config_low_latency.yamlAdded+92
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config_sonic_release.yamlAdded+79
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config_sonic_v1_1.yamlAdded+74
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/sonic_v1_1/observation_config.yamlAdded+74
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/convert_motions.pyAdded+274
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464/info.txtAdded+52
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464/metadata.txtAdded+17
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464_M/info.txtAdded+52
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464_M/metadata.txtAdded+17
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/forward_lunge_R_001__A359_M/info.txtAdded+51
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/forward_lunge_R_001__A359_M/metadata.txtAdded+17
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545/info.txtAdded+54
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545/metadata.txtAdded+17
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545_M/info.txtAdded+52
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545_M/metadata.txtAdded+17
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543/info.txtAdded+52
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543/metadata.txtAdded+17
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543_M/info.txtAdded+52
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543_M/metadata.txtAdded+17
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/squat_001__A359/info.txtAdded+51
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/squat_001__A359/metadata.txtAdded+17
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_forward_lunge_R_001__A359_M/info.txtAdded+51
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_forward_lunge_R_001__A359_M/metadata.txtAdded+17
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359/info.txtAdded+53
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359/metadata.txtAdded+17
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359_M/info.txtAdded+51
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359_M/metadata.txtAdded+17
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428/info.txtAdded+51
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428/metadata.txtAdded+17
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428_M/info.txtAdded+51
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428_M/metadata.txtAdded+17
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/install_deps.shAdded+926
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/install_ros2_humble.shAdded+163
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/restore_ubuntu_sources.shAdded+43
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/setup_env.shAdded+351
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/setup_wifi.shAdded+265
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/CMakeLists.txtAdded+3
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/TRTInference/CMakeLists.txtAdded+38
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/TRTInference/InferenceEngine.cppAdded+794
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/TRTInference/InferenceEngine.hAdded+93
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477<mujoco model="g1_23dof"> <compiler angle="radian" meshdir="meshes" /> <default> <default class="leg_motor"> <joint damping="0.05" armature="0.01" frictionloss="0.2" /> </default> <default class="ankle_motor"> <joint damping="0.05" armature="0.01" frictionloss="0.2" /> </default> <default class="arm_motor"> <joint damping="0.05" armature="0.01" frictionloss="0.2" /> </default> <default class="waist_motor"> <joint damping="0.05" armature="0.01" frictionloss="0.2" /> </default>
</default>
<asset> <mesh name="pelvis" file="pelvis.STL" /> <mesh name="pelvis_contour_link" file="pelvis_contour_link.STL" /> <mesh name="left_hip_pitch_link" file="left_hip_pitch_link.STL" /> <mesh name="left_hip_roll_link" file="left_hip_roll_link.STL" /> <mesh name="left_hip_yaw_link" file="left_hip_yaw_link.STL" /> <mesh name="left_knee_link" file="left_knee_link.STL" /> <mesh name="left_ankle_pitch_link" file="left_ankle_pitch_link.STL" /> <mesh name="left_ankle_roll_link" file="left_ankle_roll_link.STL" /> <mesh name="right_hip_pitch_link" file="right_hip_pitch_link.STL" /> <mesh name="right_hip_roll_link" file="right_hip_roll_link.STL" /> <mesh name="right_hip_yaw_link" file="right_hip_yaw_link.STL" /> <mesh name="right_knee_link" file="right_knee_link.STL" /> <mesh name="right_ankle_pitch_link" file="right_ankle_pitch_link.STL" /> <mesh name="right_ankle_roll_link" file="right_ankle_roll_link.STL" /> <mesh name="waist_yaw_link" file="waist_yaw_link.STL" /> <mesh name="torso_link" file="torso_link.STL" /> <mesh name="logo_link" file="logo_link.STL" /> <mesh name="head_link" file="head_link.STL" /> <mesh name="waist_support_link" file="waist_support_link.STL" /> <mesh name="left_shoulder_pitch_link" file="left_shoulder_pitch_link.STL" /> <mesh name="left_shoulder_roll_link" file="left_shoulder_roll_link.STL" /> <mesh name="left_shoulder_yaw_link" file="left_shoulder_yaw_link.STL" /> <mesh name="left_elbow_link" file="left_elbow_link.STL" /> <mesh name="left_wrist_roll_rubber_hand" file="left_wrist_roll_rubber_hand.STL" /> <mesh name="right_shoulder_pitch_link" file="right_shoulder_pitch_link.STL" /> <mesh name="right_shoulder_roll_link" file="right_shoulder_roll_link.STL" /> <mesh name="right_shoulder_yaw_link" file="right_shoulder_yaw_link.STL" /> <mesh name="right_elbow_link" file="right_elbow_link.STL" /> <mesh name="right_wrist_roll_rubber_hand" file="right_wrist_roll_rubber_hand.STL" /> </asset>
<worldbody> <body name="pelvis" pos="0 0 0.793"> <site name="imu" size="0.01" pos="0.0 0.0 0.0" /> <inertial pos="0 0 -0.07605" quat="1 0 -0.000399148 0" mass="3.813" diaginertia="0.010549 0.0093089 0.0079184" /> <joint name="floating_base_joint" type="free" limited="false" actuatorfrclimited="false" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="pelvis" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="pelvis_contour_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="pelvis_contour_link" /> <body name="left_hip_pitch_link" pos="0 0.064452 -0.1027"> <inertial pos="0.002741 0.047791 -0.02606" quat="0.954862 0.293964 0.0302556 0.030122" mass="1.35" diaginertia="0.00181517 0.00153422 0.00116212" /> <joint name="left_hip_pitch_joint" pos="0 0 0" axis="0 1 0" range="-2.5307 2.8798" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="left_hip_pitch_link" /> <geom type="mesh" rgba="0.2 0.2 0.2 1" mesh="left_hip_pitch_link" /> <body name="left_hip_roll_link" pos="0 0.052 -0.030465" quat="0.996179 0 -0.0873386 0"> <inertial pos="0.029812 -0.001045 -0.087934" quat="0.977808 -1.97119e-05 0.205576 -0.0403793" mass="1.52" diaginertia="0.00254986 0.00241169 0.00148755" /> <joint name="left_hip_roll_joint" pos="0 0 0" axis="1 0 0" range="-0.5236 2.9671" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_hip_roll_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_hip_roll_link" /> <body name="left_hip_yaw_link" pos="0.025001 0 -0.12412"> <inertial pos="-0.057709 -0.010981 -0.15078" quat="0.600598 0.15832 0.223482 0.751181" mass="1.702" diaginertia="0.00776166 0.00717575 0.00160139" /> <joint name="left_hip_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.7576 2.7576" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_hip_yaw_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_hip_yaw_link" /> <body name="left_knee_link" pos="-0.078273 0.0021489 -0.17734" quat="0.996179 0 0.0873386 0"> <inertial pos="0.005457 0.003964 -0.12074" quat="0.923418 -0.0327699 0.0158246 0.382067" mass="1.932" diaginertia="0.0113804 0.0112778 0.00146458" /> <joint name="left_knee_joint" pos="0 0 0" axis="0 1 0" range="-0.087267 2.8798" actuatorfrcrange="-139 139" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_knee_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_knee_link" /> <body name="left_ankle_pitch_link" pos="0 -9.4445e-05 -0.30001"> <inertial pos="-0.007269 0 0.011137" quat="0.603053 0.369225 0.369225 0.603053" mass="0.074" diaginertia="1.89e-05 1.40805e-05 6.9195e-06" /> <joint name="left_ankle_pitch_joint" pos="0 0 0" axis="0 1 0" range="-0.87267 0.5236" actuatorfrcrange="-50 50" class="ankle_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_ankle_pitch_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_ankle_pitch_link" /> <body name="left_ankle_roll_link" pos="0 0 -0.017558"> <inertial pos="0.026505 0 -0.016425" quat="-0.000481092 0.728482 -0.000618967 0.685065" mass="0.608" diaginertia="0.00167218 0.0016161 0.000217621" /> <joint name="left_ankle_roll_joint" pos="0 0 0" axis="1 0 0" range="-0.2618 0.2618" actuatorfrcrange="-50 50" class="ankle_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="left_ankle_roll_link" /> <geom size="0.005" pos="-0.05 0.025 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="-0.05 -0.025 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="0.12 0.03 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="0.12 -0.03 -0.03" rgba="0.2 0.2 0.2 1" /> </body> </body> </body> </body> </body> </body> <body name="right_hip_pitch_link" pos="0 -0.064452 -0.1027"> <inertial pos="0.002741 -0.047791 -0.02606" quat="0.954862 -0.293964 0.0302556 -0.030122" mass="1.35" diaginertia="0.00181517 0.00153422 0.00116212" /> <joint name="right_hip_pitch_joint" pos="0 0 0" axis="0 1 0" range="-2.5307 2.8798" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="right_hip_pitch_link" /> <geom type="mesh" rgba="0.2 0.2 0.2 1" mesh="right_hip_pitch_link" /> <body name="right_hip_roll_link" pos="0 -0.052 -0.030465" quat="0.996179 0 -0.0873386 0"> <inertial pos="0.029812 0.001045 -0.087934" quat="0.977808 1.97119e-05 0.205576 0.0403793" mass="1.52" diaginertia="0.00254986 0.00241169 0.00148755" /> <joint name="right_hip_roll_joint" pos="0 0 0" axis="1 0 0" range="-2.9671 0.5236" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_hip_roll_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_hip_roll_link" /> <body name="right_hip_yaw_link" pos="0.025001 0 -0.12412"> <inertial pos="-0.057709 0.010981 -0.15078" quat="0.751181 0.223482 0.15832 0.600598" mass="1.702" diaginertia="0.00776166 0.00717575 0.00160139" /> <joint name="right_hip_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.7576 2.7576" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_hip_yaw_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_hip_yaw_link" /> <body name="right_knee_link" pos="-0.078273 -0.0021489 -0.17734" quat="0.996179 0 0.0873386 0"> <inertial pos="0.005457 -0.003964 -0.12074" quat="0.923439 0.0345276 0.0116333 -0.382012" mass="1.932" diaginertia="0.011374 0.0112843 0.00146452" /> <joint name="right_knee_joint" pos="0 0 0" axis="0 1 0" range="-0.087267 2.8798" actuatorfrcrange="-139 139" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_knee_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_knee_link" /> <body name="right_ankle_pitch_link" pos="0 9.4445e-05 -0.30001"> <inertial pos="-0.007269 0 0.011137" quat="0.603053 0.369225 0.369225 0.603053" mass="0.074" diaginertia="1.89e-05 1.40805e-05 6.9195e-06" /> <joint name="right_ankle_pitch_joint" pos="0 0 0" axis="0 1 0" range="-0.87267 0.5236" actuatorfrcrange="-50 50" class="ankle_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_ankle_pitch_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_ankle_pitch_link" /> <body name="right_ankle_roll_link" pos="0 0 -0.017558"> <inertial pos="0.026505 0 -0.016425" quat="0.000481092 0.728482 0.000618967 0.685065" mass="0.608" diaginertia="0.00167218 0.0016161 0.000217621" /> <joint name="right_ankle_roll_joint" pos="0 0 0" axis="1 0 0" range="-0.2618 0.2618" actuatorfrcrange="-50 50" class="ankle_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="right_ankle_roll_link" /> <geom size="0.005" pos="-0.05 0.025 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="-0.05 -0.025 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="0.12 0.03 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="0.12 -0.03 -0.03" rgba="0.2 0.2 0.2 1" /> </body> </body> </body> </body> </body> </body> <body name="torso_link" pos="-0.0039635 0 0.054"> <inertial pos="0.0034309 0.00025505 0.174524" quat="0.99988 0.000261157 0.0149809 -0.0038211" mass="9.842" diaginertia="0.135151 0.123088 0.0327256" /> <joint name="waist_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.618 2.618" actuatorfrcrange="-88 88" class="waist_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="torso_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="torso_link" /> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="waist_yaw_link" /> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="logo_link" /> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" rgba="0.2 0.2 0.2 1" mesh="logo_link" /> <geom pos="0.0039635 0 -0.054" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="head_link" /> <geom pos="0.0039635 0 -0.054" type="mesh" rgba="0.2 0.2 0.2 1" mesh="head_link" /> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="waist_support_link" /> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" rgba="0.7 0.7 0.7 1" mesh="waist_support_link" /> <body name="left_shoulder_pitch_link" pos="0.0039563 0.10022 0.23778" quat="0.990264 0.139201 1.38722e-05 -9.86868e-05"> <inertial pos="0 0.035892 -0.011628" quat="0.654152 0.0130458 -0.326267 0.68225" mass="0.718" diaginertia="0.000465864 0.000432842 0.000406394" /> <joint name="left_shoulder_pitch_joint" pos="0 0 0" axis="0 1 0" range="-3.0892 2.6704" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_shoulder_pitch_link" /> <geom size="0.03 0.025" pos="0 0.04 -0.01" quat="0.707107 0 0.707107 0" type="cylinder" rgba="0.7 0.7 0.7 1" /> <body name="left_shoulder_roll_link" pos="0 0.038 -0.013831" quat="0.990268 -0.139172 0 0"> <inertial pos="-0.000227 0.00727 -0.063243" quat="0.701256 -0.0196223 -0.00710317 0.712604" mass="0.643" diaginertia="0.000691311 0.000618011 0.000388977" /> <joint name="left_shoulder_roll_joint" pos="0 0 0" axis="1 0 0" range="-1.5882 2.2515" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_shoulder_roll_link" /> <geom size="0.03 0.015" pos="-0.004 0.006 -0.053" type="cylinder" rgba="0.7 0.7 0.7 1" /> <body name="left_shoulder_yaw_link" pos="0 0.00624 -0.1032"> <inertial pos="0.010773 -0.002949 -0.072009" quat="0.716879 -0.0964829 -0.0679942 0.687134" mass="0.734" diaginertia="0.00106187 0.00103217 0.000400661" /> <joint name="left_shoulder_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.618 2.618" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_shoulder_yaw_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_shoulder_yaw_link" /> <body name="left_elbow_link" pos="0.015783 0 -0.080518"> <inertial pos="0.064956 0.004454 -0.010062" quat="0.541765 0.636132 0.388821 0.388129" mass="0.6" diaginertia="0.000443035 0.000421612 0.000259353" /> <joint name="left_elbow_joint" pos="0 0 0" axis="0 1 0" range="-1.0472 2.0944" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_elbow_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_elbow_link" /> <body name="left_wrist_roll_rubber_hand" pos="0.1 0.00188791 -0.01"> <inertial pos="0.107947 0.00163512 0.00202245" quat="0.494051 0.504265 0.48416 0.516933" mass="0.356929" diaginertia="0.00200292 0.0019426 0.000195232" /> <joint name="left_wrist_roll_joint" pos="0 0 0" axis="1 0 0" range="-1.97222 1.97222" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_wrist_roll_rubber_hand" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_wrist_roll_rubber_hand" /> </body> </body> </body> </body> </body> <body name="right_shoulder_pitch_link" pos="0.0039563 -0.10021 0.23778" quat="0.990264 -0.139201 1.38722e-05 9.86868e-05"> <inertial pos="0 -0.035892 -0.011628" quat="0.68225 -0.326267 0.0130458 0.654152" mass="0.718" diaginertia="0.000465864 0.000432842 0.000406394" /> <joint name="right_shoulder_pitch_joint" pos="0 0 0" axis="0 1 0" range="-3.0892 2.6704" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_shoulder_pitch_link" /> <geom size="0.03 0.025" pos="0 -0.04 -0.01" quat="0.707107 0 0.707107 0" type="cylinder" rgba="0.7 0.7 0.7 1" /> <body name="right_shoulder_roll_link" pos="0 -0.038 -0.013831" quat="0.990268 0.139172 0 0"> <inertial pos="-0.000227 -0.00727 -0.063243" quat="0.712604 -0.00710317 -0.0196223 0.701256" mass="0.643" diaginertia="0.000691311 0.000618011 0.000388977" /> <joint name="right_shoulder_roll_joint" pos="0 0 0" axis="1 0 0" range="-2.2515 1.5882" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_shoulder_roll_link" /> <geom size="0.03 0.015" pos="-0.004 -0.006 -0.053" type="cylinder" rgba="0.7 0.7 0.7 1" /> <body name="right_shoulder_yaw_link" pos="0 -0.00624 -0.1032"> <inertial pos="0.010773 0.002949 -0.072009" quat="0.687134 -0.0679942 -0.0964829 0.716879" mass="0.734" diaginertia="0.00106187 0.00103217 0.000400661" /> <joint name="right_shoulder_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.618 2.618" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_shoulder_yaw_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_shoulder_yaw_link" /> <body name="right_elbow_link" pos="0.015783 0 -0.080518"> <inertial pos="0.064956 -0.004454 -0.010062" quat="0.388129 0.388821 0.636132 0.541765" mass="0.6" diaginertia="0.000443035 0.000421612 0.000259353" /> <joint name="right_elbow_joint" pos="0 0 0" axis="0 1 0" range="-1.0472 2.0944" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_elbow_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_elbow_link" /> <body name="right_wrist_roll_rubber_hand" pos="0.1 -0.00188791 -0.01"> <inertial pos="0.107947 -0.00163512 0.00202245" quat="0.516933 0.48416 0.504265 0.494051" mass="0.356929" diaginertia="0.00200292 0.0019426 0.000195232" /> <joint name="right_wrist_roll_joint" pos="0 0 0" axis="1 0 0" range="-1.97222 1.97222" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_wrist_roll_rubber_hand" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_wrist_roll_rubber_hand" /> </body> </body> </body> </body> </body> </body> </body> <body name="waist_roll" pos="0 0 20"> <inertial pos="0.0 0.0 0.0" mass="1e-03" diaginertia="1e-03 1e-03 1e-03" /> <joint name="waist_roll_joint" /> </body> <body name="waist_pitch" pos="0 0 20"> <inertial pos="0.0 0.0 0.0" mass="1e-03" diaginertia="1e-03 1e-03 1e-03" /> <joint name="waist_pitch_joint" /> </body> <body name="left_wrist_pitch" pos="0 0 20"> <inertial pos="0.0 0.0 0.0" mass="1e-03" diaginertia="1e-03 1e-03 1e-03" /> <joint name="left_wrist_pitch_joint" /> </body> <body name="left_wrist_yaw" pos="0 0 20"> <inertial pos="0.0 0.0 0.0" mass="1e-03" diaginertia="1e-03 1e-03 1e-03" /> <joint name="left_wrist_yaw_joint" /> </body> <body name="right_wrist_pitch" pos="0 0 20"> <inertial pos="0.0 0.0 0.0" mass="1e-03" diaginertia="1e-03 1e-03 1e-03" /> <joint name="right_wrist_pitch_joint" /> </body> <body name="right_wrist_yaw" pos="0 0 20"> <inertial pos="0.0 0.0 0.0" mass="1e-03" diaginertia="1e-03 1e-03 1e-03" /> <joint name="right_wrist_yaw_joint" /> </body> </worldbody>
<actuator> <motor name="left_hip_pitch" joint="left_hip_pitch_joint" ctrlrange="-88 88" /> <motor name="left_hip_roll" joint="left_hip_roll_joint" ctrlrange="-88 88" /> <motor name="left_hip_yaw" joint="left_hip_yaw_joint" ctrlrange="-88 88" /> <motor name="left_knee" joint="left_knee_joint" ctrlrange="-139 139" /> <motor name="left_ankle_pitch" joint="left_ankle_pitch_joint" ctrlrange="-50 50" /> <motor name="left_ankle_roll" joint="left_ankle_roll_joint" ctrlrange="-50 50" />
<motor name="right_hip_pitch" joint="right_hip_pitch_joint" ctrlrange="-88 88" /> <motor name="right_hip_roll" joint="right_hip_roll_joint" ctrlrange="-88 88" /> <motor name="right_hip_yaw" joint="right_hip_yaw_joint" ctrlrange="-88 88" /> <motor name="right_knee" joint="right_knee_joint" ctrlrange="-139 139" /> <motor name="right_ankle_pitch" joint="right_ankle_pitch_joint" ctrlrange="-50 50" /> <motor name="right_ankle_roll" joint="right_ankle_roll_joint" ctrlrange="-50 50" />
<motor name="waist_yaw" joint="waist_yaw_joint" ctrlrange="-88 88" /> <motor name="waist_roll" joint="waist_roll_joint" ctrlrange="-50 50" /> <motor name="waist_pitch" joint="waist_pitch_joint" ctrlrange="-50 50" />
<motor name="left_shoulder_pitch" joint="left_shoulder_pitch_joint" ctrlrange="-25 25" /> <motor name="left_shoulder_roll" joint="left_shoulder_roll_joint" ctrlrange="-25 25" /> <motor name="left_shoulder_yaw" joint="left_shoulder_yaw_joint" ctrlrange="-25 25" /> <motor name="left_elbow" joint="left_elbow_joint" ctrlrange="-25 25" /> <motor name="left_wrist_roll" joint="left_wrist_roll_joint" ctrlrange="-25 25" /> <motor name="left_wrist_pitch" joint="left_wrist_pitch_joint" ctrlrange="-5 5" /> <motor name="left_wrist_yaw" joint="left_wrist_yaw_joint" ctrlrange="-5 5" />
<motor name="right_shoulder_pitch" joint="right_shoulder_pitch_joint" ctrlrange="-25 25" /> <motor name="right_shoulder_roll" joint="right_shoulder_roll_joint" ctrlrange="-25 25" /> <motor name="right_shoulder_yaw" joint="right_shoulder_yaw_joint" ctrlrange="-25 25" /> <motor name="right_elbow" joint="right_elbow_joint" ctrlrange="-25 25" /> <motor name="right_wrist_roll" joint="right_wrist_roll_joint" ctrlrange="-25 25" /> <motor name="right_wrist_pitch" joint="right_wrist_pitch_joint" ctrlrange="-5 5" /> <motor name="right_wrist_yaw" joint="right_wrist_yaw_joint" ctrlrange="-5 5" /> </actuator>
<sensor> <jointpos name="left_hip_pitch_pos" joint="left_hip_pitch_joint" /> <jointpos name="left_hip_roll_pos" joint="left_hip_roll_joint" /> <jointpos name="left_hip_yaw_pos" joint="left_hip_yaw_joint" /> <jointpos name="left_knee_pos" joint="left_knee_joint" /> <jointpos name="left_ankle_pitch_pos" joint="left_ankle_pitch_joint" /> <jointpos name="left_ankle_roll_pos" joint="left_ankle_roll_joint" /> <jointpos name="right_hip_pitch_pos" joint="right_hip_pitch_joint" /> <jointpos name="right_hip_roll_pos" joint="right_hip_roll_joint" /> <jointpos name="right_hip_yaw_pos" joint="right_hip_yaw_joint" /> <jointpos name="right_knee_pos" joint="right_knee_joint" /> <jointpos name="right_ankle_pitch_pos" joint="right_ankle_pitch_joint" /> <jointpos name="right_ankle_roll_pos" joint="right_ankle_roll_joint" /> <jointpos name="waist_yaw_pos" joint="waist_yaw_joint" /> <jointpos name="waist_roll_pos" joint="waist_roll_joint" /> <jointpos name="waist_pitch_pos" joint="waist_pitch_joint" /> <jointpos name="left_shoulder_pitch_pos" joint="left_shoulder_pitch_joint" /> <jointpos name="left_shoulder_roll_pos" joint="left_shoulder_roll_joint" /> <jointpos name="left_shoulder_yaw_pos" joint="left_shoulder_yaw_joint" /> <jointpos name="left_elbow_pos" joint="left_elbow_joint" /> <jointpos name="left_wrist_roll_pos" joint="left_wrist_roll_joint" /> <jointpos name="left_wrist_pitch_pos" joint="left_wrist_pitch_joint" /> <jointpos name="left_wrist_yaw_pos" joint="left_wrist_yaw_joint" /> <jointpos name="right_shoulder_pitch_pos" joint="right_shoulder_pitch_joint" /> <jointpos name="right_shoulder_roll_pos" joint="right_shoulder_roll_joint" /> <jointpos name="right_shoulder_yaw_pos" joint="right_shoulder_yaw_joint" /> <jointpos name="right_elbow_pos" joint="right_elbow_joint" /> <jointpos name="right_wrist_roll_pos" joint="right_wrist_roll_joint" /> <jointpos name="right_wrist_pitch_pos" joint="right_wrist_pitch_joint" /> <jointpos name="right_wrist_yaw_pos" joint="right_wrist_yaw_joint" />
<jointvel name="left_hip_pitch_vel" joint="left_hip_pitch_joint" /> <jointvel name="left_hip_roll_vel" joint="left_hip_roll_joint" /> <jointvel name="left_hip_yaw_vel" joint="left_hip_yaw_joint" /> <jointvel name="left_knee_vel" joint="left_knee_joint" /> <jointvel name="left_ankle_pitch_vel" joint="left_ankle_pitch_joint" /> <jointvel name="left_ankle_roll_vel" joint="left_ankle_roll_joint" /> <jointvel name="right_hip_pitch_vel" joint="right_hip_pitch_joint" /> <jointvel name="right_hip_roll_vel" joint="right_hip_roll_joint" /> <jointvel name="right_hip_yaw_vel" joint="right_hip_yaw_joint" /> <jointvel name="right_knee_vel" joint="right_knee_joint" /> <jointvel name="right_ankle_pitch_vel" joint="right_ankle_pitch_joint" /> <jointvel name="right_ankle_roll_vel" joint="right_ankle_roll_joint" /> <jointvel name="waist_yaw_vel" joint="waist_yaw_joint" /> <jointvel name="waist_roll_vel" joint="waist_roll_joint" /> <jointvel name="waist_pitch_vel" joint="waist_pitch_joint" /> <jointvel name="left_shoulder_pitch_vel" joint="left_shoulder_pitch_joint" /> <jointvel name="left_shoulder_roll_vel" joint="left_shoulder_roll_joint" /> <jointvel name="left_shoulder_yaw_vel" joint="left_shoulder_yaw_joint" /> <jointvel name="left_elbow_vel" joint="left_elbow_joint" /> <jointvel name="left_wrist_roll_vel" joint="left_wrist_roll_joint" /> <jointvel name="left_wrist_pitch_vel" joint="left_wrist_pitch_joint" /> <jointvel name="left_wrist_yaw_vel" joint="left_wrist_yaw_joint" /> <jointvel name="right_shoulder_pitch_vel" joint="right_shoulder_pitch_joint" /> <jointvel name="right_shoulder_roll_vel" joint="right_shoulder_roll_joint" /> <jointvel name="right_shoulder_yaw_vel" joint="right_shoulder_yaw_joint" /> <jointvel name="right_elbow_vel" joint="right_elbow_joint" /> <jointvel name="right_wrist_roll_vel" joint="right_wrist_roll_joint" /> <jointvel name="right_wrist_pitch_vel" joint="right_wrist_pitch_joint" /> <jointvel name="right_wrist_yaw_vel" joint="right_wrist_yaw_joint" />
<jointactuatorfrc name="left_hip_pitch_torque" joint="left_hip_pitch_joint" /> <jointactuatorfrc name="left_hip_roll_torque" joint="left_hip_roll_joint" /> <jointactuatorfrc name="left_hip_yaw_torque" joint="left_hip_yaw_joint" /> <jointactuatorfrc name="left_knee_torque" joint="left_knee_joint" /> <jointactuatorfrc name="left_ankle_pitch_torque" joint="left_ankle_pitch_joint" /> <jointactuatorfrc name="left_ankle_roll_torque" joint="left_ankle_roll_joint" /> <jointactuatorfrc name="right_hip_pitch_torque" joint="right_hip_pitch_joint" /> <jointactuatorfrc name="right_hip_roll_torque" joint="right_hip_roll_joint" /> <jointactuatorfrc name="right_hip_yaw_torque" joint="right_hip_yaw_joint" /> <jointactuatorfrc name="right_knee_torque" joint="right_knee_joint" /> <jointactuatorfrc name="right_ankle_pitch_torque" joint="right_ankle_pitch_joint" /> <jointactuatorfrc name="right_ankle_roll_torque" joint="right_ankle_roll_joint" /> <jointactuatorfrc name="waist_yaw_torque" joint="waist_yaw_joint" /> <jointactuatorfrc name="waist_roll_torque" joint="waist_roll_joint" /> <jointactuatorfrc name="waist_pitch_torque" joint="waist_pitch_joint" /> <jointactuatorfrc name="left_shoulder_pitch_torque" joint="left_shoulder_pitch_joint" /> <jointactuatorfrc name="left_shoulder_roll_torque" joint="left_shoulder_roll_joint" /> <jointactuatorfrc name="left_shoulder_yaw_torque" joint="left_shoulder_yaw_joint" /> <jointactuatorfrc name="left_elbow_torque" joint="left_elbow_joint" /> <jointactuatorfrc name="left_wrist_roll_torque" joint="left_wrist_roll_joint" /> <jointactuatorfrc name="left_wrist_pitch_torque" joint="left_wrist_pitch_joint" /> <jointactuatorfrc name="left_wrist_yaw_torque" joint="left_wrist_yaw_joint" /> <jointactuatorfrc name="right_shoulder_pitch_torque" joint="right_shoulder_pitch_joint" /> <jointactuatorfrc name="right_shoulder_roll_torque" joint="right_shoulder_roll_joint" /> <jointactuatorfrc name="right_shoulder_yaw_torque" joint="right_shoulder_yaw_joint" /> <jointactuatorfrc name="right_elbow_torque" joint="right_elbow_joint" /> <jointactuatorfrc name="right_wrist_roll_torque" joint="right_wrist_roll_joint" /> <jointactuatorfrc name="right_wrist_pitch_torque" joint="right_wrist_pitch_joint" /> <jointactuatorfrc name="right_wrist_yaw_torque" joint="right_wrist_yaw_joint" />
<framequat name="imu_quat" objtype="site" objname="imu" /> <gyro name="imu_gyro" site="imu" /> <accelerometer name="imu_acc" site="imu" />
<framepos name="frame_pos" objtype="site" objname="imu" /> <framelinvel name="frame_vel" objtype="site" objname="imu" /> </sensor>
</mujoco>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296<mujoco model="g1_29dof"> <compiler angle="radian" meshdir="meshes"/>
<asset> <mesh name="pelvis" file="pelvis.STL"/> <mesh name="pelvis_contour_link" file="pelvis_contour_link.STL"/> <mesh name="left_hip_pitch_link" file="left_hip_pitch_link.STL"/> <mesh name="left_hip_roll_link" file="left_hip_roll_link.STL"/> <mesh name="left_hip_yaw_link" file="left_hip_yaw_link.STL"/> <mesh name="left_knee_link" file="left_knee_link.STL"/> <mesh name="left_ankle_pitch_link" file="left_ankle_pitch_link.STL"/> <mesh name="left_ankle_roll_link" file="left_ankle_roll_link.STL"/> <mesh name="right_hip_pitch_link" file="right_hip_pitch_link.STL"/> <mesh name="right_hip_roll_link" file="right_hip_roll_link.STL"/> <mesh name="right_hip_yaw_link" file="right_hip_yaw_link.STL"/> <mesh name="right_knee_link" file="right_knee_link.STL"/> <mesh name="right_ankle_pitch_link" file="right_ankle_pitch_link.STL"/> <mesh name="right_ankle_roll_link" file="right_ankle_roll_link.STL"/> <mesh name="waist_yaw_link" file="waist_yaw_link.STL"/> <mesh name="waist_roll_link" file="waist_roll_link.STL"/> <mesh name="torso_link" file="torso_link.STL"/> <mesh name="logo_link" file="logo_link.STL"/> <mesh name="head_link" file="head_link.STL"/> <mesh name="waist_support_link" file="waist_support_link.STL"/> <mesh name="left_shoulder_pitch_link" file="left_shoulder_pitch_link.STL"/> <mesh name="left_shoulder_roll_link" file="left_shoulder_roll_link.STL"/> <mesh name="left_shoulder_yaw_link" file="left_shoulder_yaw_link.STL"/> <mesh name="left_elbow_link" file="left_elbow_link.STL"/> <mesh name="left_wrist_roll_link" file="left_wrist_roll_link.STL"/> <mesh name="left_wrist_pitch_link" file="left_wrist_pitch_link.STL"/> <mesh name="left_wrist_yaw_link" file="left_wrist_yaw_link.STL"/> <mesh name="left_rubber_hand" file="left_rubber_hand.STL"/> <mesh name="right_shoulder_pitch_link" file="right_shoulder_pitch_link.STL"/> <mesh name="right_shoulder_roll_link" file="right_shoulder_roll_link.STL"/> <mesh name="right_shoulder_yaw_link" file="right_shoulder_yaw_link.STL"/> <mesh name="right_elbow_link" file="right_elbow_link.STL"/> <mesh name="right_wrist_roll_link" file="right_wrist_roll_link.STL"/> <mesh name="right_wrist_pitch_link" file="right_wrist_pitch_link.STL"/> <mesh name="right_wrist_yaw_link" file="right_wrist_yaw_link.STL"/> <mesh name="right_rubber_hand" file="right_rubber_hand.STL"/> </asset>
<worldbody> <body name="pelvis" pos="0 0 0.793"> <inertial pos="0 0 -0.07605" quat="1 0 -0.000399148 0" mass="3.813" diaginertia="0.010549 0.0093089 0.0079184"/> <joint name="floating_base_joint" type="free" limited="false" actuatorfrclimited="false"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="pelvis"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="pelvis_contour_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="pelvis_contour_link"/> <body name="left_hip_pitch_link" pos="0 0.064452 -0.1027"> <inertial pos="0.002741 0.047791 -0.02606" quat="0.954862 0.293964 0.0302556 0.030122" mass="1.35" diaginertia="0.00181517 0.00153422 0.00116212"/> <joint name="left_hip_pitch_joint" pos="0 0 0" axis="0 1 0" range="-2.5307 2.8798" actuatorfrcrange="-88 88"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="left_hip_pitch_link"/> <geom type="mesh" rgba="0.2 0.2 0.2 1" mesh="left_hip_pitch_link"/> <body name="left_hip_roll_link" pos="0 0.052 -0.030465" quat="0.996179 0 -0.0873386 0"> <inertial pos="0.029812 -0.001045 -0.087934" quat="0.977808 -1.97119e-05 0.205576 -0.0403793" mass="1.52" diaginertia="0.00254986 0.00241169 0.00148755"/> <joint name="left_hip_roll_joint" pos="0 0 0" axis="1 0 0" range="-0.5236 2.9671" actuatorfrcrange="-88 88"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_hip_roll_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_hip_roll_link"/> <body name="left_hip_yaw_link" pos="0.025001 0 -0.12412"> <inertial pos="-0.057709 -0.010981 -0.15078" quat="0.600598 0.15832 0.223482 0.751181" mass="1.702" diaginertia="0.00776166 0.00717575 0.00160139"/> <joint name="left_hip_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.7576 2.7576" actuatorfrcrange="-88 88"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_hip_yaw_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_hip_yaw_link"/> <body name="left_knee_link" pos="-0.078273 0.0021489 -0.17734" quat="0.996179 0 0.0873386 0"> <inertial pos="0.005457 0.003964 -0.12074" quat="0.923418 -0.0327699 0.0158246 0.382067" mass="1.932" diaginertia="0.0113804 0.0112778 0.00146458"/> <joint name="left_knee_joint" pos="0 0 0" axis="0 1 0" range="-0.087267 2.8798" actuatorfrcrange="-139 139"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_knee_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_knee_link"/> <body name="left_ankle_pitch_link" pos="0 -9.4445e-05 -0.30001"> <inertial pos="-0.007269 0 0.011137" quat="0.603053 0.369225 0.369225 0.603053" mass="0.074" diaginertia="1.89e-05 1.40805e-05 6.9195e-06"/> <joint name="left_ankle_pitch_joint" pos="0 0 0" axis="0 1 0" range="-0.87267 0.5236" actuatorfrcrange="-50 50"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_ankle_pitch_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_ankle_pitch_link"/> <body name="left_ankle_roll_link" pos="0 0 -0.017558"> <inertial pos="0.026505 0 -0.016425" quat="-0.000481092 0.728482 -0.000618967 0.685065" mass="0.608" diaginertia="0.00167218 0.0016161 0.000217621"/> <joint name="left_ankle_roll_joint" pos="0 0 0" axis="1 0 0" range="-0.2618 0.2618" actuatorfrcrange="-50 50"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="left_ankle_roll_link"/> <geom size="0.005" pos="-0.05 0.025 -0.03" rgba="0.2 0.2 0.2 1"/> <geom size="0.005" pos="-0.05 -0.025 -0.03" rgba="0.2 0.2 0.2 1"/> <geom size="0.005" pos="0.12 0.03 -0.03" rgba="0.2 0.2 0.2 1"/> <geom size="0.005" pos="0.12 -0.03 -0.03" rgba="0.2 0.2 0.2 1"/> </body> </body> </body> </body> </body> </body> <body name="right_hip_pitch_link" pos="0 -0.064452 -0.1027"> <inertial pos="0.002741 -0.047791 -0.02606" quat="0.954862 -0.293964 0.0302556 -0.030122" mass="1.35" diaginertia="0.00181517 0.00153422 0.00116212"/> <joint name="right_hip_pitch_joint" pos="0 0 0" axis="0 1 0" range="-2.5307 2.8798" actuatorfrcrange="-88 88"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="right_hip_pitch_link"/> <geom type="mesh" rgba="0.2 0.2 0.2 1" mesh="right_hip_pitch_link"/> <body name="right_hip_roll_link" pos="0 -0.052 -0.030465" quat="0.996179 0 -0.0873386 0"> <inertial pos="0.029812 0.001045 -0.087934" quat="0.977808 1.97119e-05 0.205576 0.0403793" mass="1.52" diaginertia="0.00254986 0.00241169 0.00148755"/> <joint name="right_hip_roll_joint" pos="0 0 0" axis="1 0 0" range="-2.9671 0.5236" actuatorfrcrange="-88 88"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_hip_roll_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_hip_roll_link"/> <body name="right_hip_yaw_link" pos="0.025001 0 -0.12412"> <inertial pos="-0.057709 0.010981 -0.15078" quat="0.751181 0.223482 0.15832 0.600598" mass="1.702" diaginertia="0.00776166 0.00717575 0.00160139"/> <joint name="right_hip_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.7576 2.7576" actuatorfrcrange="-88 88"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_hip_yaw_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_hip_yaw_link"/> <body name="right_knee_link" pos="-0.078273 -0.0021489 -0.17734" quat="0.996179 0 0.0873386 0"> <inertial pos="0.005457 -0.003964 -0.12074" quat="0.923439 0.0345276 0.0116333 -0.382012" mass="1.932" diaginertia="0.011374 0.0112843 0.00146452"/> <joint name="right_knee_joint" pos="0 0 0" axis="0 1 0" range="-0.087267 2.8798" actuatorfrcrange="-139 139"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_knee_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_knee_link"/> <body name="right_ankle_pitch_link" pos="0 9.4445e-05 -0.30001"> <inertial pos="-0.007269 0 0.011137" quat="0.603053 0.369225 0.369225 0.603053" mass="0.074" diaginertia="1.89e-05 1.40805e-05 6.9195e-06"/> <joint name="right_ankle_pitch_joint" pos="0 0 0" axis="0 1 0" range="-0.87267 0.5236" actuatorfrcrange="-50 50"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_ankle_pitch_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_ankle_pitch_link"/> <body name="right_ankle_roll_link" pos="0 0 -0.017558"> <inertial pos="0.026505 0 -0.016425" quat="0.000481092 0.728482 0.000618967 0.685065" mass="0.608" diaginertia="0.00167218 0.0016161 0.000217621"/> <joint name="right_ankle_roll_joint" pos="0 0 0" axis="1 0 0" range="-0.2618 0.2618" actuatorfrcrange="-50 50"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="right_ankle_roll_link"/> <geom size="0.005" pos="-0.05 0.025 -0.03" rgba="0.2 0.2 0.2 1"/> <geom size="0.005" pos="-0.05 -0.025 -0.03" rgba="0.2 0.2 0.2 1"/> <geom size="0.005" pos="0.12 0.03 -0.03" rgba="0.2 0.2 0.2 1"/> <geom size="0.005" pos="0.12 -0.03 -0.03" rgba="0.2 0.2 0.2 1"/> </body> </body> </body> </body> </body> </body> <body name="waist_yaw_link"> <inertial pos="0.003964 0 0.018769" quat="-0.0178291 0.628464 0.0282471 0.777121" mass="0.244" diaginertia="0.000158561 0.000124229 9.67669e-05"/> <joint name="waist_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.618 2.618" actuatorfrcrange="-88 88"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="waist_yaw_link"/> <body name="waist_roll_link" pos="-0.0039635 0 0.035"> <inertial pos="0 -0.000236 0.010111" quat="0.99979 0.020492 0 0" mass="0.047" diaginertia="7.515e-06 6.40206e-06 3.98394e-06"/> <joint name="waist_roll_joint" pos="0 0 0" axis="1 0 0" range="-0.52 0.52" actuatorfrcrange="-50 50"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="waist_roll_link"/> <body name="torso_link" pos="0 0 0.019"> <inertial pos="0.00331658 0.000261533 0.179856" quat="0.999831 0.000376204 0.0179895 -0.00377704" mass="9.598" diaginertia="0.12407 0.111951 0.0325382"/> <joint name="waist_pitch_joint" pos="0 0 0" axis="0 1 0" range="-0.52 0.52" actuatorfrcrange="-50 50"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="torso_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="torso_link"/> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="logo_link"/> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" rgba="0.2 0.2 0.2 1" mesh="logo_link"/> <geom pos="0.0039635 0 -0.054" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="head_link"/> <geom pos="0.0039635 0 -0.054" type="mesh" rgba="0.2 0.2 0.2 1" mesh="head_link"/> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="waist_support_link"/> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" rgba="0.7 0.7 0.7 1" mesh="waist_support_link"/> <site name="imu" size="0.01" pos="-0.03959 -0.00224 0.13792"/> <body name="left_shoulder_pitch_link" pos="0.0039563 0.10022 0.23778" quat="0.990264 0.139201 1.38722e-05 -9.86868e-05"> <inertial pos="0 0.035892 -0.011628" quat="0.654152 0.0130458 -0.326267 0.68225" mass="0.718" diaginertia="0.000465864 0.000432842 0.000406394"/> <joint name="left_shoulder_pitch_joint" pos="0 0 0" axis="0 1 0" range="-3.0892 2.6704" actuatorfrcrange="-25 25"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_shoulder_pitch_link"/> <geom size="0.03 0.025" pos="0 0.04 -0.01" quat="0.707107 0 0.707107 0" type="cylinder" rgba="0.7 0.7 0.7 1"/> <body name="left_shoulder_roll_link" pos="0 0.038 -0.013831" quat="0.990268 -0.139172 0 0"> <inertial pos="-0.000227 0.00727 -0.063243" quat="0.701256 -0.0196223 -0.00710317 0.712604" mass="0.643" diaginertia="0.000691311 0.000618011 0.000388977"/> <joint name="left_shoulder_roll_joint" pos="0 0 0" axis="1 0 0" range="-1.5882 2.2515" actuatorfrcrange="-25 25"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_shoulder_roll_link"/> <geom size="0.03 0.015" pos="-0.004 0.006 -0.053" type="cylinder" rgba="0.7 0.7 0.7 1"/> <body name="left_shoulder_yaw_link" pos="0 0.00624 -0.1032"> <inertial pos="0.010773 -0.002949 -0.072009" quat="0.716879 -0.0964829 -0.0679942 0.687134" mass="0.734" diaginertia="0.00106187 0.00103217 0.000400661"/> <joint name="left_shoulder_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.618 2.618" actuatorfrcrange="-25 25"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_shoulder_yaw_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_shoulder_yaw_link"/> <body name="left_elbow_link" pos="0.015783 0 -0.080518"> <inertial pos="0.064956 0.004454 -0.010062" quat="0.541765 0.636132 0.388821 0.388129" mass="0.6" diaginertia="0.000443035 0.000421612 0.000259353"/> <joint name="left_elbow_joint" pos="0 0 0" axis="0 1 0" range="-1.0472 2.0944" actuatorfrcrange="-25 25"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_elbow_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_elbow_link"/> <body name="left_wrist_roll_link" pos="0.1 0.00188791 -0.01"> <inertial pos="0.0171394 0.000537591 4.8864e-07" quat="0.575338 0.411667 -0.574906 0.411094" mass="0.085445" diaginertia="5.48211e-05 4.96646e-05 3.57798e-05"/> <joint name="left_wrist_roll_joint" pos="0 0 0" axis="1 0 0" range="-1.97222 1.97222" actuatorfrcrange="-25 25"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_wrist_roll_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_wrist_roll_link"/> <body name="left_wrist_pitch_link" pos="0.038 0 0"> <inertial pos="0.0229999 -0.00111685 -0.00111658" quat="0.249998 0.661363 0.293036 0.643608" mass="0.48405" diaginertia="0.000430353 0.000429873 0.000164648"/> <joint name="left_wrist_pitch_joint" pos="0 0 0" axis="0 1 0" range="-1.61443 1.61443" actuatorfrcrange="-5 5"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_wrist_pitch_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_wrist_pitch_link"/> <body name="left_wrist_yaw_link" pos="0.046 0 0"> <inertial pos="0.0708244 0.000191745 0.00161742" quat="0.510571 0.526295 0.468078 0.493188" mass="0.254576" diaginertia="0.000646113 0.000559993 0.000147566"/> <joint name="left_wrist_yaw_joint" pos="0 0 0" axis="0 0 1" range="-1.61443 1.61443" actuatorfrcrange="-5 5"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_wrist_yaw_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_wrist_yaw_link"/> <geom pos="0.0415 0.003 0" quat="1 0 0 0" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_rubber_hand"/> <geom pos="0.0415 0.003 0" quat="1 0 0 0" type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_rubber_hand"/> </body> </body> </body> </body> </body> </body> </body> <body name="right_shoulder_pitch_link" pos="0.0039563 -0.10021 0.23778" quat="0.990264 -0.139201 1.38722e-05 9.86868e-05"> <inertial pos="0 -0.035892 -0.011628" quat="0.68225 -0.326267 0.0130458 0.654152" mass="0.718" diaginertia="0.000465864 0.000432842 0.000406394"/> <joint name="right_shoulder_pitch_joint" pos="0 0 0" axis="0 1 0" range="-3.0892 2.6704" actuatorfrcrange="-25 25"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_shoulder_pitch_link"/> <geom size="0.03 0.025" pos="0 -0.04 -0.01" quat="0.707107 0 0.707107 0" type="cylinder" rgba="0.7 0.7 0.7 1"/> <body name="right_shoulder_roll_link" pos="0 -0.038 -0.013831" quat="0.990268 0.139172 0 0"> <inertial pos="-0.000227 -0.00727 -0.063243" quat="0.712604 -0.00710317 -0.0196223 0.701256" mass="0.643" diaginertia="0.000691311 0.000618011 0.000388977"/> <joint name="right_shoulder_roll_joint" pos="0 0 0" axis="1 0 0" range="-2.2515 1.5882" actuatorfrcrange="-25 25"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_shoulder_roll_link"/> <geom size="0.03 0.015" pos="-0.004 -0.006 -0.053" type="cylinder" rgba="0.7 0.7 0.7 1"/> <body name="right_shoulder_yaw_link" pos="0 -0.00624 -0.1032"> <inertial pos="0.010773 0.002949 -0.072009" quat="0.687134 -0.0679942 -0.0964829 0.716879" mass="0.734" diaginertia="0.00106187 0.00103217 0.000400661"/> <joint name="right_shoulder_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.618 2.618" actuatorfrcrange="-25 25"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_shoulder_yaw_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_shoulder_yaw_link"/> <body name="right_elbow_link" pos="0.015783 0 -0.080518"> <inertial pos="0.064956 -0.004454 -0.010062" quat="0.388129 0.388821 0.636132 0.541765" mass="0.6" diaginertia="0.000443035 0.000421612 0.000259353"/> <joint name="right_elbow_joint" pos="0 0 0" axis="0 1 0" range="-1.0472 2.0944" actuatorfrcrange="-25 25"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_elbow_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_elbow_link"/> <body name="right_wrist_roll_link" pos="0.1 -0.00188791 -0.01"> <inertial pos="0.0171394 -0.000537591 4.8864e-07" quat="0.411667 0.575338 -0.411094 0.574906" mass="0.085445" diaginertia="5.48211e-05 4.96646e-05 3.57798e-05"/> <joint name="right_wrist_roll_joint" pos="0 0 0" axis="1 0 0" range="-1.97222 1.97222" actuatorfrcrange="-25 25"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_wrist_roll_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_wrist_roll_link"/> <body name="right_wrist_pitch_link" pos="0.038 0 0"> <inertial pos="0.0229999 0.00111685 -0.00111658" quat="0.643608 0.293036 0.661363 0.249998" mass="0.48405" diaginertia="0.000430353 0.000429873 0.000164648"/> <joint name="right_wrist_pitch_joint" pos="0 0 0" axis="0 1 0" range="-1.61443 1.61443" actuatorfrcrange="-5 5"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_wrist_pitch_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_wrist_pitch_link"/> <body name="right_wrist_yaw_link" pos="0.046 0 0"> <inertial pos="0.0708244 -0.000191745 0.00161742" quat="0.493188 0.468078 0.526295 0.510571" mass="0.254576" diaginertia="0.000646113 0.000559993 0.000147566"/> <joint name="right_wrist_yaw_joint" pos="0 0 0" axis="0 0 1" range="-1.61443 1.61443" actuatorfrcrange="-5 5"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_wrist_yaw_link"/> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_wrist_yaw_link"/> <geom pos="0.0415 -0.003 0" quat="1 0 0 0" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_rubber_hand"/> <geom pos="0.0415 -0.003 0" quat="1 0 0 0" type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_rubber_hand"/> </body> </body> </body> </body> </body> </body> </body> </body> </body> </body> </body> </worldbody>
<actuator> <motor name="left_hip_pitch_joint" joint="left_hip_pitch_joint"/> <motor name="left_hip_roll_joint" joint="left_hip_roll_joint"/> <motor name="left_hip_yaw_joint" joint="left_hip_yaw_joint"/> <motor name="left_knee_joint" joint="left_knee_joint"/> <motor name="left_ankle_pitch_joint" joint="left_ankle_pitch_joint"/> <motor name="left_ankle_roll_joint" joint="left_ankle_roll_joint"/> <motor name="right_hip_pitch_joint" joint="right_hip_pitch_joint"/> <motor name="right_hip_roll_joint" joint="right_hip_roll_joint"/> <motor name="right_hip_yaw_joint" joint="right_hip_yaw_joint"/> <motor name="right_knee_joint" joint="right_knee_joint"/> <motor name="right_ankle_pitch_joint" joint="right_ankle_pitch_joint"/> <motor name="right_ankle_roll_joint" joint="right_ankle_roll_joint"/> <motor name="waist_yaw_joint" joint="waist_yaw_joint"/> <motor name="waist_roll_joint" joint="waist_roll_joint"/> <motor name="waist_pitch_joint" joint="waist_pitch_joint"/> <motor name="left_shoulder_pitch_joint" joint="left_shoulder_pitch_joint"/> <motor name="left_shoulder_roll_joint" joint="left_shoulder_roll_joint"/> <motor name="left_shoulder_yaw_joint" joint="left_shoulder_yaw_joint"/> <motor name="left_elbow_joint" joint="left_elbow_joint"/> <motor name="left_wrist_roll_joint" joint="left_wrist_roll_joint"/> <motor name="left_wrist_pitch_joint" joint="left_wrist_pitch_joint"/> <motor name="left_wrist_yaw_joint" joint="left_wrist_yaw_joint"/> <motor name="right_shoulder_pitch_joint" joint="right_shoulder_pitch_joint"/> <motor name="right_shoulder_roll_joint" joint="right_shoulder_roll_joint"/> <motor name="right_shoulder_yaw_joint" joint="right_shoulder_yaw_joint"/> <motor name="right_elbow_joint" joint="right_elbow_joint"/> <motor name="right_wrist_roll_joint" joint="right_wrist_roll_joint"/> <motor name="right_wrist_pitch_joint" joint="right_wrist_pitch_joint"/> <motor name="right_wrist_yaw_joint" joint="right_wrist_yaw_joint"/> </actuator>
<sensor> <gyro name="imu-angular-velocity" site="imu" noise="5e-4" cutoff="34.9"/> <accelerometer name="imu-linear-acceleration" site="imu" noise="1e-2" cutoff="157"/> </sensor>
<!-- setup scene --> <statistic center="1.0 0.7 1.0" extent="0.8"/> <visual> <headlight diffuse="0.6 0.6 0.6" ambient="0.1 0.1 0.1" specular="0.9 0.9 0.9"/> <rgba haze="0.15 0.25 0.35 1"/> <global azimuth="-140" elevation="-20"/> </visual> <asset> <texture type="skybox" builtin="flat" rgb1="0 0 0" rgb2="0 0 0" width="512" height="3072"/> <texture type="2d" name="groundplane" builtin="checker" mark="edge" rgb1="0.2 0.3 0.4" rgb2="0.1 0.2 0.3" markrgb="0.8 0.8 0.8" width="300" height="300"/> <material name="groundplane" texture="groundplane" texuniform="true" texrepeat="5 5" reflectance="0.2"/> </asset> <worldbody> <light pos="1 0 3.5" dir="0 0 -1" directional="true"/> <geom name="floor" size="0 0 0.05" type="plane" material="groundplane"/> </worldbody></mujoco>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521<mujoco model="g1_29dof"> <compiler angle="radian" meshdir="meshes" />
<default> <default class="torso_motor"> <joint damping="0.05" armature="0.01" frictionloss="0.2"/> </default> <default class="leg_motor"> <joint damping="0.05" armature="0.01" frictionloss="0.2"/> </default> <default class="ankle_motor"> <joint damping="0.05" armature="0.01" frictionloss="0.2"/> </default> <default class="arm_motor"> <joint damping="0.05" armature="0.01" frictionloss="0.2"/> </default> <default class="wrist_motor"> <joint damping="0.05" armature="0.01" frictionloss="0.1"/> </default> </default>
<asset> <mesh name="pelvis" file="pelvis.STL" /> <mesh name="pelvis_contour_link" file="pelvis_contour_link.STL" /> <mesh name="left_hip_pitch_link" file="left_hip_pitch_link.STL" /> <mesh name="left_hip_roll_link" file="left_hip_roll_link.STL" /> <mesh name="left_hip_yaw_link" file="left_hip_yaw_link.STL" /> <mesh name="left_knee_link" file="left_knee_link.STL" /> <mesh name="left_ankle_pitch_link" file="left_ankle_pitch_link.STL" /> <mesh name="left_ankle_roll_link" file="left_ankle_roll_link.STL" /> <mesh name="right_hip_pitch_link" file="right_hip_pitch_link.STL" /> <mesh name="right_hip_roll_link" file="right_hip_roll_link.STL" /> <mesh name="right_hip_yaw_link" file="right_hip_yaw_link.STL" /> <mesh name="right_knee_link" file="right_knee_link.STL" /> <mesh name="right_ankle_pitch_link" file="right_ankle_pitch_link.STL" /> <mesh name="right_ankle_roll_link" file="right_ankle_roll_link.STL" /> <mesh name="waist_yaw_link" file="waist_yaw_link.STL" /> <mesh name="waist_roll_link" file="waist_roll_link.STL" /> <mesh name="torso_link" file="torso_link.STL" /> <mesh name="logo_link" file="logo_link.STL" /> <mesh name="head_link" file="head_link.STL" /> <mesh name="waist_support_link" file="waist_support_link.STL" /> <mesh name="left_shoulder_pitch_link" file="left_shoulder_pitch_link.STL" /> <mesh name="left_shoulder_roll_link" file="left_shoulder_roll_link.STL" /> <mesh name="left_shoulder_yaw_link" file="left_shoulder_yaw_link.STL" /> <mesh name="left_elbow_link" file="left_elbow_link.STL" /> <mesh name="left_wrist_roll_link" file="left_wrist_roll_link.STL" /> <mesh name="left_wrist_pitch_link" file="left_wrist_pitch_link.STL" /> <mesh name="left_wrist_yaw_link" file="left_wrist_yaw_link.STL" /> <mesh name="left_rubber_hand" file="left_rubber_hand.STL" /> <mesh name="right_shoulder_pitch_link" file="right_shoulder_pitch_link.STL" /> <mesh name="right_shoulder_roll_link" file="right_shoulder_roll_link.STL" /> <mesh name="right_shoulder_yaw_link" file="right_shoulder_yaw_link.STL" /> <mesh name="right_elbow_link" file="right_elbow_link.STL" /> <mesh name="right_wrist_roll_link" file="right_wrist_roll_link.STL" /> <mesh name="right_wrist_pitch_link" file="right_wrist_pitch_link.STL" /> <mesh name="right_wrist_yaw_link" file="right_wrist_yaw_link.STL" /> <mesh name="right_rubber_hand" file="right_rubber_hand.STL" /> </asset>
<worldbody> <body name="pelvis" pos="0 0 0.793"> <site name="imu" size="0.01" pos="0.0 0.0 0.0" /> <inertial pos="0 0 -0.07605" quat="1 0 -0.000399148 0" mass="3.813" diaginertia="0.010549 0.0093089 0.0079184" /> <joint name="floating_base_joint" type="free" limited="false" actuatorfrclimited="false" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="pelvis" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="pelvis_contour_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="pelvis_contour_link" /> <body name="left_hip_pitch_link" pos="0 0.064452 -0.1027"> <inertial pos="0.002741 0.047791 -0.02606" quat="0.954862 0.293964 0.0302556 0.030122" mass="1.35" diaginertia="0.00181517 0.00153422 0.00116212" /> <joint name="left_hip_pitch_joint" pos="0 0 0" axis="0 1 0" range="-2.5307 2.8798" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="left_hip_pitch_link" /> <geom type="mesh" rgba="0.2 0.2 0.2 1" mesh="left_hip_pitch_link" /> <body name="left_hip_roll_link" pos="0 0.052 -0.030465" quat="0.996179 0 -0.0873386 0"> <inertial pos="0.029812 -0.001045 -0.087934" quat="0.977808 -1.97119e-05 0.205576 -0.0403793" mass="1.52" diaginertia="0.00254986 0.00241169 0.00148755" /> <joint name="left_hip_roll_joint" pos="0 0 0" axis="1 0 0" range="-0.5236 2.9671" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_hip_roll_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_hip_roll_link" /> <body name="left_hip_yaw_link" pos="0.025001 0 -0.12412"> <inertial pos="-0.057709 -0.010981 -0.15078" quat="0.600598 0.15832 0.223482 0.751181" mass="1.702" diaginertia="0.00776166 0.00717575 0.00160139" /> <joint name="left_hip_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.7576 2.7576" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_hip_yaw_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_hip_yaw_link" /> <body name="left_knee_link" pos="-0.078273 0.0021489 -0.17734" quat="0.996179 0 0.0873386 0"> <inertial pos="0.005457 0.003964 -0.12074" quat="0.923418 -0.0327699 0.0158246 0.382067" mass="1.932" diaginertia="0.0113804 0.0112778 0.00146458" /> <joint name="left_knee_joint" pos="0 0 0" axis="0 1 0" range="-0.087267 2.8798" actuatorfrcrange="-139 139" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_knee_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_knee_link" /> <body name="left_ankle_pitch_link" pos="0 -9.4445e-05 -0.30001"> <inertial pos="-0.007269 0 0.011137" quat="0.603053 0.369225 0.369225 0.603053" mass="0.074" diaginertia="1.89e-05 1.40805e-05 6.9195e-06" /> <joint name="left_ankle_pitch_joint" pos="0 0 0" axis="0 1 0" range="-0.87267 0.5236" actuatorfrcrange="-50 50" class="ankle_motor"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_ankle_pitch_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_ankle_pitch_link" /> <body name="left_ankle_roll_link" pos="0 0 -0.017558"> <inertial pos="0.026505 0 -0.016425" quat="-0.000481092 0.728482 -0.000618967 0.685065" mass="0.608" diaginertia="0.00167218 0.0016161 0.000217621" /> <joint name="left_ankle_roll_joint" pos="0 0 0" axis="1 0 0" range="-0.2618 0.2618" actuatorfrcrange="-50 50" class="ankle_motor"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="left_ankle_roll_link" /> <geom size="0.005" pos="-0.05 0.025 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="-0.05 -0.025 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="0.12 0.03 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="0.12 -0.03 -0.03" rgba="0.2 0.2 0.2 1" /> </body> </body> </body> </body> </body> </body> <body name="right_hip_pitch_link" pos="0 -0.064452 -0.1027"> <inertial pos="0.002741 -0.047791 -0.02606" quat="0.954862 -0.293964 0.0302556 -0.030122" mass="1.35" diaginertia="0.00181517 0.00153422 0.00116212" /> <joint name="right_hip_pitch_joint" pos="0 0 0" axis="0 1 0" range="-2.5307 2.8798" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="right_hip_pitch_link" /> <geom type="mesh" rgba="0.2 0.2 0.2 1" mesh="right_hip_pitch_link" /> <body name="right_hip_roll_link" pos="0 -0.052 -0.030465" quat="0.996179 0 -0.0873386 0"> <inertial pos="0.029812 0.001045 -0.087934" quat="0.977808 1.97119e-05 0.205576 0.0403793" mass="1.52" diaginertia="0.00254986 0.00241169 0.00148755" /> <joint name="right_hip_roll_joint" pos="0 0 0" axis="1 0 0" range="-2.9671 0.5236" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_hip_roll_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_hip_roll_link" /> <body name="right_hip_yaw_link" pos="0.025001 0 -0.12412"> <inertial pos="-0.057709 0.010981 -0.15078" quat="0.751181 0.223482 0.15832 0.600598" mass="1.702" diaginertia="0.00776166 0.00717575 0.00160139" /> <joint name="right_hip_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.7576 2.7576" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_hip_yaw_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_hip_yaw_link" /> <body name="right_knee_link" pos="-0.078273 -0.0021489 -0.17734" quat="0.996179 0 0.0873386 0"> <inertial pos="0.005457 -0.003964 -0.12074" quat="0.923439 0.0345276 0.0116333 -0.382012" mass="1.932" diaginertia="0.011374 0.0112843 0.00146452" /> <joint name="right_knee_joint" pos="0 0 0" axis="0 1 0" range="-0.087267 2.8798" actuatorfrcrange="-139 139" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_knee_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_knee_link" /> <body name="right_ankle_pitch_link" pos="0 9.4445e-05 -0.30001"> <inertial pos="-0.007269 0 0.011137" quat="0.603053 0.369225 0.369225 0.603053" mass="0.074" diaginertia="1.89e-05 1.40805e-05 6.9195e-06" /> <joint name="right_ankle_pitch_joint" pos="0 0 0" axis="0 1 0" range="-0.87267 0.5236" actuatorfrcrange="-50 50" class="ankle_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_ankle_pitch_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_ankle_pitch_link" /> <body name="right_ankle_roll_link" pos="0 0 -0.017558"> <inertial pos="0.026505 0 -0.016425" quat="0.000481092 0.728482 0.000618967 0.685065" mass="0.608" diaginertia="0.00167218 0.0016161 0.000217621" /> <joint name="right_ankle_roll_joint" pos="0 0 0" axis="1 0 0" range="-0.2618 0.2618" actuatorfrcrange="-50 50" class="ankle_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="right_ankle_roll_link" /> <geom size="0.005" pos="-0.05 0.025 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="-0.05 -0.025 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="0.12 0.03 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="0.12 -0.03 -0.03" rgba="0.2 0.2 0.2 1" /> </body> </body> </body> </body> </body> </body> <body name="waist_yaw_link"> <inertial pos="0.003964 0 0.018769" quat="-0.0178291 0.628464 0.0282471 0.777121" mass="0.244" diaginertia="0.000158561 0.000124229 9.67669e-05" /> <joint name="waist_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.618 2.618" actuatorfrcrange="-88 88" class="torso_motor"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="waist_yaw_link" /> <body name="waist_roll_link" pos="-0.0039635 0 0.035"> <inertial pos="0 -0.000236 0.010111" quat="0.99979 0.020492 0 0" mass="0.047" diaginertia="7.515e-06 6.40206e-06 3.98394e-06" /> <joint name="waist_roll_joint" pos="0 0 0" axis="1 0 0" range="-0.52 0.52" actuatorfrcrange="-50 50" class="torso_motor"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="waist_roll_link" /> <body name="torso_link" pos="0 0 0.019"> <inertial pos="0.00331658 0.000261533 0.179856" quat="0.999831 0.000376204 0.0179895 -0.00377704" mass="9.598" diaginertia="0.12407 0.111951 0.0325382" /> <joint name="waist_pitch_joint" pos="0 0 0" axis="0 1 0" range="-0.52 0.52" actuatorfrcrange="-50 50" class="torso_motor"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="torso_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="torso_link" /> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="logo_link" /> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" rgba="0.2 0.2 0.2 1" mesh="logo_link" /> <geom pos="0.0039635 0 -0.054" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="head_link" /> <geom pos="0.0039635 0 -0.054" type="mesh" rgba="0.2 0.2 0.2 1" mesh="head_link" /> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="waist_support_link" /> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" rgba="0.7 0.7 0.7 1" mesh="waist_support_link" /> <body name="left_shoulder_pitch_link" pos="0.0039563 0.10022 0.23778" quat="0.990264 0.139201 1.38722e-05 -9.86868e-05"> <inertial pos="0 0.035892 -0.011628" quat="0.654152 0.0130458 -0.326267 0.68225" mass="0.718" diaginertia="0.000465864 0.000432842 0.000406394" /> <joint name="left_shoulder_pitch_joint" pos="0 0 0" axis="0 1 0" range="-3.0892 2.6704" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_shoulder_pitch_link" /> <geom size="0.03 0.025" pos="0 0.04 -0.01" quat="0.707107 0 0.707107 0" type="cylinder" rgba="0.7 0.7 0.7 1" /> <body name="left_shoulder_roll_link" pos="0 0.038 -0.013831" quat="0.990268 -0.139172 0 0"> <inertial pos="-0.000227 0.00727 -0.063243" quat="0.701256 -0.0196223 -0.00710317 0.712604" mass="0.643" diaginertia="0.000691311 0.000618011 0.000388977" /> <joint name="left_shoulder_roll_joint" pos="0 0 0" axis="1 0 0" range="-1.5882 2.2515" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_shoulder_roll_link" /> <geom size="0.03 0.015" pos="-0.004 0.006 -0.053" type="cylinder" rgba="0.7 0.7 0.7 1" /> <body name="left_shoulder_yaw_link" pos="0 0.00624 -0.1032"> <inertial pos="0.010773 -0.002949 -0.072009" quat="0.716879 -0.0964829 -0.0679942 0.687134" mass="0.734" diaginertia="0.00106187 0.00103217 0.000400661" /> <joint name="left_shoulder_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.618 2.618" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_shoulder_yaw_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_shoulder_yaw_link" /> <body name="left_elbow_link" pos="0.015783 0 -0.080518"> <inertial pos="0.064956 0.004454 -0.010062" quat="0.541765 0.636132 0.388821 0.388129" mass="0.6" diaginertia="0.000443035 0.000421612 0.000259353" /> <joint name="left_elbow_joint" pos="0 0 0" axis="0 1 0" range="-1.0472 2.0944" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_elbow_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_elbow_link" /> <body name="left_wrist_roll_link" pos="0.1 0.00188791 -0.01"> <inertial pos="0.0171394 0.000537591 4.8864e-07" quat="0.575338 0.411667 -0.574906 0.411094" mass="0.085445" diaginertia="5.48211e-05 4.96646e-05 3.57798e-05" /> <joint name="left_wrist_roll_joint" pos="0 0 0" axis="1 0 0" range="-1.97222 1.97222" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_wrist_roll_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_wrist_roll_link" /> <body name="left_wrist_pitch_link" pos="0.038 0 0"> <inertial pos="0.0229999 -0.00111685 -0.00111658" quat="0.249998 0.661363 0.293036 0.643608" mass="0.48405" diaginertia="0.000430353 0.000429873 0.000164648" /> <joint name="left_wrist_pitch_joint" pos="0 0 0" axis="0 1 0" range="-1.61443 1.61443" actuatorfrcrange="-5 5" class="wrist_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_wrist_pitch_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_wrist_pitch_link" /> <body name="left_wrist_yaw_link" pos="0.046 0 0"> <inertial pos="0.0708244 0.000191745 0.00161742" quat="0.510571 0.526295 0.468078 0.493188" mass="0.254576" diaginertia="0.000646113 0.000559993 0.000147566" /> <joint name="left_wrist_yaw_joint" pos="0 0 0" axis="0 0 1" range="-1.61443 1.61443" actuatorfrcrange="-5 5" class="wrist_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_wrist_yaw_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_wrist_yaw_link" /> <geom pos="0.0415 0.003 0" quat="1 0 0 0" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_rubber_hand" /> </body> </body> </body> </body> </body> </body> </body> <body name="right_shoulder_pitch_link" pos="0.0039563 -0.10021 0.23778" quat="0.990264 -0.139201 1.38722e-05 9.86868e-05"> <inertial pos="0 -0.035892 -0.011628" quat="0.68225 -0.326267 0.0130458 0.654152" mass="0.718" diaginertia="0.000465864 0.000432842 0.000406394" /> <joint name="right_shoulder_pitch_joint" pos="0 0 0" axis="0 1 0" range="-3.0892 2.6704" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_shoulder_pitch_link" /> <geom size="0.03 0.025" pos="0 -0.04 -0.01" quat="0.707107 0 0.707107 0" type="cylinder" rgba="0.7 0.7 0.7 1" /> <body name="right_shoulder_roll_link" pos="0 -0.038 -0.013831" quat="0.990268 0.139172 0 0"> <inertial pos="-0.000227 -0.00727 -0.063243" quat="0.712604 -0.00710317 -0.0196223 0.701256" mass="0.643" diaginertia="0.000691311 0.000618011 0.000388977" /> <joint name="right_shoulder_roll_joint" pos="0 0 0" axis="1 0 0" range="-2.2515 1.5882" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_shoulder_roll_link" /> <geom size="0.03 0.015" pos="-0.004 -0.006 -0.053" type="cylinder" rgba="0.7 0.7 0.7 1" /> <body name="right_shoulder_yaw_link" pos="0 -0.00624 -0.1032"> <inertial pos="0.010773 0.002949 -0.072009" quat="0.687134 -0.0679942 -0.0964829 0.716879" mass="0.734" diaginertia="0.00106187 0.00103217 0.000400661" /> <joint name="right_shoulder_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.618 2.618" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_shoulder_yaw_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_shoulder_yaw_link" /> <body name="right_elbow_link" pos="0.015783 0 -0.080518"> <inertial pos="0.064956 -0.004454 -0.010062" quat="0.388129 0.388821 0.636132 0.541765" mass="0.6" diaginertia="0.000443035 0.000421612 0.000259353" /> <joint name="right_elbow_joint" pos="0 0 0" axis="0 1 0" range="-1.0472 2.0944" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_elbow_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_elbow_link" /> <body name="right_wrist_roll_link" pos="0.1 -0.00188791 -0.01"> <inertial pos="0.0171394 -0.000537591 4.8864e-07" quat="0.411667 0.575338 -0.411094 0.574906" mass="0.085445" diaginertia="5.48211e-05 4.96646e-05 3.57798e-05" /> <joint name="right_wrist_roll_joint" pos="0 0 0" axis="1 0 0" range="-1.97222 1.97222" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_wrist_roll_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_wrist_roll_link" /> <body name="right_wrist_pitch_link" pos="0.038 0 0"> <inertial pos="0.0229999 0.00111685 -0.00111658" quat="0.643608 0.293036 0.661363 0.249998" mass="0.48405" diaginertia="0.000430353 0.000429873 0.000164648" /> <joint name="right_wrist_pitch_joint" pos="0 0 0" axis="0 1 0" range="-1.61443 1.61443" actuatorfrcrange="-5 5" class="wrist_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_wrist_pitch_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_wrist_pitch_link" /> <body name="right_wrist_yaw_link" pos="0.046 0 0"> <inertial pos="0.0708244 -0.000191745 0.00161742" quat="0.493188 0.468078 0.526295 0.510571" mass="0.254576" diaginertia="0.000646113 0.000559993 0.000147566" /> <joint name="right_wrist_yaw_joint" pos="0 0 0" axis="0 0 1" range="-1.61443 1.61443" actuatorfrcrange="-5 5" class="wrist_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_wrist_yaw_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_wrist_yaw_link" /> <geom pos="0.0415 -0.003 0" quat="1 0 0 0" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_rubber_hand" /> </body> </body> </body> </body> </body> </body> </body> </body> </body> </body> </body> </worldbody>
<actuator> <motor name="left_hip_pitch" joint="left_hip_pitch_joint" ctrlrange="-88 88" /> <motor name="left_hip_roll" joint="left_hip_roll_joint" ctrlrange="-88 88" /> <motor name="left_hip_yaw" joint="left_hip_yaw_joint" ctrlrange="-88 88" /> <motor name="left_knee" joint="left_knee_joint" ctrlrange="-139 139" /> <motor name="left_ankle_pitch" joint="left_ankle_pitch_joint" ctrlrange="-50 50" /> <motor name="left_ankle_roll" joint="left_ankle_roll_joint" ctrlrange="-50 50" />
<motor name="right_hip_pitch" joint="right_hip_pitch_joint" ctrlrange="-88 88" /> <motor name="right_hip_roll" joint="right_hip_roll_joint" ctrlrange="-88 88" /> <motor name="right_hip_yaw" joint="right_hip_yaw_joint" ctrlrange="-88 88" /> <motor name="right_knee" joint="right_knee_joint" ctrlrange="-139 139" /> <motor name="right_ankle_pitch" joint="right_ankle_pitch_joint" ctrlrange="-50 50" /> <motor name="right_ankle_roll" joint="right_ankle_roll_joint" ctrlrange="-50 50" />
<motor name="waist_yaw" joint="waist_yaw_joint" ctrlrange="-88 88" /> <motor name="waist_roll" joint="waist_roll_joint" ctrlrange="-50 50" /> <motor name="waist_pitch" joint="waist_pitch_joint" ctrlrange="-50 50" />
<motor name="left_shoulder_pitch" joint="left_shoulder_pitch_joint" ctrlrange="-25 25" /> <motor name="left_shoulder_roll" joint="left_shoulder_roll_joint" ctrlrange="-25 25" /> <motor name="left_shoulder_yaw" joint="left_shoulder_yaw_joint" ctrlrange="-25 25" /> <motor name="left_elbow" joint="left_elbow_joint" ctrlrange="-25 25" /> <motor name="left_wrist_roll" joint="left_wrist_roll_joint" ctrlrange="-25 25" /> <motor name="left_wrist_pitch" joint="left_wrist_pitch_joint" ctrlrange="-5 5" /> <motor name="left_wrist_yaw" joint="left_wrist_yaw_joint" ctrlrange="-5 5" />
<motor name="right_shoulder_pitch" joint="right_shoulder_pitch_joint" ctrlrange="-25 25" /> <motor name="right_shoulder_roll" joint="right_shoulder_roll_joint" ctrlrange="-25 25" /> <motor name="right_shoulder_yaw" joint="right_shoulder_yaw_joint" ctrlrange="-25 25" /> <motor name="right_elbow" joint="right_elbow_joint" ctrlrange="-25 25" /> <motor name="right_wrist_roll" joint="right_wrist_roll_joint" ctrlrange="-25 25" /> <motor name="right_wrist_pitch" joint="right_wrist_pitch_joint" ctrlrange="-5 5" /> <motor name="right_wrist_yaw" joint="right_wrist_yaw_joint" ctrlrange="-5 5" /> </actuator>
<sensor> <jointpos name="left_hip_pitch_pos" joint="left_hip_pitch_joint" /> <jointpos name="left_hip_roll_pos" joint="left_hip_roll_joint" /> <jointpos name="left_hip_yaw_pos" joint="left_hip_yaw_joint" /> <jointpos name="left_knee_pos" joint="left_knee_joint" /> <jointpos name="left_ankle_pitch_pos" joint="left_ankle_pitch_joint" /> <jointpos name="left_ankle_roll_pos" joint="left_ankle_roll_joint" /> <jointpos name="right_hip_pitch_pos" joint="right_hip_pitch_joint" /> <jointpos name="right_hip_roll_pos" joint="right_hip_roll_joint" /> <jointpos name="right_hip_yaw_pos" joint="right_hip_yaw_joint" /> <jointpos name="right_knee_pos" joint="right_knee_joint" /> <jointpos name="right_ankle_pitch_pos" joint="right_ankle_pitch_joint" /> <jointpos name="right_ankle_roll_pos" joint="right_ankle_roll_joint" /> <jointpos name="waist_yaw_pos" joint="waist_yaw_joint" /> <jointpos name="waist_roll_pos" joint="waist_roll_joint" /> <jointpos name="waist_pitch_pos" joint="waist_pitch_joint" /> <jointpos name="left_shoulder_pitch_pos" joint="left_shoulder_pitch_joint" /> <jointpos name="left_shoulder_roll_pos" joint="left_shoulder_roll_joint" /> <jointpos name="left_shoulder_yaw_pos" joint="left_shoulder_yaw_joint" /> <jointpos name="left_elbow_pos" joint="left_elbow_joint" /> <jointpos name="left_wrist_roll_pos" joint="left_wrist_roll_joint" /> <jointpos name="left_wrist_pitch_pos" joint="left_wrist_pitch_joint" /> <jointpos name="left_wrist_yaw_pos" joint="left_wrist_yaw_joint" /> <jointpos name="right_shoulder_pitch_pos" joint="right_shoulder_pitch_joint" /> <jointpos name="right_shoulder_roll_pos" joint="right_shoulder_roll_joint" /> <jointpos name="right_shoulder_yaw_pos" joint="right_shoulder_yaw_joint" /> <jointpos name="right_elbow_pos" joint="right_elbow_joint" /> <jointpos name="right_wrist_roll_pos" joint="right_wrist_roll_joint" /> <jointpos name="right_wrist_pitch_pos" joint="right_wrist_pitch_joint" /> <jointpos name="right_wrist_yaw_pos" joint="right_wrist_yaw_joint" />
<jointvel name="left_hip_pitch_vel" joint="left_hip_pitch_joint" /> <jointvel name="left_hip_roll_vel" joint="left_hip_roll_joint" /> <jointvel name="left_hip_yaw_vel" joint="left_hip_yaw_joint" /> <jointvel name="left_knee_vel" joint="left_knee_joint" /> <jointvel name="left_ankle_pitch_vel" joint="left_ankle_pitch_joint" /> <jointvel name="left_ankle_roll_vel" joint="left_ankle_roll_joint" /> <jointvel name="right_hip_pitch_vel" joint="right_hip_pitch_joint" /> <jointvel name="right_hip_roll_vel" joint="right_hip_roll_joint" /> <jointvel name="right_hip_yaw_vel" joint="right_hip_yaw_joint" /> <jointvel name="right_knee_vel" joint="right_knee_joint" /> <jointvel name="right_ankle_pitch_vel" joint="right_ankle_pitch_joint" /> <jointvel name="right_ankle_roll_vel" joint="right_ankle_roll_joint" /> <jointvel name="waist_yaw_vel" joint="waist_yaw_joint" /> <jointvel name="waist_roll_vel" joint="waist_roll_joint" /> <jointvel name="waist_pitch_vel" joint="waist_pitch_joint" /> <jointvel name="left_shoulder_pitch_vel" joint="left_shoulder_pitch_joint" /> <jointvel name="left_shoulder_roll_vel" joint="left_shoulder_roll_joint" /> <jointvel name="left_shoulder_yaw_vel" joint="left_shoulder_yaw_joint" /> <jointvel name="left_elbow_vel" joint="left_elbow_joint" /> <jointvel name="left_wrist_roll_vel" joint="left_wrist_roll_joint" /> <jointvel name="left_wrist_pitch_vel" joint="left_wrist_pitch_joint" /> <jointvel name="left_wrist_yaw_vel" joint="left_wrist_yaw_joint" /> <jointvel name="right_shoulder_pitch_vel" joint="right_shoulder_pitch_joint" /> <jointvel name="right_shoulder_roll_vel" joint="right_shoulder_roll_joint" /> <jointvel name="right_shoulder_yaw_vel" joint="right_shoulder_yaw_joint" /> <jointvel name="right_elbow_vel" joint="right_elbow_joint" /> <jointvel name="right_wrist_roll_vel" joint="right_wrist_roll_joint" /> <jointvel name="right_wrist_pitch_vel" joint="right_wrist_pitch_joint" /> <jointvel name="right_wrist_yaw_vel" joint="right_wrist_yaw_joint" />
<jointactuatorfrc name="left_hip_pitch_torque" joint="left_hip_pitch_joint" /> <jointactuatorfrc name="left_hip_roll_torque" joint="left_hip_roll_joint" /> <jointactuatorfrc name="left_hip_yaw_torque" joint="left_hip_yaw_joint" /> <jointactuatorfrc name="left_knee_torque" joint="left_knee_joint" /> <jointactuatorfrc name="left_ankle_pitch_torque" joint="left_ankle_pitch_joint" /> <jointactuatorfrc name="left_ankle_roll_torque" joint="left_ankle_roll_joint" /> <jointactuatorfrc name="right_hip_pitch_torque" joint="right_hip_pitch_joint" /> <jointactuatorfrc name="right_hip_roll_torque" joint="right_hip_roll_joint" /> <jointactuatorfrc name="right_hip_yaw_torque" joint="right_hip_yaw_joint" /> <jointactuatorfrc name="right_knee_torque" joint="right_knee_joint" /> <jointactuatorfrc name="right_ankle_pitch_torque" joint="right_ankle_pitch_joint" /> <jointactuatorfrc name="right_ankle_roll_torque" joint="right_ankle_roll_joint" /> <jointactuatorfrc name="waist_yaw_torque" joint="waist_yaw_joint" /> <jointactuatorfrc name="waist_roll_torque" joint="waist_roll_joint" /> <jointactuatorfrc name="waist_pitch_torque" joint="waist_pitch_joint" /> <jointactuatorfrc name="left_shoulder_pitch_torque" joint="left_shoulder_pitch_joint" /> <jointactuatorfrc name="left_shoulder_roll_torque" joint="left_shoulder_roll_joint" /> <jointactuatorfrc name="left_shoulder_yaw_torque" joint="left_shoulder_yaw_joint" /> <jointactuatorfrc name="left_elbow_torque" joint="left_elbow_joint" /> <jointactuatorfrc name="left_wrist_roll_torque" joint="left_wrist_roll_joint" /> <jointactuatorfrc name="left_wrist_pitch_torque" joint="left_wrist_pitch_joint" /> <jointactuatorfrc name="left_wrist_yaw_torque" joint="left_wrist_yaw_joint" /> <jointactuatorfrc name="right_shoulder_pitch_torque" joint="right_shoulder_pitch_joint" /> <jointactuatorfrc name="right_shoulder_roll_torque" joint="right_shoulder_roll_joint" /> <jointactuatorfrc name="right_shoulder_yaw_torque" joint="right_shoulder_yaw_joint" /> <jointactuatorfrc name="right_elbow_torque" joint="right_elbow_joint" /> <jointactuatorfrc name="right_wrist_roll_torque" joint="right_wrist_roll_joint" /> <jointactuatorfrc name="right_wrist_pitch_torque" joint="right_wrist_pitch_joint" /> <jointactuatorfrc name="right_wrist_yaw_torque" joint="right_wrist_yaw_joint" />
<framequat name="imu_quat" objtype="site" objname="imu" /> <gyro name="imu_gyro" site="imu" /> <accelerometer name="imu_acc" site="imu" />
<framepos name="frame_pos" objtype="site" objname="imu" /> <framelinvel name="frame_vel" objtype="site" objname="imu" /> </sensor>
</mujoco>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743<mujoco model="g1_29dof_with_hand"> <compiler angle="radian" meshdir="meshes" />
<default> <default class="torso_motor"> <joint damping="0.05" armature="0.01" frictionloss="0.2"/> </default> <default class="leg_motor"> <joint damping="0.05" armature="0.01" frictionloss="0.2"/> </default> <default class="ankle_motor"> <joint damping="0.05" armature="0.01" frictionloss="0.2"/> </default> <default class="arm_motor"> <joint damping="0.05" armature="0.01" frictionloss="0.2"/> </default> <default class="wrist_motor"> <joint damping="0.05" armature="0.01" frictionloss="0.1"/> </default> <default class="hand_motor"> <joint damping="0.01" armature="0.01" frictionloss="0.1"/> </default> </default> <asset> <mesh name="pelvis" file="pelvis.STL" /> <mesh name="pelvis_contour_link" file="pelvis_contour_link.STL" /> <mesh name="left_hip_pitch_link" file="left_hip_pitch_link.STL" /> <mesh name="left_hip_roll_link" file="left_hip_roll_link.STL" /> <mesh name="left_hip_yaw_link" file="left_hip_yaw_link.STL" /> <mesh name="left_knee_link" file="left_knee_link.STL" /> <mesh name="left_ankle_pitch_link" file="left_ankle_pitch_link.STL" /> <mesh name="left_ankle_roll_link" file="left_ankle_roll_link.STL" /> <mesh name="right_hip_pitch_link" file="right_hip_pitch_link.STL" /> <mesh name="right_hip_roll_link" file="right_hip_roll_link.STL" /> <mesh name="right_hip_yaw_link" file="right_hip_yaw_link.STL" /> <mesh name="right_knee_link" file="right_knee_link.STL" /> <mesh name="right_ankle_pitch_link" file="right_ankle_pitch_link.STL" /> <mesh name="right_ankle_roll_link" file="right_ankle_roll_link.STL" /> <mesh name="waist_yaw_link" file="waist_yaw_link.STL" /> <mesh name="waist_roll_link" file="waist_roll_link.STL" /> <mesh name="torso_link" file="torso_link.STL" /> <mesh name="logo_link" file="logo_link.STL" /> <mesh name="head_link" file="head_link.STL" /> <mesh name="waist_support_link" file="waist_support_link.STL" /> <mesh name="left_shoulder_pitch_link" file="left_shoulder_pitch_link.STL" /> <mesh name="left_shoulder_roll_link" file="left_shoulder_roll_link.STL" /> <mesh name="left_shoulder_yaw_link" file="left_shoulder_yaw_link.STL" /> <mesh name="left_elbow_link" file="left_elbow_link.STL" /> <mesh name="left_wrist_roll_link" file="left_wrist_roll_link.STL" /> <mesh name="left_wrist_pitch_link" file="left_wrist_pitch_link.STL" /> <mesh name="left_wrist_yaw_link" file="left_wrist_yaw_link.STL" /> <mesh name="left_hand_palm_link" file="left_hand_palm_link.STL" /> <mesh name="left_hand_thumb_0_link" file="left_hand_thumb_0_link.STL" /> <mesh name="left_hand_thumb_1_link" file="left_hand_thumb_1_link.STL" /> <mesh name="left_hand_thumb_2_link" file="left_hand_thumb_2_link.STL" /> <mesh name="left_hand_middle_0_link" file="left_hand_middle_0_link.STL" /> <mesh name="left_hand_middle_1_link" file="left_hand_middle_1_link.STL" /> <mesh name="left_hand_index_0_link" file="left_hand_index_0_link.STL" /> <mesh name="left_hand_index_1_link" file="left_hand_index_1_link.STL" /> <mesh name="right_shoulder_pitch_link" file="right_shoulder_pitch_link.STL" /> <mesh name="right_shoulder_roll_link" file="right_shoulder_roll_link.STL" /> <mesh name="right_shoulder_yaw_link" file="right_shoulder_yaw_link.STL" /> <mesh name="right_elbow_link" file="right_elbow_link.STL" /> <mesh name="right_wrist_roll_link" file="right_wrist_roll_link.STL" /> <mesh name="right_wrist_pitch_link" file="right_wrist_pitch_link.STL" /> <mesh name="right_wrist_yaw_link" file="right_wrist_yaw_link.STL" /> <mesh name="right_hand_palm_link" file="right_hand_palm_link.STL" /> <mesh name="right_hand_thumb_0_link" file="right_hand_thumb_0_link.STL" /> <mesh name="right_hand_thumb_1_link" file="right_hand_thumb_1_link.STL" /> <mesh name="right_hand_thumb_2_link" file="right_hand_thumb_2_link.STL" /> <mesh name="right_hand_index_0_link" file="right_hand_index_0_link.STL" /> <mesh name="right_hand_index_1_link" file="right_hand_index_1_link.STL" /> <mesh name="right_hand_middle_0_link" file="right_hand_middle_0_link.STL" /> <mesh name="right_hand_middle_1_link" file="right_hand_middle_1_link.STL" /> </asset>
<worldbody> <body name="pelvis" pos="0 0 0.793"> <site name="imu" size="0.01" pos="-0.03959 -0.00224 0.13792" /> <inertial pos="0 0 -0.07605" quat="1 0 -0.000399148 0" mass="3.813" diaginertia="0.010549 0.0093089 0.0079184" /> <joint name="floating_base_joint" type="free" limited="false" actuatorfrclimited="false" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="pelvis" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="pelvis_contour_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="pelvis_contour_link" /> <body name="left_hip_pitch_link" pos="0 0.064452 -0.1027"> <inertial pos="0.002741 0.047791 -0.02606" quat="0.954862 0.293964 0.0302556 0.030122" mass="1.35" diaginertia="0.00181517 0.00153422 0.00116212" /> <joint name="left_hip_pitch_joint" pos="0 0 0" axis="0 1 0" range="-2.5307 2.8798" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="left_hip_pitch_link" /> <geom type="mesh" rgba="0.2 0.2 0.2 1" mesh="left_hip_pitch_link" /> <body name="left_hip_roll_link" pos="0 0.052 -0.030465" quat="0.996179 0 -0.0873386 0"> <inertial pos="0.029812 -0.001045 -0.087934" quat="0.977808 -1.97119e-05 0.205576 -0.0403793" mass="1.52" diaginertia="0.00254986 0.00241169 0.00148755" /> <joint name="left_hip_roll_joint" pos="0 0 0" axis="1 0 0" range="-0.5236 2.9671" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_hip_roll_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_hip_roll_link" /> <body name="left_hip_yaw_link" pos="0.025001 0 -0.12412"> <inertial pos="-0.057709 -0.010981 -0.15078" quat="0.600598 0.15832 0.223482 0.751181" mass="1.702" diaginertia="0.00776166 0.00717575 0.00160139" /> <joint name="left_hip_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.7576 2.7576" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_hip_yaw_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_hip_yaw_link" /> <body name="left_knee_link" pos="-0.078273 0.0021489 -0.17734" quat="0.996179 0 0.0873386 0"> <inertial pos="0.005457 0.003964 -0.12074" quat="0.923418 -0.0327699 0.0158246 0.382067" mass="1.932" diaginertia="0.0113804 0.0112778 0.00146458" /> <joint name="left_knee_joint" pos="0 0 0" axis="0 1 0" range="-0.087267 2.8798" actuatorfrcrange="-139 139" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_knee_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_knee_link" /> <body name="left_ankle_pitch_link" pos="0 -9.4445e-05 -0.30001"> <inertial pos="-0.007269 0 0.011137" quat="0.603053 0.369225 0.369225 0.603053" mass="0.074" diaginertia="1.89e-05 1.40805e-05 6.9195e-06" /> <joint name="left_ankle_pitch_joint" pos="0 0 0" axis="0 1 0" range="-0.87267 0.5236" actuatorfrcrange="-50 50" class="ankle_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_ankle_pitch_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_ankle_pitch_link" /> <body name="left_ankle_roll_link" pos="0 0 -0.017558"> <inertial pos="0.026505 0 -0.016425" quat="-0.000481092 0.728482 -0.000618967 0.685065" mass="0.608" diaginertia="0.00167218 0.0016161 0.000217621" /> <joint name="left_ankle_roll_joint" pos="0 0 0" axis="1 0 0" range="-0.2618 0.2618" actuatorfrcrange="-50 50" class="ankle_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="left_ankle_roll_link" /> <geom size="0.005" pos="-0.05 0.025 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="-0.05 -0.025 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="0.12 0.03 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="0.12 -0.03 -0.03" rgba="0.2 0.2 0.2 1" /> </body> </body> </body> </body> </body> </body> <body name="right_hip_pitch_link" pos="0 -0.064452 -0.1027"> <inertial pos="0.002741 -0.047791 -0.02606" quat="0.954862 -0.293964 0.0302556 -0.030122" mass="1.35" diaginertia="0.00181517 0.00153422 0.00116212" /> <joint name="right_hip_pitch_joint" pos="0 0 0" axis="0 1 0" range="-2.5307 2.8798" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="right_hip_pitch_link" /> <geom type="mesh" rgba="0.2 0.2 0.2 1" mesh="right_hip_pitch_link" /> <body name="right_hip_roll_link" pos="0 -0.052 -0.030465" quat="0.996179 0 -0.0873386 0"> <inertial pos="0.029812 0.001045 -0.087934" quat="0.977808 1.97119e-05 0.205576 0.0403793" mass="1.52" diaginertia="0.00254986 0.00241169 0.00148755" /> <joint name="right_hip_roll_joint" pos="0 0 0" axis="1 0 0" range="-2.9671 0.5236" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_hip_roll_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_hip_roll_link" /> <body name="right_hip_yaw_link" pos="0.025001 0 -0.12412"> <inertial pos="-0.057709 0.010981 -0.15078" quat="0.751181 0.223482 0.15832 0.600598" mass="1.702" diaginertia="0.00776166 0.00717575 0.00160139" /> <joint name="right_hip_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.7576 2.7576" actuatorfrcrange="-88 88" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_hip_yaw_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_hip_yaw_link" /> <body name="right_knee_link" pos="-0.078273 -0.0021489 -0.17734" quat="0.996179 0 0.0873386 0"> <inertial pos="0.005457 -0.003964 -0.12074" quat="0.923439 0.0345276 0.0116333 -0.382012" mass="1.932" diaginertia="0.011374 0.0112843 0.00146452" /> <joint name="right_knee_joint" pos="0 0 0" axis="0 1 0" range="-0.087267 2.8798" actuatorfrcrange="-139 139" class="leg_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_knee_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_knee_link" /> <body name="right_ankle_pitch_link" pos="0 9.4445e-05 -0.30001"> <inertial pos="-0.007269 0 0.011137" quat="0.603053 0.369225 0.369225 0.603053" mass="0.074" diaginertia="1.89e-05 1.40805e-05 6.9195e-06" /> <joint name="right_ankle_pitch_joint" pos="0 0 0" axis="0 1 0" range="-0.87267 0.5236" actuatorfrcrange="-50 50" class="ankle_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_ankle_pitch_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_ankle_pitch_link" /> <body name="right_ankle_roll_link" pos="0 0 -0.017558"> <inertial pos="0.026505 0 -0.016425" quat="0.000481092 0.728482 0.000618967 0.685065" mass="0.608" diaginertia="0.00167218 0.0016161 0.000217621" /> <joint name="right_ankle_roll_joint" pos="0 0 0" axis="1 0 0" range="-0.2618 0.2618" actuatorfrcrange="-50 50" class="ankle_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="right_ankle_roll_link" /> <geom size="0.005" pos="-0.05 0.025 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="-0.05 -0.025 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="0.12 0.03 -0.03" rgba="0.2 0.2 0.2 1" /> <geom size="0.005" pos="0.12 -0.03 -0.03" rgba="0.2 0.2 0.2 1" /> </body> </body> </body> </body> </body> </body> <body name="waist_yaw_link"> <inertial pos="0.003964 0 0.018769" quat="-0.0178291 0.628464 0.0282471 0.777121" mass="0.244" diaginertia="0.000158561 0.000124229 9.67669e-05" /> <joint name="waist_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.618 2.618" actuatorfrcrange="-88 88" class="torso_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="waist_yaw_link" /> <body name="waist_roll_link" pos="-0.0039635 0 0.035"> <inertial pos="0 -0.000236 0.010111" quat="0.99979 0.020492 0 0" mass="0.047" diaginertia="7.515e-06 6.40206e-06 3.98394e-06" /> <joint name="waist_roll_joint" pos="0 0 0" axis="1 0 0" range="-0.52 0.52" actuatorfrcrange="-50 50" class="torso_motor"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="waist_roll_link" /> <body name="torso_link" pos="0 0 0.019"> <inertial pos="0.00331658 0.000261533 0.179856" quat="0.999831 0.000376204 0.0179895 -0.00377704" mass="9.598" diaginertia="0.12407 0.111951 0.0325382" /> <joint name="waist_pitch_joint" pos="0 0 0" axis="0 1 0" range="-0.52 0.52" actuatorfrcrange="-50 50" class="torso_motor"/> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="torso_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="torso_link" /> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="logo_link" /> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" rgba="0.2 0.2 0.2 1" mesh="logo_link" /> <geom pos="0.0039635 0 -0.054" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.2 0.2 0.2 1" mesh="head_link" /> <geom pos="0.0039635 0 -0.054" type="mesh" rgba="0.2 0.2 0.2 1" mesh="head_link" /> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="waist_support_link" /> <geom pos="0.0039635 0 -0.054" quat="1 0 0 0" type="mesh" rgba="0.7 0.7 0.7 1" mesh="waist_support_link" /> <body name="left_shoulder_pitch_link" pos="0.0039563 0.10022 0.23778" quat="0.990264 0.139201 1.38722e-05 -9.86868e-05"> <inertial pos="0 0.035892 -0.011628" quat="0.654152 0.0130458 -0.326267 0.68225" mass="0.718" diaginertia="0.000465864 0.000432842 0.000406394" /> <joint name="left_shoulder_pitch_joint" pos="0 0 0" axis="0 1 0" range="-3.0892 2.6704" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_shoulder_pitch_link" /> <geom size="0.03 0.025" pos="0 0.04 -0.01" quat="0.707107 0 0.707107 0" type="cylinder" rgba="0.7 0.7 0.7 1" /> <body name="left_shoulder_roll_link" pos="0 0.038 -0.013831" quat="0.990268 -0.139172 0 0"> <inertial pos="-0.000227 0.00727 -0.063243" quat="0.701256 -0.0196223 -0.00710317 0.712604" mass="0.643" diaginertia="0.000691311 0.000618011 0.000388977" /> <joint name="left_shoulder_roll_joint" pos="0 0 0" axis="1 0 0" range="-1.5882 2.2515" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_shoulder_roll_link" /> <geom size="0.03 0.015" pos="-0.004 0.006 -0.053" type="cylinder" rgba="0.7 0.7 0.7 1" /> <body name="left_shoulder_yaw_link" pos="0 0.00624 -0.1032"> <inertial pos="0.010773 -0.002949 -0.072009" quat="0.716879 -0.0964829 -0.0679942 0.687134" mass="0.734" diaginertia="0.00106187 0.00103217 0.000400661" /> <joint name="left_shoulder_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.618 2.618" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_shoulder_yaw_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_shoulder_yaw_link" /> <body name="left_elbow_link" pos="0.015783 0 -0.080518"> <inertial pos="0.064956 0.004454 -0.010062" quat="0.541765 0.636132 0.388821 0.388129" mass="0.6" diaginertia="0.000443035 0.000421612 0.000259353" /> <joint name="left_elbow_joint" pos="0 0 0" axis="0 1 0" range="-1.0472 2.0944" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_elbow_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_elbow_link" /> <body name="left_wrist_roll_link" pos="0.1 0.00188791 -0.01"> <inertial pos="0.0171394 0.000537591 4.8864e-07" quat="0.575338 0.411667 -0.574906 0.411094" mass="0.085445" diaginertia="5.48211e-05 4.96646e-05 3.57798e-05" /> <joint name="left_wrist_roll_joint" pos="0 0 0" axis="1 0 0" range="-1.97222 1.97222" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_wrist_roll_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_wrist_roll_link" /> <body name="left_wrist_pitch_link" pos="0.038 0 0"> <inertial pos="0.0229999 -0.00111685 -0.00111658" quat="0.249998 0.661363 0.293036 0.643608" mass="0.48405" diaginertia="0.000430353 0.000429873 0.000164648" /> <joint name="left_wrist_pitch_joint" pos="0 0 0" axis="0 1 0" range="-1.61443 1.61443" actuatorfrcrange="-5 5" class="wrist_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_wrist_pitch_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_wrist_pitch_link" /> <body name="left_wrist_yaw_link" pos="0.046 0 0"> <inertial pos="0.0885506 0.00212216 -0.000374562" quat="0.487149 0.493844 0.513241 0.505358" mass="0.457415" diaginertia="0.00105989 0.000895419 0.000323842" /> <joint name="left_wrist_yaw_joint" pos="0 0 0" axis="0 0 1" range="-1.61443 1.61443" actuatorfrcrange="-5 5" class="wrist_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_wrist_yaw_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_wrist_yaw_link" /> <geom pos="0.0415 0.003 0" quat="1 0 0 0" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_hand_palm_link" /> <geom pos="0.0415 0.003 0" quat="1 0 0 0" type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_hand_palm_link" /> <body name="left_hand_thumb_0_link" pos="0.0695 0.003 0"> <inertial pos="-0.000354413 -0.0132989 0.000412362" quat="0.385163 0.591021 -0.567321 0.424842" mass="0.0803302" diaginertia="1.39245e-05 1.32309e-05 1.19138e-05" /> <joint name="left_hand_thumb_0_joint" pos="0 0 0" axis="0 1 0" range="-1.0472 1.0472" actuatorfrcrange="-2.45 2.45" class="hand_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_hand_thumb_0_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_hand_thumb_0_link" /> <body name="left_hand_thumb_1_link" pos="0 -0.0246 0"> <inertial pos="0.0036206 -0.040444 -0.000297711" quat="0.696371 0.699653 0.125539 -0.0989605" mass="0.0561963" diaginertia="1.23865e-05 1.2092e-05 5.00561e-06" /> <joint name="left_hand_thumb_1_joint" pos="0 0 0" axis="0 0 1" range="-0.724312 1.0472" actuatorfrcrange="-0.7 0.7" class="hand_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_hand_thumb_1_link" /> <geom size="0.01 0.015 0.01" pos="-0.001 -0.032 0" type="box" rgba="0.7 0.7 0.7 1" /> <body name="left_hand_thumb_2_link" pos="0.0055 -0.0528 0"> <inertial pos="-0.00081406 -0.0345621 0.000129799" quat="0.701976 0.711984 0.0160342 0.00721768" mass="0.0248731" diaginertia="8.60616e-06 7.69097e-06 1.98043e-06" /> <joint name="left_hand_thumb_2_joint" pos="0 0 0" axis="0 0 1" range="0 2.0944" actuatorfrcrange="-0.7 0.7" class="hand_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_hand_thumb_2_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_hand_thumb_2_link" /> </body> </body> </body> <body name="left_hand_middle_0_link" pos="0.1415 0.0013 -0.0285"> <inertial pos="0.040444 -0.0036206 0.000287711" quat="0.583499 0.422433 0.562384 0.40596" mass="0.0561963" diaginertia="1.23865e-05 1.2092e-05 5.00561e-06" /> <joint name="left_hand_middle_0_joint" pos="0 0 0" axis="0 0 1" range="-1.8326 0.191986" actuatorfrcrange="-0.7 0.7" class="hand_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_hand_middle_0_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_hand_middle_0_link" /> <body name="left_hand_middle_1_link" pos="0.0528 -0.0055 0"> <inertial pos="0.0345621 0.00081406 -0.000129799" quat="0.514787 0.501475 0.491268 0.492111" mass="0.0248731" diaginertia="8.60616e-06 7.69097e-06 1.98043e-06" /> <joint name="left_hand_middle_1_joint" pos="0 0 0" axis="0 0 1" range="-2.0944 0" actuatorfrcrange="-0.7 0.7" class="hand_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_hand_middle_1_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_hand_middle_1_link" /> </body> </body> <body name="left_hand_index_0_link" pos="0.1415 0.0013 0.0285"> <inertial pos="0.040444 -0.0036206 0.000287711" quat="0.583499 0.422433 0.562384 0.40596" mass="0.0561963" diaginertia="1.23865e-05 1.2092e-05 5.00561e-06" /> <joint name="left_hand_index_0_joint" pos="0 0 0" axis="0 0 1" range="-1.8326 0.191986" actuatorfrcrange="-0.7 0.7" class="hand_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_hand_index_0_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_hand_index_0_link" /> <body name="left_hand_index_1_link" pos="0.0528 -0.0055 0"> <inertial pos="0.0345621 0.00081406 -0.000129799" quat="0.514787 0.501475 0.491268 0.492111" mass="0.0248731" diaginertia="8.60616e-06 7.69097e-06 1.98043e-06" /> <joint name="left_hand_index_1_joint" pos="0 0 0" axis="0 0 1" range="-2.0944 0" actuatorfrcrange="-0.7 0.7" class="hand_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="left_hand_index_1_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="left_hand_index_1_link" /> </body> </body> </body> </body> </body> </body> </body> </body> </body> <body name="right_shoulder_pitch_link" pos="0.0039563 -0.10021 0.23778" quat="0.990264 -0.139201 1.38722e-05 9.86868e-05"> <inertial pos="0 -0.035892 -0.011628" quat="0.68225 -0.326267 0.0130458 0.654152" mass="0.718" diaginertia="0.000465864 0.000432842 0.000406394" /> <joint name="right_shoulder_pitch_joint" pos="0 0 0" axis="0 1 0" range="-3.0892 2.6704" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_shoulder_pitch_link" /> <geom size="0.03 0.025" pos="0 -0.04 -0.01" quat="0.707107 0 0.707107 0" type="cylinder" rgba="0.7 0.7 0.7 1" /> <body name="right_shoulder_roll_link" pos="0 -0.038 -0.013831" quat="0.990268 0.139172 0 0"> <inertial pos="-0.000227 -0.00727 -0.063243" quat="0.712604 -0.00710317 -0.0196223 0.701256" mass="0.643" diaginertia="0.000691311 0.000618011 0.000388977" /> <joint name="right_shoulder_roll_joint" pos="0 0 0" axis="1 0 0" range="-2.2515 1.5882" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_shoulder_roll_link" /> <geom size="0.03 0.015" pos="-0.004 -0.006 -0.053" type="cylinder" rgba="0.7 0.7 0.7 1" /> <body name="right_shoulder_yaw_link" pos="0 -0.00624 -0.1032"> <inertial pos="0.010773 0.002949 -0.072009" quat="0.687134 -0.0679942 -0.0964829 0.716879" mass="0.734" diaginertia="0.00106187 0.00103217 0.000400661" /> <joint name="right_shoulder_yaw_joint" pos="0 0 0" axis="0 0 1" range="-2.618 2.618" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_shoulder_yaw_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_shoulder_yaw_link" /> <body name="right_elbow_link" pos="0.015783 0 -0.080518"> <inertial pos="0.064956 -0.004454 -0.010062" quat="0.388129 0.388821 0.636132 0.541765" mass="0.6" diaginertia="0.000443035 0.000421612 0.000259353" /> <joint name="right_elbow_joint" pos="0 0 0" axis="0 1 0" range="-1.0472 2.0944" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_elbow_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_elbow_link" /> <body name="right_wrist_roll_link" pos="0.1 -0.00188791 -0.01"> <inertial pos="0.0171394 -0.000537591 4.8864e-07" quat="0.411667 0.575338 -0.411094 0.574906" mass="0.085445" diaginertia="5.48211e-05 4.96646e-05 3.57798e-05" /> <joint name="right_wrist_roll_joint" pos="0 0 0" axis="1 0 0" range="-1.97222 1.97222" actuatorfrcrange="-25 25" class="arm_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_wrist_roll_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_wrist_roll_link" /> <body name="right_wrist_pitch_link" pos="0.038 0 0"> <inertial pos="0.0229999 0.00111685 -0.00111658" quat="0.643608 0.293036 0.661363 0.249998" mass="0.48405" diaginertia="0.000430353 0.000429873 0.000164648" /> <joint name="right_wrist_pitch_joint" pos="0 0 0" axis="0 1 0" range="-1.61443 1.61443" actuatorfrcrange="-5 5" class="wrist_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_wrist_pitch_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_wrist_pitch_link" /> <body name="right_wrist_yaw_link" pos="0.046 0 0"> <inertial pos="0.0885506 -0.00212216 0.000573742" quat="0.507224 0.511377 0.494292 0.486717" mass="0.457415" diaginertia="0.0010598 0.000895373 0.0003238" /> <joint name="right_wrist_yaw_joint" pos="0 0 0" axis="0 0 1" range="-1.61443 1.61443" actuatorfrcrange="-5 5" class="wrist_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_wrist_yaw_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_wrist_yaw_link" /> <geom pos="0.0415 -0.003 0" quat="1 0 0 0" type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_hand_palm_link" /> <geom pos="0.0415 -0.003 0" quat="1 0 0 0" type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_hand_palm_link" /> <body name="right_hand_thumb_0_link" pos="0.0695 -0.003 0"> <inertial pos="-0.000354413 0.0132989 -0.000412362" quat="0.424842 0.567321 -0.591021 0.385163" mass="0.0803302" diaginertia="1.39245e-05 1.32309e-05 1.19138e-05" /> <joint name="right_hand_thumb_0_joint" pos="0 0 0" axis="0 1 0" range="-1.0472 1.0472" actuatorfrcrange="-2.45 2.45" class="hand_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_hand_thumb_0_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_hand_thumb_0_link" /> <body name="right_hand_thumb_1_link" pos="0 0.0246 0"> <inertial pos="0.0036206 0.040444 0.000297711" quat="0.696371 0.699653 -0.125539 0.0989605" mass="0.0561963" diaginertia="1.23865e-05 1.2092e-05 5.00561e-06" /> <joint name="right_hand_thumb_1_joint" pos="0 0 0" axis="0 0 1" range="-1.0472 0.724312" actuatorfrcrange="-0.7 0.7" class="hand_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_hand_thumb_1_link" /> <geom size="0.01 0.015 0.01" pos="-0.001 0.032 0" type="box" rgba="0.7 0.7 0.7 1" /> <body name="right_hand_thumb_2_link" pos="0.0055 0.0528 0"> <inertial pos="-0.00081406 0.0345621 -0.000129799" quat="0.701976 0.711984 -0.0160342 -0.00721768" mass="0.0248731" diaginertia="8.60616e-06 7.69097e-06 1.98043e-06" /> <joint name="right_hand_thumb_2_joint" pos="0 0 0" axis="0 0 1" range="-2.0944 0" actuatorfrcrange="-0.7 0.7" class="hand_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_hand_thumb_2_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_hand_thumb_2_link" /> </body> </body> </body> <body name="right_hand_index_0_link" pos="0.1415 -0.0013 0.0285"> <inertial pos="0.040444 0.0036206 -0.000287711" quat="0.562384 0.40596 0.583499 0.422433" mass="0.0561963" diaginertia="1.23865e-05 1.2092e-05 5.00561e-06" /> <joint name="right_hand_index_0_joint" pos="0 0 0" axis="0 0 1" range="-0.191986 1.8326" actuatorfrcrange="-0.7 0.7" class="hand_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_hand_index_0_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_hand_index_0_link" /> <body name="right_hand_index_1_link" pos="0.0528 0.0055 0"> <inertial pos="0.0345621 -0.00081406 0.000129799" quat="0.491268 0.492111 0.514787 0.501475" mass="0.0248731" diaginertia="8.60616e-06 7.69097e-06 1.98043e-06" /> <joint name="right_hand_index_1_joint" pos="0 0 0" axis="0 0 1" range="0 2.0944" actuatorfrcrange="-0.7 0.7" class="hand_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_hand_index_1_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_hand_index_1_link" /> </body> </body> <body name="right_hand_middle_0_link" pos="0.1415 -0.0013 -0.0285"> <inertial pos="0.040444 0.0036206 -0.000287711" quat="0.562384 0.40596 0.583499 0.422433" mass="0.0561963" diaginertia="1.23865e-05 1.2092e-05 5.00561e-06" /> <joint name="right_hand_middle_0_joint" pos="0 0 0" axis="0 0 1" range="-0.191986 1.8326" actuatorfrcrange="-0.7 0.7" class="hand_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_hand_middle_0_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_hand_middle_0_link" /> <body name="right_hand_middle_1_link" pos="0.0528 0.0055 0"> <inertial pos="0.0345621 -0.00081406 0.000129799" quat="0.491268 0.492111 0.514787 0.501475" mass="0.0248731" diaginertia="8.60616e-06 7.69097e-06 1.98043e-06" /> <joint name="right_hand_middle_1_joint" pos="0 0 0" axis="0 0 1" range="0 2.0944" actuatorfrcrange="-0.7 0.7" class="hand_motor" /> <geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="0.7 0.7 0.7 1" mesh="right_hand_middle_1_link" /> <geom type="mesh" rgba="0.7 0.7 0.7 1" mesh="right_hand_middle_1_link" /> </body> </body> </body> </body> </body> </body> </body> </body> </body> </body> </body> </body> </body> </worldbody>
<actuator> <motor name="left_hip_pitch" joint="left_hip_pitch_joint" ctrlrange="-88 88" /> <motor name="left_hip_roll" joint="left_hip_roll_joint" ctrlrange="-88 88" /> <motor name="left_hip_yaw" joint="left_hip_yaw_joint" ctrlrange="-88 88" /> <motor name="left_knee" joint="left_knee_joint" ctrlrange="-139 139" /> <motor name="left_ankle_pitch" joint="left_ankle_pitch_joint" ctrlrange="-50 50" /> <motor name="left_ankle_roll" joint="left_ankle_roll_joint" ctrlrange="-50 50" />
<motor name="right_hip_pitch" joint="right_hip_pitch_joint" ctrlrange="-88 88" /> <motor name="right_hip_roll" joint="right_hip_roll_joint" ctrlrange="-88 88" /> <motor name="right_hip_yaw" joint="right_hip_yaw_joint" ctrlrange="-88 88" /> <motor name="right_knee" joint="right_knee_joint" ctrlrange="-139 139" /> <motor name="right_ankle_pitch" joint="right_ankle_pitch_joint" ctrlrange="-50 50" /> <motor name="right_ankle_roll" joint="right_ankle_roll_joint" ctrlrange="-50 50" />
<motor name="waist_yaw" joint="waist_yaw_joint" ctrlrange="-88 88" /> <motor name="waist_roll" joint="waist_roll_joint" ctrlrange="-50 50" /> <motor name="waist_pitch" joint="waist_pitch_joint" ctrlrange="-50 50" />
<motor name="left_shoulder_pitch" joint="left_shoulder_pitch_joint" ctrlrange="-25 25" /> <motor name="left_shoulder_roll" joint="left_shoulder_roll_joint" ctrlrange="-25 25" /> <motor name="left_shoulder_yaw" joint="left_shoulder_yaw_joint" ctrlrange="-25 25" /> <motor name="left_elbow" joint="left_elbow_joint" ctrlrange="-25 25" /> <motor name="left_wrist_roll" joint="left_wrist_roll_joint" ctrlrange="-25 25" /> <motor name="left_wrist_pitch" joint="left_wrist_pitch_joint" ctrlrange="-5 5" /> <motor name="left_wrist_yaw" joint="left_wrist_yaw_joint" ctrlrange="-5 5" />
<motor name="right_shoulder_pitch" joint="right_shoulder_pitch_joint" ctrlrange="-25 25" /> <motor name="right_shoulder_roll" joint="right_shoulder_roll_joint" ctrlrange="-25 25" /> <motor name="right_shoulder_yaw" joint="right_shoulder_yaw_joint" ctrlrange="-25 25" /> <motor name="right_elbow" joint="right_elbow_joint" ctrlrange="-25 25" /> <motor name="right_wrist_roll" joint="right_wrist_roll_joint" ctrlrange="-25 25" /> <motor name="right_wrist_pitch" joint="right_wrist_pitch_joint" ctrlrange="-5 5" /> <motor name="right_wrist_yaw" joint="right_wrist_yaw_joint" ctrlrange="-5 5" />
<motor name="left_hand_thumb_0" joint="left_hand_thumb_0_joint" ctrlrange="-2.45 2.45" /> <motor name="left_hand_thumb_1" joint="left_hand_thumb_1_joint" ctrlrange="-0.7 0.7" /> <motor name="left_hand_thumb_2" joint="left_hand_thumb_2_joint" ctrlrange="-0.7 0.7" /> <motor name="left_hand_middle_0" joint="left_hand_middle_0_joint" ctrlrange="-0.7 0.7" /> <motor name="left_hand_middle_1" joint="left_hand_middle_1_joint" ctrlrange="-0.7 0.7" /> <motor name="left_hand_index_0" joint="left_hand_index_0_joint" ctrlrange="-0.7 0.7" /> <motor name="left_hand_index_1" joint="left_hand_index_1_joint" ctrlrange="-0.7 0.7" />
<motor name="right_hand_thumb_0" joint="right_hand_thumb_0_joint" ctrlrange="-2.45 2.45" /> <motor name="right_hand_thumb_1" joint="right_hand_thumb_1_joint" ctrlrange="-0.7 0.7" /> <motor name="right_hand_thumb_2" joint="right_hand_thumb_2_joint" ctrlrange="-0.7 0.7" /> <motor name="right_hand_index_0" joint="right_hand_index_0_joint" ctrlrange="-0.7 0.7" /> <motor name="right_hand_index_1" joint="right_hand_index_1_joint" ctrlrange="-0.7 0.7" /> <motor name="right_hand_middle_0" joint="right_hand_middle_0_joint" ctrlrange="-0.7 0.7" /> <motor name="right_hand_middle_1" joint="right_hand_middle_1_joint" ctrlrange="-0.7 0.7" /> </actuator>
<sensor> <jointpos name="left_hip_pitch_pos" joint="left_hip_pitch_joint" /> <jointpos name="left_hip_roll_pos" joint="left_hip_roll_joint" /> <jointpos name="left_hip_yaw_pos" joint="left_hip_yaw_joint" /> <jointpos name="left_knee_pos" joint="left_knee_joint" /> <jointpos name="left_ankle_pitch_pos" joint="left_ankle_pitch_joint" /> <jointpos name="left_ankle_roll_pos" joint="left_ankle_roll_joint" /> <jointpos name="right_hip_pitch_pos" joint="right_hip_pitch_joint" /> <jointpos name="right_hip_roll_pos" joint="right_hip_roll_joint" /> <jointpos name="right_hip_yaw_pos" joint="right_hip_yaw_joint" /> <jointpos name="right_knee_pos" joint="right_knee_joint" /> <jointpos name="right_ankle_pitch_pos" joint="right_ankle_pitch_joint" /> <jointpos name="right_ankle_roll_pos" joint="right_ankle_roll_joint" /> <jointpos name="waist_yaw_pos" joint="waist_yaw_joint" /> <jointpos name="waist_roll_pos" joint="waist_roll_joint" /> <jointpos name="waist_pitch_pos" joint="waist_pitch_joint" /> <jointpos name="left_shoulder_pitch_pos" joint="left_shoulder_pitch_joint" /> <jointpos name="left_shoulder_roll_pos" joint="left_shoulder_roll_joint" /> <jointpos name="left_shoulder_yaw_pos" joint="left_shoulder_yaw_joint" /> <jointpos name="left_elbow_pos" joint="left_elbow_joint" /> <jointpos name="left_wrist_roll_pos" joint="left_wrist_roll_joint" /> <jointpos name="left_wrist_pitch_pos" joint="left_wrist_pitch_joint" /> <jointpos name="left_wrist_yaw_pos" joint="left_wrist_yaw_joint" /> <jointpos name="right_shoulder_pitch_pos" joint="right_shoulder_pitch_joint" /> <jointpos name="right_shoulder_roll_pos" joint="right_shoulder_roll_joint" /> <jointpos name="right_shoulder_yaw_pos" joint="right_shoulder_yaw_joint" /> <jointpos name="right_elbow_pos" joint="right_elbow_joint" /> <jointpos name="right_wrist_roll_pos" joint="right_wrist_roll_joint" /> <jointpos name="right_wrist_pitch_pos" joint="right_wrist_pitch_joint" /> <jointpos name="right_wrist_yaw_pos" joint="right_wrist_yaw_joint" />
<jointpos name="left_hand_thumb_0_pos" joint="left_hand_thumb_0_joint" /> <jointpos name="left_hand_thumb_1_pos" joint="left_hand_thumb_1_joint" /> <jointpos name="left_hand_thumb_2_pos" joint="left_hand_thumb_2_joint" /> <jointpos name="left_hand_middle_0_pos" joint="left_hand_middle_0_joint" /> <jointpos name="left_hand_middle_1_pos" joint="left_hand_middle_1_joint" /> <jointpos name="left_hand_index_0_pos" joint="left_hand_index_0_joint" /> <jointpos name="left_hand_index_1_pos" joint="left_hand_index_1_joint" /> <jointpos name="right_hand_thumb_0_pos" joint="right_hand_thumb_0_joint" /> <jointpos name="right_hand_thumb_1_pos" joint="right_hand_thumb_1_joint" /> <jointpos name="right_hand_thumb_2_pos" joint="right_hand_thumb_2_joint" /> <jointpos name="right_hand_middle_0_pos" joint="right_hand_middle_0_joint" /> <jointpos name="right_hand_middle_1_pos" joint="right_hand_middle_1_joint" /> <jointpos name="right_hand_index_0_pos" joint="right_hand_index_0_joint" /> <jointpos name="right_hand_index_1_pos" joint="right_hand_index_1_joint" />
<jointvel name="left_hip_pitch_vel" joint="left_hip_pitch_joint" /> <jointvel name="left_hip_roll_vel" joint="left_hip_roll_joint" /> <jointvel name="left_hip_yaw_vel" joint="left_hip_yaw_joint" /> <jointvel name="left_knee_vel" joint="left_knee_joint" /> <jointvel name="left_ankle_pitch_vel" joint="left_ankle_pitch_joint" /> <jointvel name="left_ankle_roll_vel" joint="left_ankle_roll_joint" /> <jointvel name="right_hip_pitch_vel" joint="right_hip_pitch_joint" /> <jointvel name="right_hip_roll_vel" joint="right_hip_roll_joint" /> <jointvel name="right_hip_yaw_vel" joint="right_hip_yaw_joint" /> <jointvel name="right_knee_vel" joint="right_knee_joint" /> <jointvel name="right_ankle_pitch_vel" joint="right_ankle_pitch_joint" /> <jointvel name="right_ankle_roll_vel" joint="right_ankle_roll_joint" /> <jointvel name="waist_yaw_vel" joint="waist_yaw_joint" /> <jointvel name="waist_roll_vel" joint="waist_roll_joint" /> <jointvel name="waist_pitch_vel" joint="waist_pitch_joint" /> <jointvel name="left_shoulder_pitch_vel" joint="left_shoulder_pitch_joint" /> <jointvel name="left_shoulder_roll_vel" joint="left_shoulder_roll_joint" /> <jointvel name="left_shoulder_yaw_vel" joint="left_shoulder_yaw_joint" /> <jointvel name="left_elbow_vel" joint="left_elbow_joint" /> <jointvel name="left_wrist_roll_vel" joint="left_wrist_roll_joint" /> <jointvel name="left_wrist_pitch_vel" joint="left_wrist_pitch_joint" /> <jointvel name="left_wrist_yaw_vel" joint="left_wrist_yaw_joint" /> <jointvel name="right_shoulder_pitch_vel" joint="right_shoulder_pitch_joint" /> <jointvel name="right_shoulder_roll_vel" joint="right_shoulder_roll_joint" /> <jointvel name="right_shoulder_yaw_vel" joint="right_shoulder_yaw_joint" /> <jointvel name="right_elbow_vel" joint="right_elbow_joint" /> <jointvel name="right_wrist_roll_vel" joint="right_wrist_roll_joint" /> <jointvel name="right_wrist_pitch_vel" joint="right_wrist_pitch_joint" /> <jointvel name="right_wrist_yaw_vel" joint="right_wrist_yaw_joint" />
<jointvel name="left_hand_thumb_0_vel" joint="left_hand_thumb_0_joint" /> <jointvel name="left_hand_thumb_1_vel" joint="left_hand_thumb_1_joint" /> <jointvel name="left_hand_thumb_2_vel" joint="left_hand_thumb_2_joint" /> <jointvel name="left_hand_middle_0_vel" joint="left_hand_middle_0_joint" /> <jointvel name="left_hand_middle_1_vel" joint="left_hand_middle_1_joint" /> <jointvel name="left_hand_index_0_vel" joint="left_hand_index_0_joint" /> <jointvel name="left_hand_index_1_vel" joint="left_hand_index_1_joint" /> <jointvel name="right_hand_thumb_0_vel" joint="right_hand_thumb_0_joint" /> <jointvel name="right_hand_thumb_1_vel" joint="right_hand_thumb_1_joint" /> <jointvel name="right_hand_thumb_2_vel" joint="right_hand_thumb_2_joint" /> <jointvel name="right_hand_middle_0_vel" joint="right_hand_middle_0_joint" /> <jointvel name="right_hand_middle_1_vel" joint="right_hand_middle_1_joint" /> <jointvel name="right_hand_index_0_vel" joint="right_hand_index_0_joint" /> <jointvel name="right_hand_index_1_vel" joint="right_hand_index_1_joint" />
<jointactuatorfrc name="left_hip_pitch_torque" joint="left_hip_pitch_joint" /> <jointactuatorfrc name="left_hip_roll_torque" joint="left_hip_roll_joint" /> <jointactuatorfrc name="left_hip_yaw_torque" joint="left_hip_yaw_joint" /> <jointactuatorfrc name="left_knee_torque" joint="left_knee_joint" /> <jointactuatorfrc name="left_ankle_pitch_torque" joint="left_ankle_pitch_joint" /> <jointactuatorfrc name="left_ankle_roll_torque" joint="left_ankle_roll_joint" /> <jointactuatorfrc name="right_hip_pitch_torque" joint="right_hip_pitch_joint" /> <jointactuatorfrc name="right_hip_roll_torque" joint="right_hip_roll_joint" /> <jointactuatorfrc name="right_hip_yaw_torque" joint="right_hip_yaw_joint" /> <jointactuatorfrc name="right_knee_torque" joint="right_knee_joint" /> <jointactuatorfrc name="right_ankle_pitch_torque" joint="right_ankle_pitch_joint" /> <jointactuatorfrc name="right_ankle_roll_torque" joint="right_ankle_roll_joint" /> <jointactuatorfrc name="waist_yaw_torque" joint="waist_yaw_joint" /> <jointactuatorfrc name="waist_roll_torque" joint="waist_roll_joint" /> <jointactuatorfrc name="waist_pitch_torque" joint="waist_pitch_joint" /> <jointactuatorfrc name="left_shoulder_pitch_torque" joint="left_shoulder_pitch_joint" /> <jointactuatorfrc name="left_shoulder_roll_torque" joint="left_shoulder_roll_joint" /> <jointactuatorfrc name="left_shoulder_yaw_torque" joint="left_shoulder_yaw_joint" /> <jointactuatorfrc name="left_elbow_torque" joint="left_elbow_joint" /> <jointactuatorfrc name="left_wrist_roll_torque" joint="left_wrist_roll_joint" /> <jointactuatorfrc name="left_wrist_pitch_torque" joint="left_wrist_pitch_joint" /> <jointactuatorfrc name="left_wrist_yaw_torque" joint="left_wrist_yaw_joint" /> <jointactuatorfrc name="right_shoulder_pitch_torque" joint="right_shoulder_pitch_joint" /> <jointactuatorfrc name="right_shoulder_roll_torque" joint="right_shoulder_roll_joint" /> <jointactuatorfrc name="right_shoulder_yaw_torque" joint="right_shoulder_yaw_joint" /> <jointactuatorfrc name="right_elbow_torque" joint="right_elbow_joint" /> <jointactuatorfrc name="right_wrist_roll_torque" joint="right_wrist_roll_joint" /> <jointactuatorfrc name="right_wrist_pitch_torque" joint="right_wrist_pitch_joint" /> <jointactuatorfrc name="right_wrist_yaw_torque" joint="right_wrist_yaw_joint" />
<jointactuatorfrc name="left_hand_thumb_0_torque" joint="left_hand_thumb_0_joint" /> <jointactuatorfrc name="left_hand_thumb_1_torque" joint="left_hand_thumb_1_joint" /> <jointactuatorfrc name="left_hand_thumb_2_torque" joint="left_hand_thumb_2_joint" /> <jointactuatorfrc name="left_hand_middle_0_torque" joint="left_hand_middle_0_joint" /> <jointactuatorfrc name="left_hand_middle_1_torque" joint="left_hand_middle_1_joint" /> <jointactuatorfrc name="left_hand_index_0_torque" joint="left_hand_index_0_joint" /> <jointactuatorfrc name="left_hand_index_1_torque" joint="left_hand_index_1_joint" /> <jointactuatorfrc name="right_hand_thumb_0_torque" joint="right_hand_thumb_0_joint" /> <jointactuatorfrc name="right_hand_thumb_1_torque" joint="right_hand_thumb_1_joint" /> <jointactuatorfrc name="right_hand_thumb_2_torque" joint="right_hand_thumb_2_joint" /> <jointactuatorfrc name="right_hand_middle_0_torque" joint="right_hand_middle_0_joint" /> <jointactuatorfrc name="right_hand_middle_1_torque" joint="right_hand_middle_1_joint" /> <jointactuatorfrc name="right_hand_index_0_torque" joint="right_hand_index_0_joint" /> <jointactuatorfrc name="right_hand_index_1_torque" joint="right_hand_index_1_joint" />
<framequat name="imu_quat" objtype="site" objname="imu" /> <gyro name="imu_gyro" site="imu" /> <accelerometer name="imu_acc" site="imu" />
<framepos name="frame_pos" objtype="site" objname="imu" /> <framelinvel name="frame_vel" objtype="site" objname="imu" /> </sensor></mujoco>1234567891011121314151617181920212223<mujoco model="g1_23dof scene"> <include file="g1_23dof.xml"/>
<statistic center="0 0 0.5" extent="2.0"/>
<visual> <headlight diffuse="0.6 0.6 0.6" ambient="0.3 0.3 0.3" specular="0 0 0"/> <rgba haze="0.15 0.25 0.35 1"/> <global azimuth="-130" elevation="-20"/> </visual>
<asset> <texture type="skybox" builtin="gradient" rgb1="0.3 0.5 0.7" rgb2="0 0 0" width="512" height="3072"/> <texture type="2d" name="groundplane" builtin="checker" mark="edge" rgb1="0.2 0.3 0.4" rgb2="0.1 0.2 0.3" markrgb="0.8 0.8 0.8" width="300" height="300"/> <material name="groundplane" texture="groundplane" texuniform="true" texrepeat="5 5" reflectance="0.2"/> </asset>
<worldbody> <light pos="0 0 1.5" dir="0 0 -1" directional="true"/> <geom name="floor" size="0 0 0.05" type="plane" material="groundplane"/> </worldbody></mujoco>1234567891011121314151617181920212223242526272829<mujoco model="g1_29dof scene"> <include file="g1_29dof_old.xml"/>
<statistic center="0 0 0.5" extent="2.0"/>
<visual> <headlight diffuse="0.6 0.6 0.6" ambient="0.3 0.3 0.3" specular="0 0 0"/> <rgba haze="0.15 0.25 0.35 1"/> <global azimuth="-130" elevation="-20"/> </visual>
<asset> <texture type="skybox" builtin="gradient" rgb1="0.3 0.5 0.7" rgb2="0 0 0" width="512" height="3072"/> <texture type="2d" name="groundplane" builtin="checker" mark="edge" rgb1="0.2 0.3 0.4" rgb2="0.1 0.2 0.3" markrgb="0.8 0.8 0.8" width="300" height="300"/> <material name="groundplane" texture="groundplane" texuniform="true" texrepeat="5 5" reflectance="0.2"/> </asset>
<worldbody> <light pos="0 0 1.5" dir="0 0 -1" directional="true"/> <geom name="floor" size="0 0 0.05" type="plane" material="groundplane"/> <!-- Site --> <site name="com_marker" pos="0.1 0 0" size="0.05" rgba="1 0 0 1" type="sphere"/> </worldbody>
<default> <geom friction="0.5"/> </default></mujoco>1234567891011121314151617181920212223<mujoco model="g1_29dof scene"> <include file="g1_29dof_with_hand.xml"/>
<statistic center="0 0 0.5" extent="2.0"/>
<visual> <headlight diffuse="0.6 0.6 0.6" ambient="0.3 0.3 0.3" specular="0 0 0"/> <rgba haze="0.15 0.25 0.35 1"/> <global azimuth="-130" elevation="-20"/> </visual>
<asset> <texture type="skybox" builtin="gradient" rgb1="0.3 0.5 0.7" rgb2="0 0 0" width="512" height="3072"/> <texture type="2d" name="groundplane" builtin="checker" mark="edge" rgb1="0.2 0.3 0.4" rgb2="0.1 0.2 0.3" markrgb="0.8 0.8 0.8" width="300" height="300"/> <material name="groundplane" texture="groundplane" texuniform="true" texrepeat="5 5" reflectance="0.2"/> </asset>
<worldbody> <light pos="0 0 1.5" dir="0 0 -1" directional="true"/> <geom name="floor" size="0 0 0.05" type="plane" material="groundplane"/> </worldbody></mujoco>12345678910111213141516171819202122232425262728<mujoco model="g1_29dof scene">
<statistic center="0 0 0.5" extent="2.0"/>
<visual> <headlight diffuse="0.6 0.6 0.6" ambient="0.3 0.3 0.3" specular="0 0 0"/> <rgba haze="0.15 0.25 0.35 1"/> <global azimuth="-130" elevation="-20"/> </visual>
<asset> <texture type="skybox" builtin="gradient" rgb1="0.3 0.5 0.7" rgb2="0 0 0" width="512" height="3072"/> <texture type="2d" name="groundplane" builtin="checker" mark="edge" rgb1="0.2 0.3 0.4" rgb2="0.1 0.2 0.3" markrgb="0.8 0.8 0.8" width="300" height="300"/> <material name="groundplane" texture="groundplane" texuniform="true" texrepeat="5 5" reflectance="0.2"/> </asset>
<worldbody> <light pos="0 0 1.5" dir="0 0 -1" directional="true"/> <geom name="floor" size="0 0 0.05" type="plane" material="groundplane"/> <!-- Site --> <site name="com_marker" pos="0.1 0 0" size="0.05" rgba="1 0 0 1" type="sphere"/> </worldbody>
<default> <geom friction="0.5"/> </default></mujoco>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150# ===================================================================# G1 Deploy - Observation Configuration Example# ===================================================================# This file demonstrates the complete observation configuration format# This example matches the default configuration exactly## Instructions:# 1. Copy this file to create your custom configuration# 2. Modify enabled: true/false to enable/disable observations# 3. Reorder observations by changing their position in the list# 4. The system automatically calculates offsets based on order# 5. Ensure total enabled dimensions match your ONNX model input# ===================================================================
# Observation definitions - processed in the order listed belowobservations: # --------------------------------------------------------------- # Motion Reference Data (from loaded motion sequences) # --------------------------------------------------------------- - name: "motion_joint_positions" enabled: true # Description: Joint positions from motion reference data # Dimension: 29 elements (one per joint) # Units: radians # Purpose: Provides target joint positions for the current motion frame - name: "motion_joint_velocities" enabled: true # Description: Joint velocities from motion reference data # Dimension: 29 elements (one per joint) # Units: radians/second # Purpose: Provides target joint velocities for the current motion frame # Note: Only active when motion is playing (is_playing_ = true) - name: "motion_anchor_orientation" enabled: true # Description: Motion anchor orientation relative to robot base # Dimension: 6 elements (rotation matrix first 2 columns flattened) # Units: dimensionless (rotation matrix elements) # Purpose: Encodes relative orientation between robot and motion reference # Calculation: Includes heading compensation and delta heading adjustments # --------------------------------------------------------------- # Robot State Data (from sensors and estimation) # --------------------------------------------------------------- - name: "base_angular_velocity" enabled: true # Description: Robot base angular velocity in body frame # Dimension: 3 elements (roll, pitch, yaw rates) # Units: radians/second # Source: IMU sensor data # Purpose: Provides current rotational motion of the robot base - name: "body_joint_positions" enabled: true # Description: Current robot joint positions # Dimension: 29 elements (one per joint) # Units: radians # Source: Joint encoders via robot low-level state # Purpose: Current actual joint positions for feedback control - name: "body_joint_velocities" enabled: true # Description: Current robot joint velocities # Dimension: 29 elements (one per joint) # Units: radians/second # Source: Joint encoders via robot low-level state # Purpose: Current actual joint velocities for feedback control # --------------------------------------------------------------- # Control History # --------------------------------------------------------------- - name: "last_actions" enabled: true # Description: Previous control action output # Dimension: 29 elements (one per joint) # Units: dimensionless (normalized action values) # Purpose: Provides action history for temporal consistency # Note: Helps with smooth control transitions
# ===================================================================# Configuration Summary# ===================================================================# # Default Configuration Totals:# - motion_joint_positions: 29D (enabled) [offset: 0]# - motion_joint_velocities: 29D (enabled) [offset: 29]# - motion_anchor_orientation: 6D (enabled) [offset: 58]# - base_angular_velocity: 3D (enabled) [offset: 64]# - body_joint_positions: 29D (enabled) [offset: 67]# - body_joint_velocities: 29D (enabled) [offset: 96]# - last_actions: 29D (enabled) [offset: 125]# ----------------------------------------------------------------# Total Enabled Dimension: 154D## This matches the standard G1 policy model input dimension of 154## ===================================================================# Customization Examples# ===================================================================## Example 1: Disable motion velocities (for position-only policies)# - name: "motion_joint_velocities"# enabled: false## Example 2: Disable last actions (for non-temporal policies)# - name: "last_actions"# enabled: false## Example 3: Minimal configuration (position-only)# observations:# - name: "motion_joint_positions"# enabled: true# - name: "body_joint_positions"# enabled: true# # Total: 58D (29+29)## Example 4: Reorder observations (offsets calculated automatically)# observations:# - name: "body_joint_positions" # Will get offset: 0# enabled: true# - name: "motion_joint_positions" # Will get offset: 29# enabled: true# # Automatic offset calculation based on order## Example 5: Multi-frame observations with step intervals (for temporal dynamics)# observations:# - name: "motion_joint_positions_5frame_step5" # 145D (29 joints * 5 frames, step=5)# enabled: true# - name: "motion_joint_velocities_5frame_step5" # 145D (29 joints * 5 frames, step=5) # enabled: true# - name: "base_angular_velocity" # 3D (current frame only)# enabled: true# # Total: 293D (145+145+3)# # Captures frames at: current, current+5, current+10, current+15, current+20## Example 6: Multi-frame with different step sizes# observations:# - name: "motion_joint_positions_5frame_step10" # 145D (step=10 for longer intervals)# enabled: true# # Captures frames at: current, current+10, current+20, current+30, current+40## Note: Multi-frame observations capture temporal patterns by sampling# future frames at configurable intervals (step sizes)# If future frames exceed motion length, repeats the last frame## ===================================================================1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980# G1 Deploy - Observation Configuration# ====================================# Total dimension: 436 (64+12+116+116+116+12)
observations:
- name: "token_state" enabled: true
- name: "his_base_angular_velocity_10frame_step1" enabled: true - name: "his_body_joint_positions_10frame_step1" enabled: true - name: "his_body_joint_velocities_10frame_step1" enabled: true - name: "his_last_actions_10frame_step1" enabled: true
- name: "his_gravity_dir_10frame_step1" enabled: true
encoder: dimension: 64 use_fp16: false encoder_observations: - name: "encoder_mode_4" enabled: true - name: "motion_joint_positions_10frame_step5" enabled: true - name: "motion_joint_velocities_10frame_step5" enabled: true - name: "motion_root_z_position_10frame_step5" enabled: true - name: "motion_root_z_position" enabled: true - name: "motion_anchor_orientation" enabled: true - name: "motion_anchor_orientation_10frame_step5" enabled: true - name: "motion_joint_positions_lowerbody_10frame_step5" enabled: true - name: "motion_joint_velocities_lowerbody_10frame_step5" enabled: true - name: "vr_3point_local_target" enabled: true - name: "vr_3point_local_orn_target" enabled: true - name: "smpl_joints_10frame_step1" enabled: true - name: "smpl_anchor_orientation_10frame_step1" enabled: true - name: "motion_joint_positions_wrists_10frame_step1" enabled: true encoder_modes: - name: "g1" mode_id: 0 required_observations: - encoder_mode_4 - motion_joint_positions_10frame_step5 - motion_joint_velocities_10frame_step5 - motion_anchor_orientation_10frame_step5 - name: "teleop" mode_id: 1 required_observations: - encoder_mode_4 - motion_joint_positions_lowerbody_10frame_step5 - motion_joint_velocities_lowerbody_10frame_step5 - vr_3point_local_target - vr_3point_local_orn_target - motion_anchor_orientation - name: "smpl" mode_id: 2 required_observations: - encoder_mode_4 - smpl_joints_10frame_step1 - smpl_anchor_orientation_10frame_step1 - motion_joint_positions_wrists_10frame_step11234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192# SONIC Release (Low-Latency) - Observation Configuration# =======================================================# For ONNX models exported from the low-latency sonic_release checkpoint# (smpl 4-frame lookahead; g1/teleop lookahead at step1, body-frame orientation).## Encoder input dimension: 1247 Decoder/policy dimension: 994 token: 64# Uses the unitoken_all_noz tokenizer config (3 encoders: g1, teleop, smpl)## Requires the smpl_*_4frame_step1 entries in GetObservationRegistry()# (src/g1/g1_deploy_onnx_ref/src/g1_deploy_onnx_ref.cpp) + a rebuild to load.
observations:
- name: "token_state" enabled: true
- name: "his_base_angular_velocity_10frame_step1" enabled: true
- name: "his_body_joint_positions_10frame_step1" enabled: true
- name: "his_body_joint_velocities_10frame_step1" enabled: true
- name: "his_last_actions_10frame_step1" enabled: true
- name: "his_gravity_dir_10frame_step1" enabled: true
encoder: dimension: 64 use_fp16: false encoder_observations: # Shared - name: "encoder_mode_4" enabled: true # g1 encoder: command_multi_future_nonflat (positions + velocities), step1 - name: "motion_joint_positions_10frame_step1" enabled: true - name: "motion_joint_velocities_10frame_step1" enabled: true # g1 encoder: motion_anchor_ori_b_mf_nonflat (body, multi-frame FIRST), step1 - name: "motion_anchor_orientation_10frame_step1" enabled: true # teleop encoder: motion_anchor_ori_b (body, single-frame SECOND) - name: "motion_anchor_orientation" enabled: true # teleop encoder: command_multi_future_lower_body, step1 - name: "motion_joint_positions_lowerbody_10frame_step1" enabled: true - name: "motion_joint_velocities_lowerbody_10frame_step1" enabled: true # teleop encoder: vr_3point - name: "vr_3point_local_target" enabled: true - name: "vr_3point_local_orn_target" enabled: true # smpl encoder: smpl_joints_multi_future_local_nonflat (4 frames, step1) <-- LOW-LATENCY - name: "smpl_joints_4frame_step1" enabled: true # smpl encoder: smpl_root_ori_b_multi_future (body, 4 frames, step1) <-- LOW-LATENCY - name: "smpl_anchor_orientation_4frame_step1" enabled: true # smpl encoder: joint_pos_multi_future_wrist_for_smpl (4 frames, step1) <-- LOW-LATENCY - name: "motion_joint_positions_wrists_4frame_step1" enabled: true encoder_modes: - name: "g1" mode_id: 0 required_observations: - encoder_mode_4 - motion_joint_positions_10frame_step1 - motion_joint_velocities_10frame_step1 - motion_anchor_orientation_10frame_step1 - name: "teleop" mode_id: 1 required_observations: - encoder_mode_4 - motion_joint_positions_lowerbody_10frame_step1 - motion_joint_velocities_lowerbody_10frame_step1 - vr_3point_local_target - vr_3point_local_orn_target - motion_anchor_orientation - name: "smpl" mode_id: 2 required_observations: - encoder_mode_4 - smpl_joints_4frame_step1 - smpl_anchor_orientation_4frame_step1 - motion_joint_positions_wrists_4frame_step112345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879# SONIC Release - Observation Configuration# ==========================================# For ONNX models exported from sonic_release checkpoint via:# python gear_sonic/eval_agent_trl.py +checkpoint=sonic_release/last.pt \# +headless=True ++num_envs=1 +export_onnx_only=true## Encoder input dimension: 1751 (1 encoder_index + 1750 tokenizer obs)# Uses the unitoken_all_noz tokenizer config (3 encoders: g1, teleop, smpl)
observations:
- name: "token_state" enabled: true
- name: "his_base_angular_velocity_10frame_step1" enabled: true
- name: "his_body_joint_positions_10frame_step1" enabled: true
- name: "his_body_joint_velocities_10frame_step1" enabled: true
- name: "his_last_actions_10frame_step1" enabled: true
- name: "his_gravity_dir_10frame_step1" enabled: true
encoder: dimension: 64 use_fp16: false encoder_observations: # Used by all encoder modes - name: "encoder_index" enabled: true # G1 mode - name: "command_multi_future_nonflat" enabled: true - name: "motion_anchor_ori_b_mf_nonflat" enabled: true # Teleop mode - name: "command_multi_future_lower_body" enabled: true - name: "vr_3point_local_target" enabled: true - name: "vr_3point_local_orn_target" enabled: true - name: "motion_anchor_ori_b" enabled: true # SMPL mode - name: "smpl_joints_multi_future_local_nonflat" enabled: true - name: "smpl_root_ori_b_multi_future" enabled: true - name: "joint_pos_multi_future_wrist_for_smpl" enabled: true encoder_modes: - name: "g1" mode_id: 0 required_observations: - encoder_index - command_multi_future_nonflat - motion_anchor_ori_b_mf_nonflat - name: "teleop" mode_id: 1 required_observations: - encoder_index - command_multi_future_lower_body - vr_3point_local_target - vr_3point_local_orn_target - motion_anchor_ori_b - name: "smpl" mode_id: 2 required_observations: - encoder_index - smpl_joints_multi_future_local_nonflat - smpl_root_ori_b_multi_future - joint_pos_multi_future_wrist_for_smpl1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374# SONIC v1.1 - Observation Configuration# =================================================# Matches sonic_v1_1/model_encoder.onnx and model_decoder.onnx.## Encoder input: 1751 Decoder input: 994 Token: 64# G1/teleop references use 10 frames at step5. SMPL and wrist references use# 10 frames at step1. Root orientations are normalized by robot heading.
observations: - name: "token_state" enabled: true - name: "his_base_angular_velocity_10frame_step1" enabled: true - name: "his_body_joint_positions_10frame_step1" enabled: true - name: "his_body_joint_velocities_10frame_step1" enabled: true - name: "his_last_actions_10frame_step1" enabled: true - name: "his_gravity_dir_10frame_step1" enabled: true
encoder: dimension: 64 use_fp16: false encoder_observations: - name: "encoder_mode_4" enabled: true - name: "motion_joint_positions_10frame_step5" enabled: true - name: "motion_joint_velocities_10frame_step5" enabled: true - name: "motion_anchor_orientation_heading_10frame_step5" enabled: true - name: "motion_anchor_orientation_heading" enabled: true - name: "motion_joint_positions_lowerbody_10frame_step5" enabled: true - name: "motion_joint_velocities_lowerbody_10frame_step5" enabled: true - name: "vr_3point_local_target" enabled: true - name: "vr_3point_local_orn_target" enabled: true - name: "smpl_joints_10frame_step1" enabled: true - name: "smpl_anchor_orientation_heading_10frame_step1" enabled: true - name: "motion_joint_positions_wrists_10frame_step1" enabled: true encoder_modes: - name: "g1" mode_id: 0 required_observations: - encoder_mode_4 - motion_joint_positions_10frame_step5 - motion_joint_velocities_10frame_step5 - motion_anchor_orientation_heading_10frame_step5 - name: "teleop" mode_id: 1 required_observations: - encoder_mode_4 - motion_joint_positions_lowerbody_10frame_step5 - motion_joint_velocities_lowerbody_10frame_step5 - vr_3point_local_target - vr_3point_local_orn_target - motion_anchor_orientation_heading - name: "smpl" mode_id: 2 required_observations: - encoder_mode_4 - smpl_joints_10frame_step1 - smpl_anchor_orientation_heading_10frame_step1 - motion_joint_positions_wrists_10frame_step11234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374# SONIC v1.1 - Observation Configuration# =================================================# Matches sonic_v1_1/model_encoder.onnx and model_decoder.onnx.## Encoder input: 1751 Decoder input: 994 Token: 64# G1/teleop references use 10 frames at step5. SMPL and wrist references use# 10 frames at step1. Root orientations are normalized by robot heading.
observations: - name: "token_state" enabled: true - name: "his_base_angular_velocity_10frame_step1" enabled: true - name: "his_body_joint_positions_10frame_step1" enabled: true - name: "his_body_joint_velocities_10frame_step1" enabled: true - name: "his_last_actions_10frame_step1" enabled: true - name: "his_gravity_dir_10frame_step1" enabled: true
encoder: dimension: 64 use_fp16: false encoder_observations: - name: "encoder_mode_4" enabled: true - name: "motion_joint_positions_10frame_step5" enabled: true - name: "motion_joint_velocities_10frame_step5" enabled: true - name: "motion_anchor_orientation_heading_10frame_step5" enabled: true - name: "motion_anchor_orientation_heading" enabled: true - name: "motion_joint_positions_lowerbody_10frame_step5" enabled: true - name: "motion_joint_velocities_lowerbody_10frame_step5" enabled: true - name: "vr_3point_local_target" enabled: true - name: "vr_3point_local_orn_target" enabled: true - name: "smpl_joints_10frame_step1" enabled: true - name: "smpl_anchor_orientation_heading_10frame_step1" enabled: true - name: "motion_joint_positions_wrists_10frame_step1" enabled: true encoder_modes: - name: "g1" mode_id: 0 required_observations: - encoder_mode_4 - motion_joint_positions_10frame_step5 - motion_joint_velocities_10frame_step5 - motion_anchor_orientation_heading_10frame_step5 - name: "teleop" mode_id: 1 required_observations: - encoder_mode_4 - motion_joint_positions_lowerbody_10frame_step5 - motion_joint_velocities_lowerbody_10frame_step5 - vr_3point_local_target - vr_3point_local_orn_target - motion_anchor_orientation_heading - name: "smpl" mode_id: 2 required_observations: - encoder_mode_4 - smpl_joints_10frame_step1 - smpl_anchor_orientation_heading_10frame_step1 - motion_joint_positions_wrists_10frame_step1123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274#!/usr/bin/env python3"""Convert G1 motion capture data from joblib pickle to C++ readable formatsConverts motion sequences with joint positions, velocities, and full body kinematics"""
import sysimport os
def convert_motion_data(pkl_file, base_output_dir=None): """Convert the motion pickle file to C++ readable formats""" # Create organized folder structure: reference/{pkl_name}/ pkl_name = os.path.splitext(os.path.basename(pkl_file))[0] # Extract filename without extension if base_output_dir is None: # Default: put in reference folder structure base_output_dir = os.path.join(os.path.dirname(pkl_file), pkl_name) print(f"Converting motion data from: {pkl_file}") print(f"Output directory structure: {base_output_dir}/") # Load the data try: import joblib data = joblib.load(pkl_file) print("✓ Successfully loaded with joblib") except ImportError: print("✗ joblib not available, trying pickle...") try: import pickle with open(pkl_file, 'rb') as f: data = pickle.load(f) print("✓ Successfully loaded with pickle") except Exception as e: print(f"✗ Failed to load: {e}") return False except Exception as e: print(f"✗ Failed to load with joblib: {e}") return False # Create base output directory os.makedirs(base_output_dir, exist_ok=True) print(f"\nFound {len(data)} motion sequences:") for motion_name in data.keys(): print(f" - {motion_name}") # Convert each motion sequence success_count = 0 for motion_name, motion_data in data.items(): print(f"\nProcessing: {motion_name}") # Create individual folder for this motion motion_output_dir = os.path.join(base_output_dir, motion_name) print(f"Creating individual folder for this motion: {motion_output_dir}") os.makedirs(motion_output_dir, exist_ok=True) if convert_single_motion(motion_name, motion_data, motion_output_dir): success_count += 1 # Create summary file in base directory create_summary_file(data, base_output_dir) print(f"\n✓ Successfully converted {success_count}/{len(data)} motions") print(f"Output files saved to: {base_output_dir}/") # Extract counts from first motion for summary joint_count = None body_count = None if data: first_motion = next(iter(data.values())) joint_count = first_motion['joint_pos'].shape[1] body_count = first_motion['body_pos_w'].shape[1] return success_count > 0, len(data), joint_count, body_count
def convert_single_motion(motion_name, motion_data, output_dir): """Convert a single motion sequence to various formats""" try: # Extract ALL available data arrays joint_pos = motion_data['joint_pos'] # Shape: (timesteps, 29) joint_vel = motion_data['joint_vel'] # Shape: (timesteps, 29) body_pos_w = motion_data['body_pos_w'] # Shape: (timesteps, 14, 3) body_quat_w = motion_data['body_quat_w'] # Shape: (timesteps, 14, 4) body_lin_vel_w = motion_data['body_lin_vel_w'] # Shape: (timesteps, 14, 3) body_ang_vel_w = motion_data['body_ang_vel_w'] # Shape: (timesteps, 14, 3) timesteps = joint_pos.shape[0] print(f" Timesteps: {timesteps}, Joints: {joint_pos.shape[1]}, Body parts: {body_pos_w.shape[1]}") # 1. Save joint data as CSV joint_pos_file = os.path.join(output_dir, "joint_pos.csv") save_array_as_csv(joint_pos, joint_pos_file, [f"joint_{i}" for i in range(joint_pos.shape[1])]) joint_vel_file = os.path.join(output_dir, "joint_vel.csv") save_array_as_csv(joint_vel, joint_vel_file, [f"joint_vel_{i}" for i in range(joint_vel.shape[1])]) # 2. Save body position data (reshape to 2D for CSV) body_pos_reshaped = body_pos_w.reshape(timesteps, -1) # (timesteps, 14*3) body_pos_file = os.path.join(output_dir, "body_pos.csv") body_pos_headers = [f"body_{i//3}_{'xyz'[i%3]}" for i in range(body_pos_reshaped.shape[1])] save_array_as_csv(body_pos_reshaped, body_pos_file, body_pos_headers) # 3. Save body quaternion data (reshape to 2D for CSV) body_quat_reshaped = body_quat_w.reshape(timesteps, -1) # (timesteps, 14*4) body_quat_file = os.path.join(output_dir, "body_quat.csv") body_quat_headers = [f"body_{i//4}_{'wxyz'[i%4]}" for i in range(body_quat_reshaped.shape[1])] save_array_as_csv(body_quat_reshaped, body_quat_file, body_quat_headers) # 4. Save body linear velocity data body_lin_vel_reshaped = body_lin_vel_w.reshape(timesteps, -1) # (timesteps, 14*3) body_lin_vel_file = os.path.join(output_dir, "body_lin_vel.csv") body_lin_vel_headers = [f"body_{i//3}_vel_{'xyz'[i%3]}" for i in range(body_lin_vel_reshaped.shape[1])] save_array_as_csv(body_lin_vel_reshaped, body_lin_vel_file, body_lin_vel_headers) # 5. Save body angular velocity data body_ang_vel_reshaped = body_ang_vel_w.reshape(timesteps, -1) # (timesteps, 14*3) body_ang_vel_file = os.path.join(output_dir, "body_ang_vel.csv") body_ang_vel_headers = [f"body_{i//3}_angvel_{'xyz'[i%3]}" for i in range(body_ang_vel_reshaped.shape[1])] save_array_as_csv(body_ang_vel_reshaped, body_ang_vel_file, body_ang_vel_headers) # 6. Save metadata metadata_file = os.path.join(output_dir, "metadata.txt") save_metadata(motion_name, motion_data, metadata_file) # 7. Save detailed info info_file = os.path.join(output_dir, "info.txt") save_motion_info(motion_name, motion_data, info_file) print(f" ✓ Saved 7 files for {motion_name} (joints + full body kinematics)") return True except Exception as e: print(f" ✗ Error processing {motion_name}: {e}") return False
def save_array_as_csv(array, filename, headers=None): """Save numpy array as CSV file""" import numpy as np with open(filename, 'w') as f: # Write header if headers: f.write(",".join(headers) + "\n") else: f.write(",".join([f"col_{i}" for i in range(array.shape[1])]) + "\n") # Write data for row in array: f.write(",".join([f"{val:.6f}" for val in row]) + "\n")
def save_metadata(motion_name, motion_data, filename): """Save metadata and indices information""" with open(filename, 'w') as f: f.write(f"Metadata for: {motion_name}\n") f.write("=" * 30 + "\n\n") # Save body indexes if available if '_body_indexes' in motion_data: f.write("Body part indexes:\n") f.write(f"{motion_data['_body_indexes']}\n\n") # Save total timestep count if 'time_step_total' in motion_data: f.write(f"Total timesteps: {motion_data['time_step_total']}\n\n") # Data summary f.write("Data arrays summary:\n") for key, value in motion_data.items(): if hasattr(value, 'shape'): f.write(f" {key}: {value.shape} ({value.dtype})\n")
def save_motion_info(motion_name, motion_data, filename): """Save detailed motion information""" with open(filename, 'w') as f: f.write(f"Motion Information: {motion_name}\n") f.write("=" * 50 + "\n\n") for key, value in motion_data.items(): f.write(f"{key}:\n") if hasattr(value, 'shape'): f.write(f" Shape: {value.shape}\n") f.write(f" Dtype: {value.dtype}\n") if value.size > 0: flat_vals = value.flatten() f.write(f" Range: [{flat_vals.min():.3f}, {flat_vals.max():.3f}]\n") f.write(f" Sample: {flat_vals[:5]}\n") else: f.write(f" Value: {value}\n") f.write("\n")
def create_summary_file(data, output_dir): """Create a summary file with all motion information""" summary_file = os.path.join(output_dir, "motion_summary.txt") with open(summary_file, 'w') as f: f.write("G1 Motion Capture Data Summary\n") f.write("=" * 40 + "\n\n") f.write(f"Total motion sequences: {len(data)}\n\n") # Detailed motion list f.write("Detailed motion list:\n") for motion_name, motion_data in data.items(): joint_pos = motion_data['joint_pos'] f.write(f" {motion_name}:\n") f.write(f" Timesteps: {joint_pos.shape[0]}\n") f.write(f" Joints: {joint_pos.shape[1]}\n") f.write(f" Body parts: {motion_data['body_pos_w'].shape[1]}\n") f.write("\n")
def main(): if len(sys.argv) < 2: print("Usage: python3 convert_motions.py <pkl_file> [output_base_dir]") print("Examples:") print(" python3 convert_motions.py bones_072925_test.pkl") print(" python3 convert_motions.py bones_072925_test.pkl custom_output/") print("") print("Default output structure: reference/{pkl_name}/{motion_name}/") return pkl_file = sys.argv[1] output_base_dir = sys.argv[2] if len(sys.argv) > 2 else None if not os.path.exists(pkl_file): print(f"Error: File not found: {pkl_file}") return # Extract pkl name for output messages pkl_name = os.path.splitext(os.path.basename(pkl_file))[0] print("G1 Motion Data Converter") print("========================") success, motion_count, joint_count, body_count = convert_motion_data(pkl_file, output_base_dir) if success: print("\n✓ Conversion completed successfully!") print("\nExtracted data for each motion:") print(f"- Joint positions & velocities ({joint_count} joints)") print(f"- Body positions in world coordinates ({body_count} body parts)") print("- Body orientations (quaternions)") print("- Body linear & angular velocities") print("- Metadata and body part indices") print("\nNext steps:") print(f"1. Build C++ reader: make motion_data_reader") print(f"2. Test reading: ./bin/motion_data_reader reference/{pkl_name}/") print("3. Use full kinematic data in your G1 control programs") print("\nFile structure created:") print(f"reference/{pkl_name}/") print("├── [motion_name_1]/") print("│ ├── joint_pos.csv") print("│ ├── joint_vel.csv") print("│ ├── body_pos.csv") print("│ ├── body_quat.csv") print("│ ├── body_lin_vel.csv") print("│ ├── body_ang_vel.csv") print("│ ├── metadata.txt") print("│ └── info.txt") print("├── [motion_name_2]/") print("├── motion_summary.txt") print(f"└── ... ({motion_count} motion folders total)") else: print("\n✗ Conversion failed")
if __name__ == "__main__": main()12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152Motion Information: dance_in_da_party_001__A464==================================================
joint_pos: Shape: (497, 29) Dtype: float32 Range: [-1.868, 2.226] Sample: [ 0.12844084 0.10271313 0.0201158 -0.01923597 0.02096039]
joint_vel: Shape: (497, 29) Dtype: float32 Range: [-20.223, 20.504] Sample: [0.14367104 0.14386438 0. 0. 0. ]
body_pos_w: Shape: (497, 14, 3) Dtype: float32 Range: [-0.525, 1.307] Sample: [2.7894555e-04 1.4439992e-02 7.9243100e-01 1.1525212e-01 1.0816078e-02]
body_quat_w: Shape: (497, 14, 4) Dtype: float32 Range: [-0.707, 0.998] Sample: [-0.7035716 0.02096497 0.01313119 0.71019363 -0.70268404]
body_lin_vel_w: Shape: (497, 14, 3) Dtype: float32 Range: [-2.763, 2.750] Sample: [-0.00116042 -0.02408473 -0.00280159 -0.00131542 -0.02102444]
body_ang_vel_w: Shape: (497, 14, 3) Dtype: float32 Range: [-12.991, 16.331] Sample: [ 2.82337610e-03 9.97470808e-04 -2.06027436e-03 1.01761095e-01 -4.19195203e-05]
_body_indexes: Shape: (14,) Dtype: int64 Range: [0.000, 29.000] Sample: [ 0 4 10 18 5]
time_step_total: Shape: () Dtype: int64 Range: [497.000, 497.000] Sample: [497]
1234567891011121314151617Metadata for: dance_in_da_party_001__A464==============================
Body part indexes:[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
Total timesteps: 497
Data arrays summary: joint_pos: (497, 29) (float32) joint_vel: (497, 29) (float32) body_pos_w: (497, 14, 3) (float32) body_quat_w: (497, 14, 4) (float32) body_lin_vel_w: (497, 14, 3) (float32) body_ang_vel_w: (497, 14, 3) (float32) _body_indexes: (14,) (int64) time_step_total: () (int64)12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152Motion Information: dance_in_da_party_001__A464_M==================================================
joint_pos: Shape: (497, 29) Dtype: float32 Range: [-1.868, 2.226] Sample: [ 0.10277859 0.12832902 -0.02010582 -0.0212364 0.01920657]
joint_vel: Shape: (497, 29) Dtype: float32 Range: [-20.223, 20.504] Sample: [0.14217682 0.14665052 0. 0. 0. ]
body_pos_w: Shape: (497, 14, 3) Dtype: float32 Range: [-0.537, 1.307] Sample: [-2.83326663e-04 1.44427223e-02 7.92431474e-01 1.17636755e-01 1.22397467e-02]
body_quat_w: Shape: (497, 14, 4) Dtype: float32 Range: [-0.707, 0.998] Sample: [ 0.7101825 -0.01322068 -0.0210839 -0.7035777 0.70851105]
body_lin_vel_w: Shape: (497, 14, 3) Dtype: float32 Range: [-2.763, 2.579] Sample: [ 0.00117058 -0.02414531 -0.00281086 0.00139649 -0.02009862]
body_ang_vel_w: Shape: (497, 14, 3) Dtype: float32 Range: [-16.230, 12.991] Sample: [ 0.00225733 -0.00063545 0.00251273 0.10681088 0.0040871 ]
_body_indexes: Shape: (14,) Dtype: int64 Range: [0.000, 29.000] Sample: [ 0 4 10 18 5]
time_step_total: Shape: () Dtype: int64 Range: [497.000, 497.000] Sample: [497]
1234567891011121314151617Metadata for: dance_in_da_party_001__A464_M==============================
Body part indexes:[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
Total timesteps: 497
Data arrays summary: joint_pos: (497, 29) (float32) joint_vel: (497, 29) (float32) body_pos_w: (497, 14, 3) (float32) body_quat_w: (497, 14, 4) (float32) body_lin_vel_w: (497, 14, 3) (float32) body_ang_vel_w: (497, 14, 3) (float32) _body_indexes: (14,) (int64) time_step_total: () (int64)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051Motion Information: forward_lunge_R_001__A359_M==================================================
joint_pos: Shape: (399, 29) Dtype: float32 Range: [-1.516, 1.847] Sample: [ 0.21495092 0.21319595 -0.0629773 -0.03622465 0.0364784 ]
joint_vel: Shape: (399, 29) Dtype: float32 Range: [-6.573, 7.911] Sample: [ 0. -0.07231236 0. 0. 0. ]
body_pos_w: Shape: (399, 14, 3) Dtype: float32 Range: [-0.749, 1.083] Sample: [0.00151141 0.01061182 0.79061526 0.11847792 0.00413224]
body_quat_w: Shape: (399, 14, 4) Dtype: float32 Range: [-0.707, 0.951] Sample: [ 0.7101441 -0.0368785 -0.03962614 -0.70197237 0.71026546]
body_lin_vel_w: Shape: (399, 14, 3) Dtype: float32 Range: [-2.788, 2.510] Sample: [ 0.00209634 -0.00167504 -0.01071004 -0.00232031 0.00457859]
body_ang_vel_w: Shape: (399, 14, 3) Dtype: float32 Range: [-6.113, 7.547] Sample: [ 0.1587345 0.02668758 -0.10707712 0.09136587 0.00318161]
_body_indexes: Shape: (14,) Dtype: int64 Range: [0.000, 29.000] Sample: [ 0 4 10 18 5]
time_step_total: Shape: () Dtype: int64 Range: [399.000, 399.000] Sample: [399]
1234567891011121314151617Metadata for: forward_lunge_R_001__A359_M==============================
Body part indexes:[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
Total timesteps: 399
Data arrays summary: joint_pos: (399, 29) (float32) joint_vel: (399, 29) (float32) body_pos_w: (399, 14, 3) (float32) body_quat_w: (399, 14, 4) (float32) body_lin_vel_w: (399, 14, 3) (float32) body_ang_vel_w: (399, 14, 3) (float32) _body_indexes: (14,) (int64) time_step_total: () (int64)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354Motion Information: macarena_001__A545==================================================
joint_pos: Shape: (1375, 29) Dtype: float32 Range: [-1.839, 1.703] Sample: [-0.10820262 -0.12627353 -0.04614628 0.17931442 0.03701398]
joint_vel: Shape: (1375, 29) Dtype: float32 Range: [-16.128, 17.410] Sample: [-0.6181218 0. 0.19610636 0.40379167 0.22178088]
body_pos_w: Shape: (1375, 14, 3) Dtype: float32 Range: [-0.461, 1.258] Sample: [-5.8091094e-04 1.5418809e-02 7.8600091e-01 1.1273000e-01 3.0267565e-03]
body_quat_w: Shape: (1375, 14, 4) Dtype: float32 Range: [-0.707, 1.000] Sample: [-6.7035830e-01 -5.1285548e-04 -1.2871666e-02 7.4192578e-01 -6.7212301e-01]
body_lin_vel_w: Shape: (1375, 14, 3) Dtype: float32 Range: [-2.083, 2.181] Sample: [-0.07513097 0.0133487 -0.02677997 -0.09454302 0.01350545]
body_ang_vel_w: Shape: (1375, 14, 3) Dtype: float32 Range: [-16.576, 15.656] Sample: [-5.7085539e-04 1.4832462e-01 1.8231243e-01 -7.0407879e-01 -1.9635165e-01]
_body_indexes: Shape: (14,) Dtype: int64 Range: [0.000, 29.000] Sample: [ 0 4 10 18 5]
time_step_total: Shape: () Dtype: int64 Range: [1375.000, 1375.000] Sample: [1375]
1234567891011121314151617Metadata for: macarena_001__A545==============================
Body part indexes:[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
Total timesteps: 1375
Data arrays summary: joint_pos: (1375, 29) (float32) joint_vel: (1375, 29) (float32) body_pos_w: (1375, 14, 3) (float32) body_quat_w: (1375, 14, 4) (float32) body_lin_vel_w: (1375, 14, 3) (float32) body_ang_vel_w: (1375, 14, 3) (float32) _body_indexes: (14,) (int64) time_step_total: () (int64)12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152Motion Information: macarena_001__A545_M==================================================
joint_pos: Shape: (1375, 29) Dtype: float32 Range: [-1.752, 1.839] Sample: [-0.12627211 -0.1081429 0.04614829 -0.03699337 -0.17927563]
joint_vel: Shape: (1375, 29) Dtype: float32 Range: [-17.410, 16.353] Sample: [ 0. -0.6198224 -0.19615404 -0.22224468 -0.4047744 ]
body_pos_w: Shape: (1375, 14, 3) Dtype: float32 Range: [-0.428, 1.258] Sample: [5.7239551e-04 1.5415414e-02 7.8600442e-01 1.1899064e-01 2.5980033e-02]
body_quat_w: Shape: (1375, 14, 4) Dtype: float32 Range: [-0.707, 1.000] Sample: [ 7.4192613e-01 1.2869124e-02 5.1390840e-04 -6.7035794e-01 7.3185688e-01]
body_lin_vel_w: Shape: (1375, 14, 3) Dtype: float32 Range: [-1.572, 2.181] Sample: [ 0.07525253 0.0134165 -0.02684434 0.09596311 -0.00692309]
body_ang_vel_w: Shape: (1375, 14, 3) Dtype: float32 Range: [-15.288, 16.576] Sample: [-0.00054383 -0.14689815 -0.18050767 0.00343074 0.08365735]
_body_indexes: Shape: (14,) Dtype: int64 Range: [0.000, 29.000] Sample: [ 0 4 10 18 5]
time_step_total: Shape: () Dtype: int64 Range: [1375.000, 1375.000] Sample: [1375]
1234567891011121314151617Metadata for: macarena_001__A545_M==============================
Body part indexes:[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
Total timesteps: 1375
Data arrays summary: joint_pos: (1375, 29) (float32) joint_vel: (1375, 29) (float32) body_pos_w: (1375, 14, 3) (float32) body_quat_w: (1375, 14, 4) (float32) body_lin_vel_w: (1375, 14, 3) (float32) body_ang_vel_w: (1375, 14, 3) (float32) _body_indexes: (14,) (int64) time_step_total: () (int64)12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152Motion Information: neutral_kick_R_001__A543==================================================
joint_pos: Shape: (165, 29) Dtype: float32 Range: [-1.511, 2.231] Sample: [ 0.0102154 -0.02437789 -0.00672904 0.01929011 0.01479329]
joint_vel: Shape: (165, 29) Dtype: float32 Range: [-18.290, 20.364] Sample: [-0.20629734 -0.50493777 0. 0. -0.0665314 ]
body_pos_w: Shape: (165, 14, 3) Dtype: float32 Range: [-0.350, 1.138] Sample: [ 2.5986615e-04 -2.1045217e-03 7.8969425e-01 -1.1502424e-01 -9.6319402e-03]
body_quat_w: Shape: (165, 14, 4) Dtype: float32 Range: [-0.658, 0.962] Sample: [ 0.70344394 -0.01907959 0.01310167 0.7103738 0.7017253 ]
body_lin_vel_w: Shape: (165, 14, 3) Dtype: float32 Range: [-3.077, 4.037] Sample: [-0.00510128 -0.00777466 -0.01248983 -0.01428711 -0.00505795]
body_ang_vel_w: Shape: (165, 14, 3) Dtype: float32 Range: [-13.461, 10.895] Sample: [-0.18448198 0.06041717 -0.20089665 0.01372697 0.04333916]
_body_indexes: Shape: (14,) Dtype: int64 Range: [0.000, 29.000] Sample: [ 0 4 10 18 5]
time_step_total: Shape: () Dtype: int64 Range: [165.000, 165.000] Sample: [165]
1234567891011121314151617Metadata for: neutral_kick_R_001__A543==============================
Body part indexes:[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
Total timesteps: 165
Data arrays summary: joint_pos: (165, 29) (float32) joint_vel: (165, 29) (float32) body_pos_w: (165, 14, 3) (float32) body_quat_w: (165, 14, 4) (float32) body_lin_vel_w: (165, 14, 3) (float32) body_ang_vel_w: (165, 14, 3) (float32) _body_indexes: (14,) (int64) time_step_total: () (int64)12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152Motion Information: neutral_kick_R_001__A543_M==================================================
joint_pos: Shape: (165, 29) Dtype: float32 Range: [-1.511, 2.231] Sample: [-0.02438436 0.01020973 0.0067296 -0.01478768 -0.01928544]
joint_vel: Shape: (165, 29) Dtype: float32 Range: [-18.290, 20.364] Sample: [-0.5047629 -0.20612705 0. 0.06651222 0. ]
body_pos_w: Shape: (165, 14, 3) Dtype: float32 Range: [-0.351, 1.138] Sample: [-2.5653988e-04 -2.1049839e-03 7.8969407e-01 -1.1784680e-01 -6.2525691e-03]
body_quat_w: Shape: (165, 14, 4) Dtype: float32 Range: [-0.674, 0.962] Sample: [ 0.71037376 -0.0131016 0.01907985 0.703444 0.7091498 ]
body_lin_vel_w: Shape: (165, 14, 3) Dtype: float32 Range: [-3.077, 4.037] Sample: [ 0.00510508 -0.00776416 -0.01248534 0.01384882 -0.0365492 ]
body_ang_vel_w: Shape: (165, 14, 3) Dtype: float32 Range: [-10.156, 13.797] Sample: [-0.18570669 -0.06071702 0.20189351 0.40606773 0.00312011]
_body_indexes: Shape: (14,) Dtype: int64 Range: [0.000, 29.000] Sample: [ 0 4 10 18 5]
time_step_total: Shape: () Dtype: int64 Range: [165.000, 165.000] Sample: [165]
1234567891011121314151617Metadata for: neutral_kick_R_001__A543_M==============================
Body part indexes:[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
Total timesteps: 165
Data arrays summary: joint_pos: (165, 29) (float32) joint_vel: (165, 29) (float32) body_pos_w: (165, 14, 3) (float32) body_quat_w: (165, 14, 4) (float32) body_lin_vel_w: (165, 14, 3) (float32) body_ang_vel_w: (165, 14, 3) (float32) _body_indexes: (14,) (int64) time_step_total: () (int64)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051Motion Information: squat_001__A359==================================================
joint_pos: Shape: (424, 29) Dtype: float32 Range: [-2.215, 2.576] Sample: [ 0.15727139 0.15096666 0.04344312 -0.00495214 0.00737908]
joint_vel: Shape: (424, 29) Dtype: float32 Range: [-4.688, 4.380] Sample: [0.06294921 0.07401705 0. 0. 0. ]
body_pos_w: Shape: (424, 14, 3) Dtype: float32 Range: [-0.364, 1.085] Sample: [-0.00253593 0.01265665 0.79256266 0.11277536 0.00799088]
body_quat_w: Shape: (424, 14, 4) Dtype: float32 Range: [-0.707, 0.778] Sample: [ 0.7121807 -0.03302116 -0.02697971 -0.70069987 0.711816 ]
body_lin_vel_w: Shape: (424, 14, 3) Dtype: float32 Range: [-1.232, 1.069] Sample: [-0.00345908 0.01068808 0.00030054 -0.00323385 0.01278332]
body_ang_vel_w: Shape: (424, 14, 3) Dtype: float32 Range: [-4.028, 3.743] Sample: [ 0.00429551 -0.00147157 0.01170849 -0.00151611 -0.00085008]
_body_indexes: Shape: (14,) Dtype: int64 Range: [0.000, 29.000] Sample: [ 0 4 10 18 5]
time_step_total: Shape: () Dtype: int64 Range: [424.000, 424.000] Sample: [424]
1234567891011121314151617Metadata for: squat_001__A359==============================
Body part indexes:[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
Total timesteps: 424
Data arrays summary: joint_pos: (424, 29) (float32) joint_vel: (424, 29) (float32) body_pos_w: (424, 14, 3) (float32) body_quat_w: (424, 14, 4) (float32) body_lin_vel_w: (424, 14, 3) (float32) body_ang_vel_w: (424, 14, 3) (float32) _body_indexes: (14,) (int64) time_step_total: () (int64)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051Motion Information: tired_forward_lunge_R_001__A359_M==================================================
joint_pos: Shape: (810, 29) Dtype: float32 Range: [-1.681, 2.251] Sample: [ 0.10455281 0.12311819 -0.13420933 0.0210929 0.01301001]
joint_vel: Shape: (810, 29) Dtype: float32 Range: [-29.172, 24.785] Sample: [0. 0. 0. 0. 0.]
body_pos_w: Shape: (810, 14, 3) Dtype: float32 Range: [-0.830, 1.122] Sample: [ 0.00363829 0.01252624 0.78668284 0.11977606 -0.00450246]
body_quat_w: Shape: (810, 14, 4) Dtype: float32 Range: [-0.707, 0.968] Sample: [-0.6985865 0.04820039 0.04724668 0.71233517 -0.6972264 ]
body_lin_vel_w: Shape: (810, 14, 3) Dtype: float32 Range: [-2.633, 2.705] Sample: [ 0.00514652 -0.0242208 0.00147181 0.0059143 -0.02151402]
body_ang_vel_w: Shape: (810, 14, 3) Dtype: float32 Range: [-9.584, 12.844] Sample: [ 0.01855543 -0.00674082 0.00205783 0.04113024 0.00938711]
_body_indexes: Shape: (14,) Dtype: int64 Range: [0.000, 29.000] Sample: [ 0 4 10 18 5]
time_step_total: Shape: () Dtype: int64 Range: [810.000, 810.000] Sample: [810]
1234567891011121314151617Metadata for: tired_forward_lunge_R_001__A359_M==============================
Body part indexes:[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
Total timesteps: 810
Data arrays summary: joint_pos: (810, 29) (float32) joint_vel: (810, 29) (float32) body_pos_w: (810, 14, 3) (float32) body_quat_w: (810, 14, 4) (float32) body_lin_vel_w: (810, 14, 3) (float32) body_ang_vel_w: (810, 14, 3) (float32) _body_indexes: (14,) (int64) time_step_total: () (int64)1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253Motion Information: tired_one_leg_jumping_R_001__A359==================================================
joint_pos: Shape: (500, 29) Dtype: float32 Range: [-2.466, 2.544] Sample: [ 0.19818522 0.18190861 0.05533926 -0.01394359 0.01180514]
joint_vel: Shape: (500, 29) Dtype: float32 Range: [-24.277, 29.521] Sample: [0.08117855 0.10404438 0. 0. 0. ]
body_pos_w: Shape: (500, 14, 3) Dtype: float32 Range: [-0.638, 1.389] Sample: [-3.7561040e-03 1.1930190e-02 7.9080468e-01 1.1164543e-01 -1.8159859e-04]
body_quat_w: Shape: (500, 14, 4) Dtype: float32 Range: [-0.707, 0.994] Sample: [-0.7018543 0.04748023 0.04207473 0.7094899 -0.7020061 ]
body_lin_vel_w: Shape: (500, 14, 3) Dtype: float32 Range: [-2.468, 3.083] Sample: [-0.00731237 0.00322476 -0.00184366 -0.0072301 0.0033868 ]
body_ang_vel_w: Shape: (500, 14, 3) Dtype: float32 Range: [-13.765, 14.489] Sample: [-2.3229383e-02 9.2615977e-05 7.7703241e-03 3.2781955e-02 -2.4797707e-03]
_body_indexes: Shape: (14,) Dtype: int64 Range: [0.000, 29.000] Sample: [ 0 4 10 18 5]
time_step_total: Shape: () Dtype: int64 Range: [500.000, 500.000] Sample: [500]
1234567891011121314151617Metadata for: tired_one_leg_jumping_R_001__A359==============================
Body part indexes:[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
Total timesteps: 500
Data arrays summary: joint_pos: (500, 29) (float32) joint_vel: (500, 29) (float32) body_pos_w: (500, 14, 3) (float32) body_quat_w: (500, 14, 4) (float32) body_lin_vel_w: (500, 14, 3) (float32) body_ang_vel_w: (500, 14, 3) (float32) _body_indexes: (14,) (int64) time_step_total: () (int64)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051Motion Information: tired_one_leg_jumping_R_001__A359_M==================================================
joint_pos: Shape: (500, 29) Dtype: float32 Range: [-2.466, 2.544] Sample: [ 0.18195386 0.19815134 -0.05533458 -0.01181217 0.01394258]
joint_vel: Shape: (500, 29) Dtype: float32 Range: [-25.521, 29.521] Sample: [0.10270029 0.0821501 0. 0. 0. ]
body_pos_w: Shape: (500, 14, 3) Dtype: float32 Range: [-0.638, 1.389] Sample: [0.00375429 0.0119299 0.7908045 0.12123838 0.00211857]
body_quat_w: Shape: (500, 14, 4) Dtype: float32 Range: [-0.707, 0.994] Sample: [ 0.70963436 -0.04173436 -0.04712047 -0.7017528 0.709552 ]
body_lin_vel_w: Shape: (500, 14, 3) Dtype: float32 Range: [-2.468, 3.083] Sample: [ 0.00727609 0.00323505 -0.00185661 0.00736587 -0.00425211]
body_ang_vel_w: Shape: (500, 14, 3) Dtype: float32 Range: [-14.474, 12.502] Sample: [-0.04819455 -0.00166482 -0.01665068 0.0203299 0.0001879 ]
_body_indexes: Shape: (14,) Dtype: int64 Range: [0.000, 29.000] Sample: [ 0 4 10 18 5]
time_step_total: Shape: () Dtype: int64 Range: [500.000, 500.000] Sample: [500]
1234567891011121314151617Metadata for: tired_one_leg_jumping_R_001__A359_M==============================
Body part indexes:[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
Total timesteps: 500
Data arrays summary: joint_pos: (500, 29) (float32) joint_vel: (500, 29) (float32) body_pos_w: (500, 14, 3) (float32) body_quat_w: (500, 14, 4) (float32) body_lin_vel_w: (500, 14, 3) (float32) body_ang_vel_w: (500, 14, 3) (float32) _body_indexes: (14,) (int64) time_step_total: () (int64)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051Motion Information: walking_quip_360_R_002__A428==================================================
joint_pos: Shape: (455, 29) Dtype: float32 Range: [-1.350, 1.403] Sample: [ 0.0239802 0.01111414 -0.06473327 0.01455649 -0.05278705]
joint_vel: Shape: (455, 29) Dtype: float32 Range: [-10.128, 10.542] Sample: [ 0. -0.06379467 0. 0. 0. ]
body_pos_w: Shape: (455, 14, 3) Dtype: float32 Range: [-5.178, 1.205] Sample: [0.00238936 0.01172794 0.7911665 0.11803366 0.01129898]
body_quat_w: Shape: (455, 14, 4) Dtype: float32 Range: [-0.707, 0.993] Sample: [ 0.7112312 -0.00883037 -0.00456219 -0.70288795 0.7092943 ]
body_lin_vel_w: Shape: (455, 14, 3) Dtype: float32 Range: [-2.853, 1.454] Sample: [-0.00302621 0.01039287 0.0045207 -0.00268457 0.01099243]
body_ang_vel_w: Shape: (455, 14, 3) Dtype: float32 Range: [-10.792, 10.693] Sample: [ 0.00032408 -0.00011129 0.00044492 -0.00352303 0.0018626 ]
_body_indexes: Shape: (14,) Dtype: int64 Range: [0.000, 29.000] Sample: [ 0 4 10 18 5]
time_step_total: Shape: () Dtype: int64 Range: [455.000, 455.000] Sample: [455]
1234567891011121314151617Metadata for: walking_quip_360_R_002__A428==============================
Body part indexes:[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
Total timesteps: 455
Data arrays summary: joint_pos: (455, 29) (float32) joint_vel: (455, 29) (float32) body_pos_w: (455, 14, 3) (float32) body_quat_w: (455, 14, 4) (float32) body_lin_vel_w: (455, 14, 3) (float32) body_ang_vel_w: (455, 14, 3) (float32) _body_indexes: (14,) (int64) time_step_total: () (int64)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051Motion Information: walking_quip_360_R_002__A428_M==================================================
joint_pos: Shape: (455, 29) Dtype: float32 Range: [-1.003, 1.403] Sample: [ 0.01109954 0.02397734 0.06473204 0.05247362 -0.01430147]
joint_vel: Shape: (455, 29) Dtype: float32 Range: [-10.128, 10.542] Sample: [-0.06343862 0. 0. 0. 0. ]
body_pos_w: Shape: (455, 14, 3) Dtype: float32 Range: [-5.178, 1.205] Sample: [-0.00239508 0.01172869 0.7911661 0.1148396 0.00817287]
body_quat_w: Shape: (455, 14, 4) Dtype: float32 Range: [-0.707, 0.993] Sample: [-0.702888 0.00456196 0.00883033 0.7112312 -0.70121443]
body_lin_vel_w: Shape: (455, 14, 3) Dtype: float32 Range: [-2.853, 1.454] Sample: [0.00306987 0.01037478 0.00453062 0.00270815 0.00906713]
body_ang_vel_w: Shape: (455, 14, 3) Dtype: float32 Range: [-10.691, 10.791] Sample: [ 0.0003236 0.00011099 -0.00044414 -0.02917245 0.00046786]
_body_indexes: Shape: (14,) Dtype: int64 Range: [0.000, 29.000] Sample: [ 0 4 10 18 5]
time_step_total: Shape: () Dtype: int64 Range: [455.000, 455.000] Sample: [455]
1234567891011121314151617Metadata for: walking_quip_360_R_002__A428_M==============================
Body part indexes:[ 0 4 10 18 5 11 19 9 16 22 28 17 23 29]
Total timesteps: 455
Data arrays summary: joint_pos: (455, 29) (float32) joint_vel: (455, 29) (float32) body_pos_w: (455, 14, 3) (float32) body_quat_w: (455, 14, 4) (float32) body_lin_vel_w: (455, 14, 3) (float32) body_ang_vel_w: (455, 14, 3) (float32) _body_indexes: (14,) (int64) time_step_total: () (int64)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926#!/bin/bash
set -e
echo "🚀 Installing G1 Deploy system dependencies..."sudo apt-get update && sudo apt-get install -y libgtest-dev
# Detect system type and architectureARCH=$(uname -m)OS_ID=$(lsb_release -si 2>/dev/null || echo "Unknown")OS_VERSION=$(lsb_release -sr 2>/dev/null || echo "Unknown")
# Common CUDA installation paths (used by multiple functions)CUDA_PATHS=( "/usr/local/cuda" "/usr/local/cuda-12.6" # CUDA 12.6 on newer Jetson "/usr/local/cuda-12.5" # CUDA 12.5 variant "/usr/local/cuda-12.4" # CUDA 12.4 variant "/usr/local/cuda-12" # Generic CUDA 12.x "/usr/local/cuda-11.4" # Common on older Jetson "/usr/local/cuda-10.2" # Common on older Jetson "/usr/local/cuda-11" "/usr/local/cuda-10" "/opt/cuda" "/usr/cuda")
# Common CUDA runtime library paths (used by multiple functions)CUDA_RUNTIME_PATHS=( "/usr/local/cuda/lib64/libcudart.so" "/usr/local/cuda-12.6/lib64/libcudart.so" "/usr/local/cuda-12.5/lib64/libcudart.so" "/usr/local/cuda-12.4/lib64/libcudart.so" "/usr/local/cuda-12/lib64/libcudart.so" "/usr/local/cuda-11.4/lib64/libcudart.so" "/usr/local/cuda-10.2/lib64/libcudart.so" "/usr/lib/aarch64-linux-gnu/libcudart.so" "/usr/lib/x86_64-linux-gnu/libcudart.so" "/usr/lib64/libcudart.so" "/usr/lib/libcudart.so")
# Common CUDA header paths (used by multiple functions)CUDA_HEADER_PATHS=( "/usr/local/cuda/include/cuda_runtime.h" "/usr/local/cuda-12.6/include/cuda_runtime.h" "/usr/local/cuda-12.5/include/cuda_runtime.h" "/usr/local/cuda-12.4/include/cuda_runtime.h" "/usr/local/cuda-12/include/cuda_runtime.h" "/usr/local/cuda-11.4/include/cuda_runtime.h" "/usr/local/cuda-10.2/include/cuda_runtime.h" "/usr/local/cuda-11/include/cuda_runtime.h" "/usr/include/cuda_runtime.h" "/usr/include/cuda/cuda_runtime.h")
# Common utility functionshas_cuda_in_ldconfig() { ldconfig -p 2>/dev/null | grep -q "libcudart\|libcuda"}
# Update package cache (with deduplication)update_package_cache() { if [ "$PACKAGE_MANAGER" = "apt" ] && [ "$APT_UPDATED" != "true" ]; then sudo apt-get update export APT_UPDATED="true" fi}
# Enhanced Jetson detectionIS_JETSON=falseJETSON_MODEL=""
if [[ "$ARCH" == "aarch64" ]]; then # Check for Jetson-specific indicators if [[ -f "/etc/nv_tegra_release" ]] || \ [[ -d "/usr/src/jetson_multimedia_api" ]] || \ ls /etc/apt/sources.list.d/ 2>/dev/null | grep -q jetson || \ [[ -f "/proc/device-tree/model" && $(cat /proc/device-tree/model 2>/dev/null) =~ "Jetson" ]]; then IS_JETSON=true # Detect Jetson model for optimized package selection if [[ -f "/proc/device-tree/model" ]]; then JETSON_MODEL=$(cat /proc/device-tree/model 2>/dev/null | tr -d '\0' | sed 's/NVIDIA //') echo "🤖 Jetson system detected: $JETSON_MODEL" else echo "🤖 Jetson system detected (model unknown)" fi # Check JetPack version if available if command -v jetson_release &> /dev/null; then JETPACK_VERSION=$(jetson_release -v 2>/dev/null | grep "JETPACK" | cut -d' ' -f2 || echo "unknown") echo "📦 JetPack version: $JETPACK_VERSION" fi fifi
echo "🔍 System: $OS_ID $OS_VERSION ($ARCH)$([ "$IS_JETSON" = true ] && echo " - Jetson")"
# Detect the operating system and package managerif command -v apt-get &> /dev/null; then PACKAGE_MANAGER="apt"elif command -v yum &> /dev/null; then PACKAGE_MANAGER="yum"elif command -v pacman &> /dev/null; then PACKAGE_MANAGER="pacman"else echo "❌ Unsupported package manager. This script supports apt, yum, and pacman." exit 1fi
# Function to install packages based on the package managerinstall_packages() { case $PACKAGE_MANAGER in apt) update_package_cache sudo apt-get install -y "$@" ;; yum) sudo yum install -y "$@" ;; pacman) sudo pacman -S --noconfirm "$@" ;; esac}
echo "📦 Installing base development tools..."case $PACKAGE_MANAGER in apt) if [ "$IS_JETSON" = true ]; then echo "🤖 Installing packages optimized for Jetson system..." # Jetson systems may have some tools pre-installed JETSON_PACKAGES="build-essential clang cmake git git-lfs pkg-config patchelf zlib1g-dev curl wget" # Add optional packages if available if apt-cache show cmake-format &>/dev/null; then JETSON_PACKAGES="$JETSON_PACKAGES cmake-format" fi if apt-cache show cppcheck &>/dev/null; then JETSON_PACKAGES="$JETSON_PACKAGES cppcheck" fi install_packages $JETSON_PACKAGES else install_packages \ build-essential \ clang \ cmake \ cmake-format \ cppcheck \ git \ git-lfs \ pkg-config \ patchelf \ zlib1g-dev \ curl \ wget fi ;; yum) install_packages \ gcc \ gcc-c++ \ clang \ cmake \ cppcheck \ git \ git-lfs \ pkgconfig \ patchelf \ zlib-devel \ curl \ wget ;; pacman) install_packages \ base-devel \ clang \ cmake \ cppcheck \ git \ git-lfs \ pkgconf \ patchelf \ zlib \ curl \ wget ;;esac
echo "📚 Installing C++ libraries..."case $PACKAGE_MANAGER in apt) install_packages \ libyaml-cpp-dev \ libeigen3-dev \ libmsgpack-dev \ libzmq3-dev \ nlohmann-json3-dev \ libgtest-dev ;; yum) install_packages \ yaml-cpp-devel \ eigen3-devel \ msgpack-devel \ zeromq-devel \ cppzmq-devel \ nlohmann-json-devel \ gtest-devel ;; pacman) install_packages \ yaml-cpp \ eigen \ msgpack-cxx \ zeromq \ cppzmq \ nlohmann-json \ gtest ;;esac
# Ensure ZeroMQ C++ headers (cppzmq) are available.# On some Ubuntu releases (e.g., 24.04), the 'cppzmq' or 'libcppzmq-dev' package may be missing.# If not found, vendor the header-only repo to third_party/cppzmq.echo "🧩 Ensuring ZeroMQ C++ headers (cppzmq)..."
# Resolve repository root relative to this scriptSCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"THIRD_PARTY_DIR="$REPO_ROOT/third_party"
have_cppzmq_header=falseif [ -f "/usr/include/zmq.hpp" ]; then have_cppzmq_header=truefi
if [ "$have_cppzmq_header" = false ]; then if [ "$PACKAGE_MANAGER" = "apt" ]; then # Try distro packages if available if apt-cache policy cppzmq 2>/dev/null | grep -q "Candidate:" && \ ! apt-cache policy cppzmq 2>/dev/null | grep -q "(none)"; then update_package_cache if sudo apt-get install -y cppzmq; then have_cppzmq_header=true fi elif apt-cache policy libcppzmq-dev 2>/dev/null | grep -q "Candidate:" && \ ! apt-cache policy libcppzmq-dev 2>/dev/null | grep -q "(none)"; then update_package_cache if sudo apt-get install -y libcppzmq-dev; then have_cppzmq_header=true fi fi fifi
if [ "$have_cppzmq_header" = false ]; then echo "📦 Vendoring header-only cppzmq into third_party..." mkdir -p "$THIRD_PARTY_DIR" if [ ! -d "$THIRD_PARTY_DIR/cppzmq/.git" ]; then if git clone --depth 1 https://github.com/zeromq/cppzmq.git "$THIRD_PARTY_DIR/cppzmq"; then echo "✅ cppzmq headers cloned to $THIRD_PARTY_DIR/cppzmq" echo " Add include path: -I$THIRD_PARTY_DIR/cppzmq" else echo "❌ Failed to clone cppzmq repo. Please install headers manually." fi else if git -C "$THIRD_PARTY_DIR/cppzmq" pull --ff-only; then echo "✅ cppzmq headers updated in $THIRD_PARTY_DIR/cppzmq" else echo "⚠️ Failed to update cppzmq headers. Using existing copy." fi fielse echo "✅ ZeroMQ C++ headers found in system includes"fi
# Ensure JSON headers (nlohmann/json) are available (similar to cppzmq ensure)echo "🧩 Ensuring JSON headers (nlohmann/json)..."
have_json_header=falseif [ -f "/usr/include/nlohmann/json.hpp" ] || [ -f "/usr/local/include/nlohmann/json.hpp" ]; then have_json_header=truefi
if [ "$have_json_header" = false ]; then case $PACKAGE_MANAGER in apt) update_package_cache sudo apt-get install -y nlohmann-json3-dev || true ;; yum) sudo yum install -y nlohmann-json-devel || true ;; pacman) sudo pacman -S --noconfirm nlohmann-json || true ;; esac if [ -f "/usr/include/nlohmann/json.hpp" ] || [ -f "/usr/local/include/nlohmann/json.hpp" ]; then have_json_header=true fifi
if [ "$have_json_header" = false ]; then echo "📦 Vendoring nlohmann/json into third_party..." # Reuse THIRD_PARTY_DIR from earlier cppzmq ensure block if set; otherwise define if [ -z "$THIRD_PARTY_DIR" ]; then SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" THIRD_PARTY_DIR="$REPO_ROOT/third_party" fi mkdir -p "$THIRD_PARTY_DIR" if [ ! -d "$THIRD_PARTY_DIR/nlohmann_json/.git" ]; then if git clone --depth 1 https://github.com/nlohmann/json.git "$THIRD_PARTY_DIR/nlohmann_json"; then echo "✅ nlohmann/json cloned to $THIRD_PARTY_DIR/nlohmann_json" echo " Add include path: -I$THIRD_PARTY_DIR/nlohmann_json/single_include" else echo "❌ Failed to clone nlohmann/json. Please install headers manually." fi else if git -C "$THIRD_PARTY_DIR/nlohmann_json" pull --ff-only; then echo "✅ nlohmann/json updated in $THIRD_PARTY_DIR/nlohmann_json" else echo "⚠️ Failed to update nlohmann/json. Using existing copy." fi fielse echo "✅ JSON headers found in system includes"fi
# Install Just command runnerecho "⚡ Installing Just command runner..."if ! command -v just &> /dev/null; then case $PACKAGE_MANAGER in apt|yum) # Install Just from GitHub releases for Ubuntu/Debian and RHEL/CentOS JUST_VERSION="1.43.0" JUST_ARCH=$(uname -m) # Map architecture names to just release naming case $JUST_ARCH in x86_64) JUST_ARCH_NAME="x86_64-unknown-linux-musl" ;; aarch64|arm64) JUST_ARCH_NAME="aarch64-unknown-linux-musl" ;; armv7l) JUST_ARCH_NAME="armv7-unknown-linux-musleabihf" ;; arm*) JUST_ARCH_NAME="arm-unknown-linux-musleabihf" ;; *) echo "❌ Unsupported architecture for just: $JUST_ARCH" echo " Supported architectures: x86_64, aarch64, armv7l, arm" exit 1 ;; esac echo "📥 Downloading Just ${JUST_VERSION} for ${JUST_ARCH}..." JUST_URL="https://github.com/casey/just/releases/download/${JUST_VERSION}/just-${JUST_VERSION}-${JUST_ARCH_NAME}.tar.gz" curl -L "$JUST_URL" | tar xz -C /tmp sudo mv /tmp/just /usr/local/bin/ ;; pacman) install_packages just ;; esacelse echo "✅ Just is already installed"fi
# Install ONNX Runtimeecho "🧠 Setting up ONNX Runtime..."
# Allow configurable installation pathONNX_INSTALL_PATH="${ONNX_INSTALL_PATH:-/opt/onnxruntime}"
if [ ! -d "$ONNX_INSTALL_PATH" ]; then ONNX_VERSION="1.16.3" ONNX_ARCH=$(uname -m) if [ "$ONNX_ARCH" = "x86_64" ]; then ONNX_URL="https://github.com/microsoft/onnxruntime/releases/download/v${ONNX_VERSION}/onnxruntime-linux-x64-${ONNX_VERSION}.tgz" elif [ "$ONNX_ARCH" = "aarch64" ]; then # Same URL for all ARM64 systems (Jetson and regular ARM64) ONNX_URL="https://github.com/microsoft/onnxruntime/releases/download/v${ONNX_VERSION}/onnxruntime-linux-aarch64-${ONNX_VERSION}.tgz" if [ "$IS_JETSON" = true ]; then echo "🤖 Jetson system detected - using ARM64 ONNX Runtime..." fi else echo "❌ Unsupported architecture: $ONNX_ARCH" exit 1 fi echo "📥 Downloading ONNX Runtime ${ONNX_VERSION} for ${ONNX_ARCH}$([ "$IS_JETSON" = true ] && echo " (Jetson-optimized)")..." cd /tmp # Download with retry for Jetson systems (sometimes have slower network) if [ "$IS_JETSON" = true ]; then curl -L --retry 3 --retry-delay 2 "$ONNX_URL" -o onnxruntime.tgz else curl -L "$ONNX_URL" -o onnxruntime.tgz fi tar xzf onnxruntime.tgz # Move to configured location (may need sudo for system paths) ONNX_DIR=$(ls -d onnxruntime-linux-* | head -n1) if [[ "$ONNX_INSTALL_PATH" =~ ^(/opt|/usr) ]]; then # System path - needs sudo sudo mv "$ONNX_DIR" "$ONNX_INSTALL_PATH" sudo ln -sf "$ONNX_INSTALL_PATH/lib/libonnxruntime.so" /usr/local/lib/ 2>/dev/null || true sudo ln -sf "$ONNX_INSTALL_PATH/include" /usr/local/include/onnxruntime 2>/dev/null || true echo "$ONNX_INSTALL_PATH/lib" | sudo tee /etc/ld.so.conf.d/onnxruntime.conf sudo ldconfig else # User path - no sudo needed mv "$ONNX_DIR" "$ONNX_INSTALL_PATH" # Create user-accessible symlinks if possible if [ -w /usr/local/lib ]; then ln -sf "$ONNX_INSTALL_PATH/lib/libonnxruntime.so" /usr/local/lib/ 2>/dev/null || true fi fi # For Jetson systems, add to environment if [ "$IS_JETSON" = true ]; then echo "# ONNX Runtime for Jetson" | sudo tee -a /etc/environment echo "LD_LIBRARY_PATH=\"$ONNX_INSTALL_PATH/lib:\$LD_LIBRARY_PATH\"" | sudo tee -a /etc/environment fi echo "✅ ONNX Runtime installed to $ONNX_INSTALL_PATH$([ "$IS_JETSON" = true ] && echo " with Jetson optimizations")"else echo "✅ ONNX Runtime is already installed at $ONNX_INSTALL_PATH"fi
echo "💡 To install to a different location, set ONNX_INSTALL_PATH environment variable"
# Function to check for CUDA toolkit (nvcc compiler) - silent checkcheck_cuda_toolkit() { # Check for nvcc in PATH if command -v nvcc &> /dev/null; then return 0 fi # Check common CUDA installation paths (using shared variable) for cuda_path in "${CUDA_PATHS[@]}"; do if [ -f "$cuda_path/bin/nvcc" ]; then return 0 fi done return 1}
# Function to check for CUDA runtime libraries AND headers (needed for compilation)check_cuda_runtime() { # Check for CUDA runtime libraries local has_libraries=false if has_cuda_in_ldconfig; then has_libraries=true else # Check specific paths for runtime libraries (using shared variable) for lib_path in "${CUDA_RUNTIME_PATHS[@]}"; do if [ -f "$lib_path" ]; then has_libraries=true break fi done fi # Check for CUDA headers (essential for compilation) - using shared variable local has_headers=false for header_path in "${CUDA_HEADER_PATHS[@]}"; do if [ -f "$header_path" ]; then has_headers=true break fi done # Need both libraries and headers if [ "$has_libraries" = true ] && [ "$has_headers" = true ]; then return 0 else return 1 fi}
# Check what CUDA components we have and provide clear, non-confusing outputecho "🔍 Checking CUDA installation..."
# Function to handle non-Jetson ARM64 systems install_cuda_for_arm64() { echo "🔧 Installing CUDA packages for ARM64 system..." if sudo apt-get install -y cuda-cudart-dev-12-2 cuda-runtime-12-2 2>/dev/null || \ sudo apt-get install -y cuda-cudart-dev-11-8 cuda-runtime-11-8 2>/dev/null || \ sudo apt-get install -y libcudart-dev nvidia-cuda-runtime-cu12 2>/dev/null; then echo "✅ CUDA runtime and development packages installed for ARM64!" return 0 else echo "❌ Failed to install CUDA packages for ARM64 system" return 1 fi}
# Function to handle x86_64 systemsinstall_cuda_for_x86_64() { echo "🔧 Installing CUDA packages for x86_64 system..." # Detect CUDA version from nvidia-smi if available local DETECTED_CUDA_VERSION="" if command -v nvidia-smi &> /dev/null; then DETECTED_CUDA_VERSION=$(nvidia-smi | grep "CUDA Version:" | sed 's/.*CUDA Version: \([0-9]\+\.[0-9]\+\).*/\1/' | head -n1) if [ -n "$DETECTED_CUDA_VERSION" ]; then echo "📍 Detected CUDA $DETECTED_CUDA_VERSION from nvidia-smi" fi fi # Check if NVIDIA CUDA repository is configured local has_cuda_repo=false if [ -f /etc/apt/sources.list.d/cuda*.list ] || \ grep -r "developer.download.nvidia.com/compute/cuda" /etc/apt/sources.list* &>/dev/null; then has_cuda_repo=true fi # Add NVIDIA CUDA repository if not present if [ "$has_cuda_repo" = false ]; then echo "📦 NVIDIA CUDA repository not found, adding it now..." # Detect Ubuntu version for correct repository local ubuntu_version="" if [ "$OS_ID" = "Ubuntu" ]; then case "$OS_VERSION" in 22.04) ubuntu_version="ubuntu2204" ;; 20.04) ubuntu_version="ubuntu2004" ;; 24.04) ubuntu_version="ubuntu2404" ;; *) # Default to 22.04 for unknown versions ubuntu_version="ubuntu2204" echo "⚠️ Ubuntu $OS_VERSION detected, using ubuntu2204 repository (may need adjustment)" ;; esac else ubuntu_version="ubuntu2204" echo "⚠️ Non-Ubuntu system detected, using ubuntu2204 repository (may not work)" fi # Download and install CUDA keyring local cuda_keyring_url="https://developer.download.nvidia.com/compute/cuda/repos/${ubuntu_version}/x86_64/cuda-keyring_1.1-1_all.deb" if [ -f /tmp/cuda-keyring.deb ]; then rm /tmp/cuda-keyring.deb fi echo "📥 Downloading CUDA repository keyring for $ubuntu_version..." if wget -q "$cuda_keyring_url" -O /tmp/cuda-keyring.deb 2>/dev/null; then if sudo dpkg -i /tmp/cuda-keyring.deb 2>/dev/null; then echo "✅ NVIDIA CUDA repository keyring installed" # Force apt-get update after adding new repository echo "🔄 Updating package cache with new CUDA repository..." sudo apt-get update has_cuda_repo=true else echo "⚠️ Failed to install CUDA keyring" fi rm -f /tmp/cuda-keyring.deb else echo "⚠️ Failed to download CUDA keyring from $cuda_keyring_url" fi # If keyring install failed, provide manual instructions if [ "$has_cuda_repo" = false ]; then echo "" echo "⚠️ Automatic CUDA repository setup failed. Please add it manually:" echo " wget https://developer.download.nvidia.com/compute/cuda/repos/${ubuntu_version}/x86_64/cuda-keyring_1.1-1_all.deb" echo " sudo dpkg -i cuda-keyring_1.1-1_all.deb" echo " sudo apt-get update" echo "" fi else echo "✅ NVIDIA CUDA repository already configured" fi # Try to install CUDA packages - prioritize detected version local cuda_installed=false if [ -n "$DETECTED_CUDA_VERSION" ]; then # Convert version like "12.4" to package suffix like "12-4" local version_suffix=$(echo "$DETECTED_CUDA_VERSION" | sed 's/\./-/') echo "🎯 Attempting to install CUDA $DETECTED_CUDA_VERSION packages..." # IMPORTANT: We need BOTH cuda-compiler (for complete headers) AND cuda-cudart-dev (for runtime) # Try to install both together first echo "📦 Installing cuda-compiler-${version_suffix} and cuda-cudart-dev-${version_suffix}..." if sudo apt-get install -y cuda-compiler-${version_suffix} cuda-cudart-dev-${version_suffix}; then echo "✅ CUDA $DETECTED_CUDA_VERSION compiler and runtime development packages installed!" cuda_installed=true else # If combined install fails, try separately echo "⚠️ Combined install failed, trying packages separately..." local compiler_installed=false local cudart_installed=false if sudo apt-get install -y cuda-compiler-${version_suffix}; then echo "✅ cuda-compiler-${version_suffix} installed" compiler_installed=true else echo "❌ Failed to install cuda-compiler-${version_suffix}" fi if sudo apt-get install -y cuda-cudart-dev-${version_suffix}; then echo "✅ cuda-cudart-dev-${version_suffix} installed" cudart_installed=true else echo "❌ Failed to install cuda-cudart-dev-${version_suffix}" fi if [ "$compiler_installed" = true ] || [ "$cudart_installed" = true ]; then if [ "$compiler_installed" = false ]; then echo "⚠️ Warning: cuda-compiler not installed - headers may be incomplete!" fi if [ "$cudart_installed" = false ]; then echo "⚠️ Warning: cuda-cudart-dev not installed - runtime dev files missing!" fi cuda_installed=true fi fi # If version-specific install failed, try toolkit if [ "$cuda_installed" = false ]; then echo "📦 Trying cuda-toolkit-${version_suffix} as fallback..." if sudo apt-get install -y cuda-toolkit-${version_suffix}; then echo "✅ CUDA $DETECTED_CUDA_VERSION toolkit installed!" cuda_installed=true fi fi fi # Fall back to trying various package names if version-specific install failed if [ "$cuda_installed" = false ]; then echo "🔄 Trying generic CUDA package installation..." # List available CUDA packages for debugging echo "🔍 Checking available CUDA packages..." local available_cuda_pkgs=$(apt-cache search "^cuda-cudart-dev" 2>/dev/null | head -5) if [ -n "$available_cuda_pkgs" ]; then echo " Found packages:" echo "$available_cuda_pkgs" | sed 's/^/ /' fi # Try installing with specific version numbers first, then fall back to generic # Always try to get both compiler (for headers) and cudart-dev (for runtime) if sudo apt-get install -y cuda-compiler-12-4 cuda-cudart-dev-12-4; then echo "✅ CUDA 12.4 compiler and runtime development installed!" cuda_installed=true elif sudo apt-get install -y cuda-compiler-12-6 cuda-cudart-dev-12-6; then echo "✅ CUDA 12.6 compiler and runtime development installed!" cuda_installed=true elif sudo apt-get install -y cuda-compiler-12-2 cuda-cudart-dev-12-2; then echo "✅ CUDA 12.2 compiler and runtime development installed!" cuda_installed=true elif sudo apt-get install -y cuda-compiler-12-0 cuda-cudart-dev-12-0; then echo "✅ CUDA 12.0 compiler and runtime development installed!" cuda_installed=true elif sudo apt-get install -y cuda-toolkit-12-4; then echo "✅ CUDA 12.4 toolkit installed!" cuda_installed=true elif sudo apt-get install -y cuda-toolkit-12-6; then echo "✅ CUDA 12.6 toolkit installed!" cuda_installed=true elif sudo apt-get install -y cuda-toolkit; then echo "✅ CUDA toolkit (latest) installed!" cuda_installed=true elif sudo apt-get install -y cuda; then echo "✅ CUDA (full package) installed!" cuda_installed=true fi fi if [ "$cuda_installed" = true ]; then return 0 else echo "❌ Failed to install CUDA packages for x86_64 system" echo " 💡 You may need to manually install CUDA toolkit from:" echo " https://developer.nvidia.com/cuda-downloads" return 1 fi}
# CUDA detection and installation - optimized for Jetson systemsinstall_cuda_for_jetson() { echo "🚀 Installing CUDA development packages for Jetson..." # First, try to install CUDA development headers for existing CUDA installation local success=false # Check if we can install from JetPack repositories (try newer versions first) if sudo apt-get install -y nvidia-jetpack-dev 2>/dev/null; then echo "✅ JetPack development packages installed!" success=true elif sudo apt-get install -y cuda-toolkit-12-6-dev 2>/dev/null || \ sudo apt-get install -y cuda-toolkit-12-5-dev 2>/dev/null || \ sudo apt-get install -y cuda-toolkit-12-4-dev 2>/dev/null || \ sudo apt-get install -y cuda-toolkit-11-4-dev 2>/dev/null || \ sudo apt-get install -y cuda-toolkit-10-2-dev 2>/dev/null; then echo "✅ CUDA toolkit development packages installed!" success=true elif sudo apt-get install -y cuda-compiler-12-6 cuda-cudart-dev-12-6 2>/dev/null || \ sudo apt-get install -y cuda-compiler-12-5 cuda-cudart-dev-12-5 2>/dev/null || \ sudo apt-get install -y cuda-compiler-12-4 cuda-cudart-dev-12-4 2>/dev/null || \ sudo apt-get install -y cuda-compiler-11-4 cuda-cudart-dev-11-4 2>/dev/null || \ sudo apt-get install -y cuda-compiler-10-2 cuda-cudart-dev-10-2 2>/dev/null; then echo "✅ CUDA compiler and runtime dev packages installed!" success=true else # Try generic packages that might work echo "⚠️ Jetson-specific packages not found. Trying generic CUDA packages..." if sudo apt-get install -y cuda-cudart-dev libcuda1-dev 2>/dev/null || \ sudo apt-get install -y cuda-toolkit 2>/dev/null; then echo "✅ Generic CUDA development packages installed!" success=true fi fi # If all else fails, try to create symlinks to existing CUDA installation if [ "$success" = false ]; then echo "⚠️ Package installation failed. Trying to link existing CUDA installation..." # Find existing CUDA installation (using shared variable) for cuda_dir in "${CUDA_PATHS[@]}"; do if [ -d "$cuda_dir/include" ]; then echo "📍 Found CUDA at $cuda_dir, creating development symlinks..." sudo mkdir -p /usr/include/cuda sudo ln -sf $cuda_dir/include/* /usr/include/cuda/ 2>/dev/null || true sudo ln -sf $cuda_dir/include/cuda_runtime.h /usr/include/ 2>/dev/null || true echo "✅ CUDA headers linked successfully!" success=true break fi done fi return $([ "$success" = true ] && echo 0 || echo 1)}
# Check CUDA installation statusif check_cuda_toolkit; then if command -v nvcc &> /dev/null; then CUDA_VERSION=$(nvcc --version | grep "release" | sed 's/.*release \([0-9]\+\.[0-9]\+\).*/\1/') echo "✅ CUDA Toolkit found: nvcc version $CUDA_VERSION" else # Found in custom path - add to PATH suggestion (using shared variable) for cuda_path in "${CUDA_PATHS[@]}"; do if [ -f "$cuda_path/bin/nvcc" ]; then CUDA_VERSION=$($cuda_path/bin/nvcc --version | grep "release" | sed 's/.*release \([0-9]\+\.[0-9]\+\).*/\1/' 2>/dev/null || echo "unknown") echo "✅ CUDA Toolkit found at: $cuda_path (version $CUDA_VERSION)" echo " 💡 Consider adding $cuda_path/bin to your PATH" break fi done fi # Even with toolkit found, verify runtime libraries and headers are available echo "🔍 Verifying CUDA runtime libraries and headers are complete..." if check_cuda_runtime; then echo "✅ CUDA toolkit is complete with runtime libraries and headers!" else echo "⚠️ CUDA toolkit found but runtime libraries/headers missing!" if [ "$IS_JETSON" = true ]; then echo "🤖 Installing missing CUDA runtime development packages for Jetson..." if install_cuda_for_jetson; then echo "✅ Jetson CUDA runtime packages installed successfully!" else echo "❌ Jetson CUDA runtime installation failed" echo " 💡 System may already have working CUDA runtime" fi fi fielif check_cuda_runtime; then echo "✅ CUDA runtime libraries and headers found (sufficient for this project!)" echo " ℹ️ Full toolkit not detected, but runtime + headers are all you need"else # CUDA components missing - install them echo "⚠️ CUDA components missing or incomplete. Installing CUDA runtime libraries..." if [ "$IS_JETSON" = true ]; then echo "🤖 Installing CUDA runtime development packages for Jetson..." update_package_cache # Install CUDA runtime development packages for Jetson if sudo apt install -y cuda-cudart-dev-12-6 cuda-headers-12-6 2>/dev/null; then echo "✅ CUDA 12.6 development packages installed!" elif sudo apt install -y cuda-cudart-dev cuda-toolkit-12-6 2>/dev/null; then echo "✅ CUDA development packages installed!" elif sudo apt install -y libcudart-dev cuda-toolkit 2>/dev/null; then echo "✅ Generic CUDA development packages installed!" else echo "❌ Failed to install CUDA development packages" echo " Try manually: sudo apt install -y cuda-cudart-dev-12-6" fi else # Non-Jetson installation logic (existing) if [[ "$ARCH" == "aarch64" ]]; then install_cuda_for_arm64 elif [[ "$ARCH" == "x86_64" ]]; then install_cuda_for_x86_64 fi fi # Verify CUDA is now available echo "🔍 Verifying CUDA installation after package installation..." if check_cuda_runtime; then echo "✅ CUDA runtime and headers now available!" else echo "❌ CUDA verification still failing - manual intervention may be needed" fifi
# Initialize Git LFSecho "📁 Setting up Git LFS..."if git lfs install --force 2>/dev/null; then echo "✅ Git LFS hooks installed successfully"else echo "⚠️ Git LFS hook installation had issues, trying manual resolution..." # Try to update existing hooks if git lfs update --force 2>/dev/null; then echo "✅ Git LFS hooks updated successfully" else echo "⚠️ Git LFS hooks may need manual attention" echo " You can run 'git lfs update --force' later if needed" fifi
echo ""echo "🎉 System dependencies installation complete!"echo ""
if [ "$IS_JETSON" = true ]; then echo "🤖 Jetson-specific setup completed!" echo "" echo "📋 Next steps for Jetson system:" echo " 1. Ensure TensorRT is available (usually pre-installed with JetPack)" echo " 2. Run 'source scripts/setup_env.sh' to configure paths for Jetson" echo " 3. Run 'just build' to build the project" echo "" echo "💡 Jetson tips:" echo " - CUDA is typically pre-installed at /usr/local/cuda-12.6, /usr/local/cuda-11.4 or /usr/local/cuda-10.2" echo " - TensorRT is usually available at /usr/lib/aarch64-linux-gnu/" echo " - If build fails, you may need to install JetPack SDK development components" echo " - Monitor system temperature during compilation (use 'tegrastats')" echo " - For CUDA 12.6 systems, ensure you have the latest JetPack SDK Manager" echo "" # Install JetPack for Jetson systems (includes all DLA libraries) echo "🔧 Installing JetPack for complete Jetson development environment..." update_package_cache if sudo apt install -y nvidia-jetpack; then echo "✅ JetPack installed successfully - includes all DLA libraries!" echo " This resolves all TensorRT DLA dependencies" else echo "⚠️ JetPack installation failed (may have version conflicts)" echo " 💡 Try: sudo apt update && sudo apt install -y nvidia-jetpack" echo " 🔄 If issues persist, build should still work with existing libraries" fielse # Non-Jetson systems echo "📋 Next steps for $ARCH system:"echo " 1. Make sure TensorRT is installed and TensorRT_ROOT is set"echo " 2. Run 'source scripts/setup_env.sh' to set up the environment"echo " 3. Run 'just build' to build the project"echo "" if [[ "$ARCH" == "aarch64" ]]; then echo "💡 ARM64 tips:" echo " - CUDA may be installed at /usr/local/cuda or system locations" echo " - TensorRT typically installed via package manager" echo " - DLA libraries not needed on non-Jetson ARM64 systems" elif [[ "$ARCH" == "x86_64" ]]; then echo "💡 x86_64 tips:" echo " - CUDA typically at /usr/local/cuda or via CUDA toolkit" echo " - TensorRT available from NVIDIA or package repositories" echo " - Use nvidia-smi to check GPU compatibility" echo " - DLA libraries typically not needed on desktop GPUs" fifi
echo ""echo "⚠️ If you encounter any issues:"if [ "$IS_JETSON" = true ]; then echo " 🤖 Jetson-specific troubleshooting:" echo " - Check JetPack version: jetson_release" echo " - Verify CUDA installation: ls -la /usr/local/cuda*" echo " - Monitor resources: tegrastats" echo " - For DLA linking errors: Install full JetPack SDK" echo " - For help: https://developer.nvidia.com/embedded/jetpack"elif [[ "$ARCH" == "aarch64" ]]; then echo " 🔧 ARM64 troubleshooting:" echo " - Check CUDA: ls -la /usr/local/cuda*" echo " - Verify libraries: ldconfig -p | grep cuda" echo " - DLA errors: DLA not supported on non-Jetson ARM64"elif [[ "$ARCH" == "x86_64" ]]; then echo " 🖥️ x86_64 troubleshooting:" echo " - Check GPU: nvidia-smi" echo " - Verify CUDA: nvcc --version" echo " - Check environment: echo \$CUDA_HOME \$TensorRT_ROOT" echo " - DLA errors: DLA typically not supported on desktop GPUs"else echo " - Check that all environment variables are set correctly" echo " - Verify CUDA installation for your architecture"fi123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163#!/bin/bash
set -e
echo "🤖 Installing ROS2 Humble..."
# Detect system type and architectureARCH=$(uname -m)OS_ID=$(lsb_release -si 2>/dev/null || echo "Unknown")OS_VERSION=$(lsb_release -sr 2>/dev/null || echo "Unknown")
echo "🔍 System: $OS_ID $OS_VERSION ($ARCH)"
# Check if running Ubuntu (ROS2 Humble officially supports Ubuntu 22.04)if [ "$OS_ID" != "Ubuntu" ]; then echo "⚠️ Warning: ROS2 Humble is officially supported on Ubuntu 22.04 (Jammy Jellyfish)" echo " Your system ($OS_ID $OS_VERSION) may have compatibility issues" read -p "Continue anyway? (y/N) " -n 1 -r echo if [[ ! $REPLY =~ ^[Yy]$ ]]; then exit 1 fifi
if [ "$OS_VERSION" != "22.04" ] && [ "$OS_ID" = "Ubuntu" ]; then echo "⚠️ Warning: ROS2 Humble is officially supported on Ubuntu 22.04" echo " Your version ($OS_VERSION) may have compatibility issues" read -p "Continue anyway? (y/N) " -n 1 -r echo if [[ ! $REPLY =~ ^[Yy]$ ]]; then exit 1 fifi
# Set localeecho "🌍 Setting up locale..."sudo apt-get updatesudo apt-get install -y localessudo locale-gen en_US en_US.UTF-8sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8export LANG=en_US.UTF-8
echo "✅ Locale configured"
# Enable Ubuntu Universe repositoryecho "📦 Enabling Ubuntu Universe repository..."sudo apt-get install -y software-properties-commonsudo add-apt-repository universe -y
# Add ROS2 GPG keyecho "🔑 Adding ROS2 GPG key..."sudo apt-get updatesudo apt-get install -y curl gnupg lsb-release
if [ ! -f /usr/share/keyrings/ros-archive-keyring.gpg ]; then sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg echo "✅ ROS2 GPG key added"else echo "✅ ROS2 GPG key already exists"fi
# Add ROS2 repository to sources listecho "📋 Adding ROS2 repository..."ROS2_LIST="/etc/apt/sources.list.d/ros2.list"
if [ ! -f "$ROS2_LIST" ]; then echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee $ROS2_LIST > /dev/null echo "✅ ROS2 repository added"else echo "✅ ROS2 repository already configured"fi
# Update apt cacheecho "🔄 Updating package cache..."sudo apt-get update
# Upgrade packages (optional but recommended)echo "⬆️ Upgrading packages..."sudo apt-get upgrade -y
# Install ROS2 Humble Desktop (full installation with GUI tools)echo "📦 Installing ROS2 Humble Desktop..."echo " This may take several minutes..."
if sudo apt-get install -y ros-humble-desktop; then echo "✅ ROS2 Humble Desktop installed successfully!"else echo "❌ Failed to install ROS2 Humble Desktop" echo " Trying ROS2 Humble Base instead..." if sudo apt-get install -y ros-humble-ros-base; then echo "✅ ROS2 Humble Base installed successfully!" else echo "❌ Failed to install ROS2 Humble" exit 1 fifi
# Install development toolsecho "🔧 Installing ROS2 development tools..."sudo apt-get install -y \ ros-dev-tools \ python3-colcon-common-extensions \ python3-rosdep \ python3-vcstool \ python3-argcomplete
echo "✅ Development tools installed"
# Initialize rosdepecho "🔧 Initializing rosdep..."if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then sudo rosdep init echo "✅ rosdep initialized"else echo "✅ rosdep already initialized"fi
rosdep updateecho "✅ rosdep updated"
# Set up environmentecho "🌱 Setting up ROS2 environment..."
SETUP_SCRIPT="/opt/ros/humble/setup.bash"BASHRC="$HOME/.bashrc"
# Check if ROS2 sourcing is already in .bashrcif ! grep -q "source $SETUP_SCRIPT" "$BASHRC"; then echo "" >> "$BASHRC" echo "# ROS2 Humble setup" >> "$BASHRC" echo "source $SETUP_SCRIPT" >> "$BASHRC" echo "✅ Added ROS2 Humble to .bashrc"else echo "✅ ROS2 Humble already in .bashrc"fi
# Source ROS2 setup for current sessionsource $SETUP_SCRIPT
echo ""echo "🎉 ROS2 Humble installation complete!"echo ""echo "📋 Installation Summary:"echo " - ROS2 Humble Desktop: Installed"echo " - Development tools: Installed"echo " - rosdep: Initialized and updated"echo " - Environment: Configured in ~/.bashrc"echo ""echo "🚀 Next steps:"echo " 1. Open a new terminal or run: source ~/.bashrc"echo " 2. Verify installation: ros2 --help"echo " 3. Test with: ros2 run demo_nodes_cpp talker"echo ""echo "📚 Useful commands:"echo " - Check ROS2 version: ros2 --version"echo " - List available packages: ros2 pkg list"echo " - Create a workspace: mkdir -p ~/ros2_ws/src && cd ~/ros2_ws && colcon build"echo ""echo "📖 Documentation: https://docs.ros.org/en/humble/"echo ""
12345678910111213141516171819202122232425262728293031323334353637383940414243#!/bin/bash
# Script to restore official Ubuntu repositories# Removes Tsinghua University mirrors and restores official sources
echo "Creating backup of current sources.list..."sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup.$(date +%Y%m%d_%H%M%S)
echo "Restoring official Ubuntu repositories for Ubuntu 22.04 (Jammy) ARM64..."
# Create new sources.list with official repositoriessudo tee /etc/apt/sources.list > /dev/null << 'SOURCES'# Official Ubuntu repositories for ARM64 (ports.ubuntu.com)deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricteddeb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricteddeb http://ports.ubuntu.com/ubuntu-ports/ jammy universedeb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates universedeb http://ports.ubuntu.com/ubuntu-ports/ jammy multiverse deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates multiversedeb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiversedeb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricteddeb http://ports.ubuntu.com/ubuntu-ports/ jammy-security universedeb http://ports.ubuntu.com/ubuntu-ports/ jammy-security multiverse
# Source repositories (uncomment if you need source packages)# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy universe# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates universe# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy multiverse# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates multiverse# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security universe# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security multiverseSOURCES
echo "Updated sources.list with official Ubuntu repositories"echo "Updating package lists..."sudo apt update
echo "Done! Ubuntu repositories restored to official sources."echo "Backup saved as: /etc/apt/sources.list.backup.$(date +%Y%m%d_%H%M%S)"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351#!/bin/bash
# Environment setup script to replace shell.nix functionality# Source this file: source scripts/setup_env.sh
echo "🔧 Setting up G1 Deploy environment..."
# Run jetson_clocks on Jetson systems (bare-metal only)if command -v jetson_clocks &> /dev/null; then if [ -f "/.dockerenv" ]; then # Inside Docker - skip (jetson_clocks needs host access) echo "ℹ️ Inside Docker - jetson_clocks should be run on host" else # Bare-metal Jetson - set max performance echo "🚀 Setting Jetson to max performance..." sudo jetson_clocks 2>/dev/null || echo "⚠️ jetson_clocks failed (needs sudo)" fifi
# Detect system architecture for platform-specific setupARCH=$(uname -m)
# Set up ONNX Runtime environment - check multiple possible locationsONNX_RUNTIME_PATHS=( "/opt/onnxruntime" "/usr/local/onnxruntime" "/usr/lib/onnxruntime" "$HOME/.local/onnxruntime" "/opt/intel/openvino/runtime/3rdparty/onnx_runtime")
ONNX_FOUND=falsefor path in "${ONNX_RUNTIME_PATHS[@]}"; do if [ -d "$path" ]; then export onnxruntime_DIR="$path/lib/cmake/onnxruntime" echo "✅ ONNX Runtime found at: $path" ONNX_FOUND=true break fidone
if [ "$ONNX_FOUND" = false ]; then # Try to use system package manager installation if pkg-config --exists libonnxruntime 2>/dev/null; then echo "✅ ONNX Runtime found via system package manager" else echo "⚠️ ONNX Runtime not found in common locations:" printf " %s\n" "${ONNX_RUNTIME_PATHS[@]}" echo " Please run scripts/install_deps.sh or install ONNX Runtime manually" fifi
# Auto-detect system architecture and library paths for different distributionsDISTRO_ID=""
# Detect Linux distributionif [ -f /etc/os-release ]; then DISTRO_ID=$(grep "^ID=" /etc/os-release | cut -d'=' -f2 | tr -d '"')elif [ -f /etc/redhat-release ]; then DISTRO_ID="rhel"elif [ -f /etc/debian_version ]; then DISTRO_ID="debian"fi
# Set system library directory based on distribution and architecturecase "$DISTRO_ID" in ubuntu|debian|linuxmint) # Debian-based distributions use multiarch paths if [ "$ARCH" = "x86_64" ]; then SYSTEM_LIB_DIR="/usr/lib/x86_64-linux-gnu" elif [ "$ARCH" = "aarch64" ]; then SYSTEM_LIB_DIR="/usr/lib/aarch64-linux-gnu" else SYSTEM_LIB_DIR="/usr/lib" fi ;; fedora|rhel|centos|rocky|almalinux) # Red Hat-based distributions typically use lib64 for 64-bit if [[ "$ARCH" == "x86_64" || "$ARCH" == "aarch64" ]]; then SYSTEM_LIB_DIR="/usr/lib64" else SYSTEM_LIB_DIR="/usr/lib" fi ;; opensuse*|sles) # SUSE distributions also use lib64 if [[ "$ARCH" == "x86_64" || "$ARCH" == "aarch64" ]]; then SYSTEM_LIB_DIR="/usr/lib64" else SYSTEM_LIB_DIR="/usr/lib" fi ;; arch|manjaro) # Arch Linux uses standard lib structure SYSTEM_LIB_DIR="/usr/lib" ;; *) # Generic fallback - try to detect best path if [ -d "/usr/lib/$ARCH-linux-gnu" ]; then SYSTEM_LIB_DIR="/usr/lib/$ARCH-linux-gnu" elif [ -d "/usr/lib64" ] && [[ "$ARCH" == "x86_64" || "$ARCH" == "aarch64" ]]; then SYSTEM_LIB_DIR="/usr/lib64" else SYSTEM_LIB_DIR="/usr/lib" fi ;;esac
echo "🔍 Detected: $DISTRO_ID on $ARCH, using library path: $SYSTEM_LIB_DIR"
# Set up CMake paths - use dynamically detected pathsCMAKE_PATHS="$SYSTEM_LIB_DIR/cmake"
# Add ONNX Runtime path if we found oneif [ -n "$onnxruntime_DIR" ]; then ONNX_BASE_PATH=$(dirname $(dirname $onnxruntime_DIR)) # Remove /lib/cmake/onnxruntime to get base path CMAKE_PATHS="$ONNX_BASE_PATH:$CMAKE_PATHS"fi
export CMAKE_PREFIX_PATH="$CMAKE_PATHS:$CMAKE_PREFIX_PATH"export OPENSSL_ROOT_DIR="/usr"
# ROS2 Environment Setup - dynamically find ROS2 installationROS2_FOUND=false
# Common ROS2 distributions in order of preference (newest first)ROS2_DISTROS=("jazzy" "iron" "humble" "galactic" "foxy" "eloquent" "dashing" "crystal")ROS2_INSTALL_PATHS=("/opt/ros" "/usr/local/ros" "$HOME/ros2_ws/install")
for install_path in "${ROS2_INSTALL_PATHS[@]}"; do if [ "$ROS2_FOUND" = true ]; then break fi for distro in "${ROS2_DISTROS[@]}"; do ros2_setup_file="$install_path/$distro/setup.bash" if [ -f "$ros2_setup_file" ]; then source "$ros2_setup_file" export RMW_IMPLEMENTATION=rmw_fastrtps_cpp # Remove problematic system library path that conflicts with system GLIBC export LD_LIBRARY_PATH=$(echo $LD_LIBRARY_PATH | tr ':' '\n' | grep -v "$SYSTEM_LIB_DIR" | tr '\n' ':' | sed 's/:$//') echo "✅ ROS2 $distro found at $install_path/$distro - system manages all ROS2 dependencies" export HAS_ROS2=1 export ROS_LOCALHOST_ONLY=1 ROS2_FOUND=true break fi donedone
if [ "$ROS2_FOUND" = false ]; then echo "⚠️ ROS2 not found in common locations:" printf " %s/<distro>\n" "${ROS2_INSTALL_PATHS[@]}" echo " Install ROS2 system-wide for ROS2InputHandler support" echo " Building will continue without ROS2InputHandler" export HAS_ROS2=0fi
# Set up production FastRTPS profileif [ -f "src/g1/g1_deploy_onnx_ref/config/fastrtps_profile.xml" ]; then export FASTRTPS_DEFAULT_PROFILES_FILE="$(pwd)/src/g1/g1_deploy_onnx_ref/config/fastrtps_profile.xml" echo "✅ FastRTPS production profile configured"fi
# TensorRT Environment Setup# Check if TensorRT_ROOT is already set, if not try to load from .bashrcif [ -z "$TensorRT_ROOT" ] && [ -f "$HOME/.bashrc" ]; then # Extract TensorRT_ROOT from .bashrc if it exists BASHRC_TENSORRT=$(grep -o 'export TensorRT_ROOT=.*' "$HOME/.bashrc" | head -n1 | cut -d'=' -f2 | tr -d '"' | envsubst) if [ -n "$BASHRC_TENSORRT" ]; then export TensorRT_ROOT="$BASHRC_TENSORRT" echo "📋 Loaded TensorRT_ROOT from ~/.bashrc: $TensorRT_ROOT" fifi
if [ -n "$TensorRT_ROOT" ]; then export LD_LIBRARY_PATH="$TensorRT_ROOT/lib:$LD_LIBRARY_PATH" echo "✅ TensorRT environment configured" # For Jetson systems, ensure DLA libraries are accessible for runtime if [[ "$ARCH" == "aarch64" ]] && [[ -f "/etc/nv_tegra_release" || -d "/usr/src/jetson_multimedia_api" ]]; then echo "🤖 Jetson system detected - setting up DLA library paths for runtime" # Create missing libcudla.so.1 symlink if needed (TensorRT expects this name) if [ -f "/usr/lib/aarch64-linux-gnu/nvidia/libnvcudla.so" ] && [ ! -f "/usr/lib/aarch64-linux-gnu/nvidia/libcudla.so.1" ]; then echo " 🔗 Creating libcudla.so.1 symlink for TensorRT compatibility..." sudo ln -sf libnvcudla.so /usr/lib/aarch64-linux-gnu/nvidia/libcudla.so.1 2>/dev/null || echo " ⚠️ Could not create symlink (may need sudo)" sudo ln -sf libnvcudla.so /usr/lib/aarch64-linux-gnu/nvidia/libcudla.so 2>/dev/null || echo " ⚠️ Could not create symlink (may need sudo)" echo " ✅ libcudla.so.1 → libnvcudla.so" fi # CRITICAL: Add DLA library path for runtime (this is why your executable can't run) export LD_LIBRARY_PATH="/usr/lib/aarch64-linux-gnu/nvidia:$LD_LIBRARY_PATH" # Also add to LIBRARY_PATH so the build-time linker finds -lcudla here. # GCC/ld doesn't search ldconfig paths for -l resolution by default; LIBRARY_PATH # is the build-time analogue of LD_LIBRARY_PATH and feeds directly into -L search. export LIBRARY_PATH="/usr/lib/aarch64-linux-gnu/nvidia:${LIBRARY_PATH:-}" echo " 📁 Added DLA library path to current session (runtime + build-time)" # Make it persistent so you don't need to run setup_env.sh every time if ! grep -q "/usr/lib/aarch64-linux-gnu/nvidia" ~/.bashrc 2>/dev/null; then echo 'export LD_LIBRARY_PATH="/usr/lib/aarch64-linux-gnu/nvidia:$LD_LIBRARY_PATH"' >> ~/.bashrc echo " ✅ Added DLA library path to ~/.bashrc for future sessions" fi echo " ℹ️ Your executable should now be able to find DLA libraries at runtime" fielse echo "⚠️ TensorRT_ROOT is not set" echo " Please install TensorRT and add 'export TensorRT_ROOT=/path/to/tensorrt' to your ~/.bashrc" echo " Or source ~/.bashrc before running this script"fi
# CUDA Environment Setupecho "🔧 Setting up CUDA environment..."
# Function to detect and set CUDA toolkit rootsetup_cuda_toolkit() { # Check if CUDAToolkit_ROOT is already set if [ -n "$CUDAToolkit_ROOT" ] && [ -f "$CUDAToolkit_ROOT/bin/nvcc" ]; then echo "✅ CUDA toolkit found: CUDAToolkit_ROOT already set to $CUDAToolkit_ROOT" return 0 fi # Check for nvcc in PATH first if command -v nvcc &> /dev/null; then NVCC_PATH=$(command -v nvcc) CUDA_ROOT=$(dirname $(dirname "$NVCC_PATH")) export CUDAToolkit_ROOT="$CUDA_ROOT" echo "✅ CUDA toolkit found in PATH: $CUDAToolkit_ROOT" return 0 fi # Check common CUDA installation paths (including CUDA 12.6 for newer Jetson) CUDA_PATHS=( "/usr/local/cuda" "/usr/local/cuda-12.6" # CUDA 12.6 on newer Jetson "/usr/local/cuda-12.5" # CUDA 12.5 variant "/usr/local/cuda-12.4" # CUDA 12.4 variant "/usr/local/cuda-12" "/usr/local/cuda-11.4" # Common on older Jetson "/usr/local/cuda-11" "/usr/local/cuda-10.2" # Common on older Jetson "/usr/local/cuda-10" "/opt/cuda" "/usr/cuda" ) for cuda_path in "${CUDA_PATHS[@]}"; do if [ -f "$cuda_path/bin/nvcc" ]; then export CUDAToolkit_ROOT="$cuda_path" export CUDA_HOME="$cuda_path" # Alternative name CMake might use export PATH="$cuda_path/bin:$PATH" export LD_LIBRARY_PATH="$cuda_path/lib64:$cuda_path/lib:$LD_LIBRARY_PATH" echo "✅ CUDA toolkit found at: $CUDAToolkit_ROOT" echo " Added to PATH: $cuda_path/bin" echo " Added CUDA libraries to LD_LIBRARY_PATH" return 0 fi done return 1}
# Set up CUDA toolkitif setup_cuda_toolkit; then # Add CUDA library paths if [ -n "$CUDAToolkit_ROOT" ]; then export LD_LIBRARY_PATH="$CUDAToolkit_ROOT/lib64:$CUDAToolkit_ROOT/lib:$LD_LIBRARY_PATH" # For Jetson with CUDA 12.6+, also add the targets/aarch64-linux/lib path for libcudla if [[ "$ARCH" == "aarch64" ]] && [ -d "$CUDAToolkit_ROOT/targets/aarch64-linux/lib" ]; then export LD_LIBRARY_PATH="$CUDAToolkit_ROOT/targets/aarch64-linux/lib:$LD_LIBRARY_PATH" echo " ✅ Added CUDA aarch64-linux libraries (includes libcudla for TensorRT DLA support)" fi fielse echo "ℹ️ CUDA toolkit (nvcc) not found. This is OK - checking for runtime libraries..." echo " Note: Full toolkit is preferred for development but runtime-only is sufficient for execution"fi
# Set up CUDA runtime libraries (fallback)# Note: Only add nvidia path if we don't already have CUDA toolkit paths set up# This prevents conflicts where libnvcudla.so shadows the correct libcudla.so from CUDA toolkitif [ -z "$CUDAToolkit_ROOT" ] && [ -d "/usr/lib/aarch64-linux-gnu/nvidia/" ]; then export LD_LIBRARY_PATH="/usr/lib/aarch64-linux-gnu/nvidia/:$LD_LIBRARY_PATH" echo "✅ CUDA runtime libraries found (aarch64)"elif [ -n "$CUDAToolkit_ROOT" ]; then echo "✅ Using CUDA libraries from toolkit (prioritized over system runtime libs)"else cuda_so_path=$(find /usr -name libcuda.so.1 2>/dev/null | head -n1) if [ -n "$cuda_so_path" ]; then export LD_PRELOAD="$cuda_so_path" echo "✅ CUDA runtime library found at $cuda_so_path" else echo "========================================================================" echo "⚠️ Warning: CUDA libraries not found. GPU functionality may be unavailable." echo " Please install NVIDIA drivers and CUDA toolkit for GPU support." echo "========================================================================" fifi
# Add ONNX Runtime to library path if not already thereif [ -d "/opt/onnxruntime/lib" ]; then export LD_LIBRARY_PATH="/opt/onnxruntime/lib:$LD_LIBRARY_PATH"fi
# Set up Git LFS (if not already done)if command -v git-lfs &> /dev/null; then git lfs install &> /dev/null echo "✅ Git LFS configured" # Pull large files if in git repository if [ -d ".git" ]; then echo "📥 Pulling Git LFS files..." git lfs pull fielse echo "⚠️ Git LFS not found. Please install git-lfs package."fi
# Verify essential toolsecho ""echo "🔍 Verifying essential tools:"
check_command() { if command -v "$1" &> /dev/null; then echo "✅ $1: $(command -v $1)" else echo "❌ $1: not found" fi}
check_command cmakecheck_command clangcheck_command justcheck_command git
echo ""echo "🎉 Environment setup complete!"echo ""echo "📝 You can now run:"echo " just build # Build the project"echo " just --list # See all available commands"echo ""
# Optional: Add this setup to the current shell session persistenceif [ -n "$BASH_VERSION" ]; then export PS1="(g1_deploy) $PS1"fi
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265#!/bin/bash
echo "=== [WiFi Setup Script] Starting... ==="
# WiFi network configuration (set via env or flags)# Usage:# WIFI_SSID="MyWifi" WIFI_PASSWORD="secret" WIFI_GATEWAY="192.168.x.x" ./setup_wifi.sh# ./setup_wifi.sh --ssid "MyWifi" --password "secret" --interface "wlan0" --gateway "192.168.x.x"WIFI_SSID="${WIFI_SSID:-}"WIFI_PASSWORD="${WIFI_PASSWORD:-}"CONNECTION_NAME="${CONNECTION_NAME:-}"WIFI_INTERFACE="${WIFI_INTERFACE:-}"FALLBACK_SSID="${FALLBACK_SSID:-}"
usage() { cat << 'USAGE_EOF'Usage: setup_wifi.sh [options]
Options: --ssid <ssid> WiFi SSID (required) --password <password> WiFi password (required for secured networks) --interface <ifname> WiFi interface (optional; auto-detect if omitted) --connection <name> Connection profile name (optional; defaults to SSID) --gateway <ip> Gateway IP (optional; sets route/DNS) --fallback-ssid <ssid> Fallback SSID (optional) -h, --help Show this help
You can also set environment variables: WIFI_SSID, WIFI_PASSWORD, WIFI_INTERFACE, CONNECTION_NAME, FALLBACK_SSID, WIFI_GATEWAY, ROUTE_CLEANUP_GWUSAGE_EOF}
while [ $# -gt 0 ]; do case "$1" in --ssid) WIFI_SSID="$2"; shift 2 ;; --password) WIFI_PASSWORD="$2"; shift 2 ;; --interface) WIFI_INTERFACE="$2"; shift 2 ;; --connection) CONNECTION_NAME="$2"; shift 2 ;; --fallback-ssid) FALLBACK_SSID="$2"; shift 2 ;; --gateway) WIFI_GATEWAY="$2"; shift 2 ;; -h|--help) usage; exit 0 ;; *) echo "[!] Unknown option: $1" usage exit 2 ;; esacdone
if [ -z "$WIFI_SSID" ]; then echo "[✗] Missing WiFi SSID. Provide --ssid or WIFI_SSID." usage exit 2fi
if [ -z "$CONNECTION_NAME" ]; then CONNECTION_NAME="$WIFI_SSID"fi
if [ -z "$WIFI_INTERFACE" ]; then WIFI_INTERFACE=$(nmcli -t -f DEVICE,TYPE device status | awk -F: '$2=="wifi"{print $1; exit}')fi
if [ -z "$WIFI_INTERFACE" ]; then echo "[✗] No WiFi interface detected. Provide --interface or WIFI_INTERFACE." exit 2fi
# Network configuration# If WIFI_GATEWAY is set, routing and DNS will be configured to use it.WIFI_GATEWAY="${WIFI_GATEWAY:-}"# Optional default gateway to remove from routing table.ROUTE_CLEANUP_GW="${ROUTE_CLEANUP_GW:-}"WIRED_CONNECTION="Wired connection 1"
# Step 1: Unblock and enable WiFiecho "[1] Unblocking WiFi and enabling interface..."sudo rfkill unblock wifisudo ip link set $WIFI_INTERFACE up
# Step 2: Scan for networks to verify NetworkManager is workingecho "[2] Scanning for WiFi networks..."sudo nmcli device wifi rescansleep 3
# Step 3: Check if the target network is visibleecho "[3] Checking for '$WIFI_SSID' network..."if sudo nmcli device wifi list | grep -q "$WIFI_SSID"; then echo "[✓] Network '$WIFI_SSID' found in scan" # Try direct connection echo "[4] Attempting direct connection to '$WIFI_SSID'..." if [ -n "$WIFI_PASSWORD" ]; then CONNECT_CMD=(sudo nmcli device wifi connect "$WIFI_SSID" password "$WIFI_PASSWORD") else CONNECT_CMD=(sudo nmcli device wifi connect "$WIFI_SSID") fi if "${CONNECT_CMD[@]}"; then echo "[✓] Successfully connected directly" CONNECTION_SUCCESS=true else echo "[!] Direct connection failed, trying manual profile method..." CONNECTION_SUCCESS=false fielse echo "[!] Network '$WIFI_SSID' not found in scan (possibly hidden)" CONNECTION_SUCCESS=falsefi
# Step 4: If direct connection failed or network not found, create manual connection profileif [ "$CONNECTION_SUCCESS" != "true" ]; then echo "[4] Creating manual connection profile for '$WIFI_SSID'..." # Remove existing connection profile if it exists sudo nmcli connection delete "$CONNECTION_NAME" 2>/dev/null || true # Create new connection profile if [ -n "$WIFI_PASSWORD" ]; then ADD_ARGS=(wifi-sec.key-mgmt wpa-psk wifi-sec.psk "$WIFI_PASSWORD") else ADD_ARGS=() fi if sudo nmcli connection add type wifi con-name "$CONNECTION_NAME" ifname "$WIFI_INTERFACE" ssid "$WIFI_SSID" "${ADD_ARGS[@]}"; then echo "[✓] Connection profile created successfully" echo "[5] Activating connection profile..." if sudo nmcli connection up "$CONNECTION_NAME"; then echo "[✓] Connection profile activated successfully" CONNECTION_SUCCESS=true else echo "[✗] Failed to activate connection profile" CONNECTION_SUCCESS=false fi else echo "[✗] Failed to create connection profile" CONNECTION_SUCCESS=false fifi
# Step 5: Configure network routing priorities if connection successfulif [ "$CONNECTION_SUCCESS" = "true" ]; then echo "[5] Configuring network routing priorities..." # Set WiFi connection to high priority (low metric) echo " Setting WiFi connection priority to 100..." sudo nmcli connection modify "$CONNECTION_NAME" ipv4.route-metric 100 # Set wired connection to very low priority (high metric) echo " Setting wired connection priority to 30000..." sudo nmcli connection modify "$WIRED_CONNECTION" ipv4.route-metric 30000 2>/dev/null || true # Remove any problematic default routes echo " Cleaning up routing table..." if [ -n "$ROUTE_CLEANUP_GW" ]; then sudo ip route del default via "$ROUTE_CLEANUP_GW" 2>/dev/null || true fi # Ensure WiFi route has highest priority if [ -n "$WIFI_GATEWAY" ]; then sudo ip route add default via "$WIFI_GATEWAY" dev "$WIFI_INTERFACE" metric 50 2>/dev/null || true # Configure DNS to use router and public DNS echo " Configuring DNS..." sudo tee /etc/resolv.conf > /dev/null << DNS_EOFnameserver $WIFI_GATEWAYnameserver 8.8.8.8nameserver 1.1.1.1DNS_EOF fi echo "[✓] Network routing configured for WiFi priority"fi
# Step 6: Verify connection statusecho "[6] Checking connection status..."if [ "$CONNECTION_SUCCESS" = "true" ]; then CURRENT_CONNECTION=$(nmcli device status | grep "$WIFI_INTERFACE" | awk '{print $4}') if [[ "$CURRENT_CONNECTION" == "$CONNECTION_NAME" ]] || [[ "$CURRENT_CONNECTION" == "$WIFI_SSID" ]]; then echo "[✓] Successfully connected to '$WIFI_SSID'" echo " Interface: $WIFI_INTERFACE" echo " Connection: $CURRENT_CONNECTION" else echo "[!] Connection status unclear" CONNECTION_SUCCESS=false fifi
# Step 7: Test internet connectivityif [ "$CONNECTION_SUCCESS" = "true" ]; then echo "[7] Testing internet connectivity..." MAX_RETRIES=3 COUNT=0 INTERNET_OK=false while [ "$COUNT" -lt "$MAX_RETRIES" ]; do if ping -c 2 -W 5 8.8.8.8 >/dev/null 2>&1; then echo "[✓] Internet connectivity verified (ping test)" # Also test DNS resolution if curl -s --connect-timeout 5 -I http://google.com >/dev/null 2>&1; then echo "[✓] DNS resolution and HTTP connectivity verified" INTERNET_OK=true break else echo "[!] DNS/HTTP test failed, but ping works. Retrying... ($((COUNT+1))/$MAX_RETRIES)" fi else echo "[!] Internet test failed. Retrying... ($((COUNT+1))/$MAX_RETRIES)" fi sleep 3 ((COUNT++)) done if [ "$INTERNET_OK" != "true" ]; then echo "[!] Internet connectivity test failed after $MAX_RETRIES attempts" CONNECTION_SUCCESS=false fifi
# Step 8: Fallback to previous network if connection failedif [ "$CONNECTION_SUCCESS" != "true" ] && [ -n "$FALLBACK_SSID" ]; then echo "[8] Connection to '$WIFI_SSID' failed. Attempting fallback to '$FALLBACK_SSID'..." # Try to connect to fallback network if sudo nmcli device wifi list | grep -q "$FALLBACK_SSID"; then echo "[!] Attempting to connect to fallback network '$FALLBACK_SSID'..." if sudo nmcli device wifi connect "$FALLBACK_SSID"; then echo "[✓] Connected to fallback network '$FALLBACK_SSID'" # Apply routing fixes for fallback network too echo " Applying routing fixes for fallback network..." if [ -n "$ROUTE_CLEANUP_GW" ]; then sudo ip route del default via "$ROUTE_CLEANUP_GW" 2>/dev/null || true fi sudo nmcli connection modify "$WIRED_CONNECTION" ipv4.route-metric 30000 2>/dev/null || true else echo "[✗] Failed to connect to fallback network" fi else echo "[!] Fallback network '$FALLBACK_SSID' not available" fifi
# Step 9: Final status reportecho "[9] Final WiFi status:"nmcli device status | grep wifiecho ""echo "Active connections:"nmcli connection show --active | head -5echo ""echo "Current routing table:"ip route show | head -5echo ""echo "DNS configuration:"cat /etc/resolv.conf | grep nameserver
echo "=== [WiFi Setup Script] Completed ==="
# Exit with appropriate codeif [ "$CONNECTION_SUCCESS" = "true" ]; then exit 0else exit 1fi123add_subdirectory(TRTInference)add_subdirectory(g1)add_subdirectory(audio_thread)1234567891011121314151617181920212223242526272829303132333435363738message(STATUS "blah = ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake")
set(SRC_FILES
"InferenceEngine.cpp"
"InferenceEngine.h"
"InferenceEngine.inl"
"Utility.h"
)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SRC_FILES})
add_library(TRTInference ${SRC_FILES})
# Explicitly set C++ standard for this library
set_target_properties(TRTInference PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
)
# Set up include directories
set(CUDA_INCLUDES "")
if(CUDAToolkit_FOUND)
set(CUDA_INCLUDES ${CUDAToolkit_INCLUDE_DIRS})
elseif(CUDA_INCLUDE_DIR)
set(CUDA_INCLUDES ${CUDA_INCLUDE_DIR})
endif()
target_include_directories(TRTInference
PRIVATE ${PROJECT_SOURCE_DIR}/src
PRIVATE ${TensorRT_INCLUDE_DIRS}
PRIVATE ${CUDA_INCLUDES})
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
target_compile_options(TRTInference PRIVATE -Wno-deprecated-declarations -std=c++20)
endif()
target_link_libraries(TRTInference ${TensorRT_LIBRARIES} ${CUDA_LIBRARIES})123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794#include "InferenceEngine.h"
#include "Log.h"
#include "picosha2.h"
#include <fstream>
#include <array>
#include <bitset>
#include <vector>
#include <map>
#include <iostream>
#include <NvInfer.h>
#include <NvOnnxParser.h>
namespace
{
class Logger : public nvinfer1::ILogger
{
public:
Logger( bool verbose )
: m_flags( UINT8_MAX )
{
m_flags.set( static_cast<size_t>( Severity::kVERBOSE ), verbose );
}
void log( Severity severity, const char* msg ) noexcept override
{
if ( !m_flags.test( static_cast<size_t>( severity ) ) )
return;
switch ( severity )
{
case Severity::kINFO:
case Severity::kVERBOSE:
LOG_INFO( msg );
break;
case Severity::kWARNING:
LOG_WARNING( msg );
break;
case Severity::kERROR:
case Severity::kINTERNAL_ERROR:
LOG_ERROR( msg );
break;
}
}
void log( cudaError_t error )
{
if ( error == cudaError_t::cudaSuccess )
return;
LOG_ERROR( "CUDA failed with error [ " + std::to_string( error ) + " : " + cudaGetErrorName( error ) + " ]: " + cudaGetErrorString( error ) );
}
private:
static constexpr uint8_t NB_FLAGS = static_cast<uint8_t>( Severity::kVERBOSE ) + 1;
std::bitset<NB_FLAGS> m_flags;
};
Logger s_logger(false);
bool FileExists( const std::string& filepath )
{
return std::ifstream( filepath.c_str() ).good();
}
std::string GetCudaDeviceName( int deviceID )
{
int deviceCount = 0;
cudaGetDeviceCount( &deviceCount );
if ( deviceID >= deviceCount )
return std::string();
cudaDeviceProp prop;
cudaGetDeviceProperties( &prop, deviceID );
return std::string( prop.name );
}
int SizeOfTensorDataType( nvinfer1::DataType dataType )
{
int size = -1;
switch ( dataType )
{
case nvinfer1::DataType::kINT64:
size = sizeof( uint64_t );
break;
case nvinfer1::DataType::kINT32:
case nvinfer1::DataType::kFLOAT:
size = sizeof( uint32_t );
break;
case nvinfer1::DataType::kHALF:
case nvinfer1::DataType::kBF16:
size = sizeof( uint16_t );
break;
case nvinfer1::DataType::kFP8:
case nvinfer1::DataType::kINT8:
case nvinfer1::DataType::kBOOL:
case nvinfer1::DataType::kUINT8:
size = sizeof( uint8_t );
break;
default:
break;
}
return size;
}
}
bool ConvertONNXToTRT(
const Options& options,
const std::string& onnxModelPath,
std::string& trtFile,
const std::string prefix,
bool forceConvert
)
{
if ( !FileExists( onnxModelPath ) )
{
LOG_ERROR( "Cannot find ONNX mode at path: " + onnxModelPath );
return false;
}
// Find a hash string identifying the onnx we're going to convert to
// tensorrt, plus the gpu we're going to convert it for:
std::ifstream file(onnxModelPath, std::ios::binary);
std::string trtHash = picosha2::hash256_hex_string(
std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>()
);
// hash in the cuda device name and precision::
trtHash = picosha2::hash256_hex_string(trtHash + GetCudaDeviceName( options.deviceID ));
trtHash = picosha2::hash256_hex_string(trtHash + std::to_string(int(options.precision)));
// name of the tensorrt we're going to write to (same directory as the ONNX model):
const auto filenamePos = onnxModelPath.find_last_of( '/' ) + 1;
const auto onnxDir = onnxModelPath.substr(0, filenamePos);
trtFile = onnxDir + prefix + onnxModelPath.substr( filenamePos, onnxModelPath.find_last_of( '.' ) - filenamePos );
trtFile += ".trt";
if (!forceConvert && FileExists( trtFile ) )
{
std::ifstream file(trtFile, std::ios::binary);
std::string hashInFile;
hashInFile.resize(trtHash.size());
file.read(const_cast<char*>(hashInFile.c_str()), trtHash.size());
std::cerr << "hash value in file " << hashInFile << std::endl;
std::cerr << "hash of onnx/gpu type " << trtHash << std::endl;
if(hashInFile == trtHash)
{
return true;
}
LOG_INFO( "TRT file " + trtFile + " is out of date and needs to be regenerated. This could take a while..." );
}
else
{
LOG_INFO( "TRT file " + trtFile + " not found. This could take a while to generate..." );
}
// Create engine builder
auto builder = std::unique_ptr<nvinfer1::IBuilder>( nvinfer1::createInferBuilder( s_logger ) );
if ( !builder )
{
LOG_ERROR( "Could not create builder." );
return false;
}
// Create network
const uint32_t explicitBatch = 1U << static_cast<uint32_t>( nvinfer1::NetworkDefinitionCreationFlag::kEXPLICIT_BATCH );
auto network = std::unique_ptr<nvinfer1::INetworkDefinition>( builder->createNetworkV2( explicitBatch ) );
if ( !network )
{
LOG_ERROR( "Could not create network." );
return false;
}
// Create a parser for reading the onnx file.
auto parser = std::unique_ptr<nvonnxparser::IParser>( nvonnxparser::createParser( *network, s_logger ) );
if ( !parser )
{
LOG_ERROR( "Could not create ONNX parser." );
return false;
}
// Read and parse the ONNX file
auto parsed = parser->parseFromFile( onnxModelPath.c_str(), 0 );
if ( !parsed )
{
LOG_ERROR( "Unable to parse the ONNX model at: " + onnxModelPath );
return false;
}
// Ensure that all the inputs have the same batch size
const int32_t inputCount = network->getNbInputs();
if ( inputCount < 1 )
{
LOG_ERROR( "Model has no inputs." );
return false;
}
// Set dynamic axis info for inputs:
auto profile = builder->createOptimizationProfile();
for ( int32_t i = 0; i < inputCount; ++i )
{
auto t = network->getInput( i );
const auto name = t->getName();
auto dims = t->getDimensions();
bool hasDynamicAxes = false;
auto dimsMin = dims;
auto dimsOpt = dims;
auto dimsMax = dims;
for ( int32_t n = 0; n < dims.nbDims; ++n )
{
if ( dims.d[n] == -1 )
{
auto axis_sizes = options.defaultSizes;
if (options.dynamic_axes_names.contains(t->getName()))
{
auto& dynamic_axis_names = options.dynamic_axes_names.at(t->getName());
if (!dynamic_axis_names.contains(n))
{
LOG_ERROR("Tensor " + std::string(t->getName()) + " has a dynamic axes, but its name isn't specified in options.input_dynamic_axes");
return false;
}
auto axis_name = dynamic_axis_names.at(n);
if (!options.dynamic_axes_sizes.contains(axis_name))
{
LOG_ERROR("Named axis " + axis_name + " has no entry in options.dynamic_axes_sizes");
return false;
}
axis_sizes = options.dynamic_axes_sizes.at(axis_name);
}
hasDynamicAxes = true;
dimsMin.d[n] = std::get<0>( axis_sizes );
dimsOpt.d[n] = std::get<1>( axis_sizes );
dimsMax.d[n] = std::get<2>( axis_sizes );
}
}
profile->setDimensions( name, nvinfer1::OptProfileSelector::kMIN, dimsMin );
profile->setDimensions( name, nvinfer1::OptProfileSelector::kOPT, dimsOpt );
profile->setDimensions( name, nvinfer1::OptProfileSelector::kMAX, dimsMax );
if ( t->isShapeTensor() )
{
if ( !options.shape_tensor_sizes.contains( name ) )
{
LOG_ERROR( "Tensor " + std::string( name ) + " controls the shape of an internal tensor and needs an entry in options.shape_tensor_sizes" );
return false;
}
auto &sizes = options.shape_tensor_sizes.at( name );
profile->setShapeValues( name, nvinfer1::OptProfileSelector::kMIN, std::get<0>( sizes ).data(), std::get<0>( sizes ).size());
profile->setShapeValues( name, nvinfer1::OptProfileSelector::kOPT, std::get<1>( sizes ).data(), std::get<1>( sizes ).size() );
profile->setShapeValues( name, nvinfer1::OptProfileSelector::kMAX, std::get<2>( sizes ).data(), std::get<2>( sizes ).size() );
}
}
auto config = std::unique_ptr<nvinfer1::IBuilderConfig>( builder->createBuilderConfig() );
if ( !config )
{
LOG_ERROR( "Could not create builder config." );
return false;
}
config->addOptimizationProfile( profile );
// Set the precision level
if ( options.precision == Precision::FP16 )
{
// Ensure the GPU supports FP16 inference
if ( !builder->platformHasFastFp16() )
{
LOG_ERROR( "GPU does not support FP16 precision." );
return false;
}
config->setFlag( nvinfer1::BuilderFlag::kFP16 );
}
// CUDA stream used for profiling by the builder.
cudaStream_t stream;
s_logger.log( cudaStreamCreate( &stream ) );
config->setProfileStream( stream );
// Build the engine
// If this call fails, it is suggested to increase the logger verbosity to kVERBOSE and try rebuilding the engine.
// Doing so will provide you with more information on why exactly it is failing.
auto serializedNetwork = builder->buildSerializedNetwork( *network, *config );
if ( !serializedNetwork )
{
s_logger.log( cudaStreamDestroy( stream ) );
LOG_ERROR( "Failed to build the engine!" );
return false;
}
// Write the engine to disk
std::ofstream outfile( trtFile, std::ofstream::binary );
// Write the onnx/gpu hash first:
outfile.write( trtHash.c_str(), trtHash.size() );
// Write the engine:
outfile.write( reinterpret_cast<const char*>( serializedNetwork->data() ), serializedNetwork->size() );
LOG_INFO( "Saved TRT file to " + trtFile );
s_logger.log( cudaStreamDestroy( stream ) );
return true;
}
class TRTInferenceEngine::Impl
{
public:
~Impl()
{
Destroy();
}
bool Initialize( const std::string& trtPath, int deviceIndex, const Options::AxisNames& axisNames )
{
Destroy();
// Read the serialized model from disk
std::ifstream file( trtPath, std::ios::binary | std::ios::ate );
std::streamsize size = file.tellg();
if (size < 0)
{
LOG_ERROR("Unable to read engine file!");
return false;
}
file.seekg( 0, std::ios::beg );
std::vector<char> buffer( size );
if ( !file.read( buffer.data(), size ) )
{
LOG_ERROR( "Unable to read engine file!" );
return false;
}
// Create runtime to deserialize the engine file.
m_runtime = std::unique_ptr<nvinfer1::IRuntime>( nvinfer1::createInferRuntime( s_logger ) );
if ( !m_runtime )
{
LOG_ERROR( "Unable to create a runtime inference model." );
return false;
}
// Set the device index
if ( cudaSetDevice( deviceIndex ) != cudaError_t::cudaSuccess )
{
int gpuCount;
cudaGetDeviceCount( &gpuCount );
LOG_ERROR( "Unable to set GPU device index to " + std::to_string( deviceIndex ) + ". Current device has " + std::to_string( gpuCount ) + " CUDA - capable GPU(s)." );
return false;
}
// Create an engine, a representation of the optimized model.
// skip the first 64 bytes when deserializing the engine file as they just contain a hash:
m_engine = std::unique_ptr<nvinfer1::ICudaEngine>( m_runtime->deserializeCudaEngine( buffer.data() + 64, buffer.size() - 64 ) );
if ( !m_engine )
{
LOG_ERROR("Unable to create engine.");
return false;
}
// The execution context contains all of the state associated with a particular invocation
m_context = std::unique_ptr<nvinfer1::IExecutionContext>( m_engine->createExecutionContext() );
if ( !m_context )
{
LOG_ERROR("Unable to create execution context.");
return false;
}
m_axis_names = axisNames;
const uint32_t tensorCount = m_engine->getNbIOTensors();
for (int32_t i = 0; i < tensorCount; ++i)
{
const auto tensorName = m_engine->getIOTensorName(i);
const auto tensorIOMode = m_engine->getTensorIOMode(tensorName);
m_dataTypeSizes[tensorName] = SizeOfTensorDataType(m_engine->getTensorDataType(tensorName));
}
return true;
}
bool InitInputs(const AxisSizes& axisSizes)
{
DestroyBuffers();
const uint32_t tensorCount = m_engine->getNbIOTensors();
for (int32_t i = 0; i < tensorCount; ++i)
{
const auto tensorName = m_engine->getIOTensorName(i);
const auto tensorIOMode = m_engine->getTensorIOMode(tensorName);
auto tensorShape = m_engine->getTensorShape(tensorName);
const auto tensorDataType = m_engine->getTensorDataType(tensorName);
for (int32_t n = 0; n < tensorShape.nbDims; ++n)
{
if (tensorShape.d[n] == -1)
{
int64_t batchSize = 1;
if (m_axis_names.contains(tensorName))
{
auto& dynamic_axis_names = m_axis_names.at(tensorName);
if (!dynamic_axis_names.contains(n))
{
LOG_ERROR("Tensor " + std::string(tensorName) + " has a dynamic axes, but its name isn't specified in axisNames");
return false;
}
auto axis_name = dynamic_axis_names.at(n);
if (!axisSizes.contains(axis_name))
{
LOG_ERROR("Named axis " + axis_name + " has no entry in axisSizes");
return false;
}
batchSize = axisSizes.at(axis_name);
}
else if (axisSizes.size() > 0)
{
batchSize = axisSizes.begin()->second;
}
tensorShape.d[n] = batchSize;
if (tensorIOMode == nvinfer1::TensorIOMode::kINPUT)
{
auto batchMin = m_engine->getProfileShape(tensorName, 0, nvinfer1::OptProfileSelector::kMIN).d[n];
auto batchMax = m_engine->getProfileShape(tensorName, 0, nvinfer1::OptProfileSelector::kMAX).d[n];
if (batchSize < batchMin || batchSize > batchMax)
{
LOG_ERROR("Batch size " + std::to_string(batchSize) + " is outside of possible range [ " + std::to_string(batchMin) + ", " + std::to_string(batchMax) + "].");
return false;
}
}
}
}
m_tensorShapes[tensorName] = tensorShape;
static const std::string dataTypeStr[] = { "FLOAT", "HALF", "INT8", "INT32", "BOOL", "UINT8", "FP8", "BF16", "INT64" };
static const std::string ioTypeStr[] = { "NONE", "INPUT", "OUTPUT" };
std::string tensorInfo = ioTypeStr[int(tensorIOMode)] + " Tensor: " + std::string(tensorName) + " [";
size_t elementCount = 1;
for (int32_t d = 0; d < tensorShape.nbDims; ++d)
{
if (d != 0)
tensorInfo += ", ";
tensorInfo += std::to_string(tensorShape.d[d]);
if (elementCount > INT64_MAX / tensorShape.d[d])
{
LOG_ERROR("Tensor too large: element count overflow");
return false;
}
elementCount *= tensorShape.d[d];
}
tensorInfo += "]. " + std::to_string(elementCount) + " elements of type " + dataTypeStr[int(tensorDataType)];
LOG_INFO(tensorInfo);
const auto sizeOfTensorData = SizeOfTensorDataType(tensorDataType);
if (sizeOfTensorData == -1)
{
LOG_ERROR("Unknown tensor data type " + std::to_string((int)tensorDataType) + ".");
return false;
}
void* cudaBuffer;
size_t size = elementCount * sizeOfTensorData;
auto err = cudaMalloc(&cudaBuffer, size);
s_logger.log(err);
if (err != cudaSuccess)
{
LOG_ERROR("Failed to allocate CUDA memory");
return false;
}
s_logger.log(cudaMemset(cudaBuffer, 0, size));
m_context->setTensorAddress(tensorName, cudaBuffer);
if (tensorIOMode == nvinfer1::TensorIOMode::kINPUT)
{
m_inputBuffers[tensorName] = cudaBuffer;
}
else
{
m_outputBuffers[tensorName] = cudaBuffer;
}
}
// Set input tensor shapes to specified batch size
for (int i = 0; i < tensorCount; ++i)
{
const auto tensorName = m_engine->getIOTensorName(i);
if (m_engine->getTensorIOMode(tensorName) != nvinfer1::TensorIOMode::kINPUT)
continue;
auto tensorShape = m_tensorShapes[tensorName];
m_context->setInputShape(tensorName, tensorShape);
}
return true;
}
void DestroyBuffers()
{
for (auto& kv : m_inputBuffers)
{
s_logger.log(cudaFree(kv.second));
}
for (auto& kv : m_outputBuffers)
{
s_logger.log(cudaFree(kv.second));
}
m_inputBuffers.clear();
m_outputBuffers.clear();
m_tensorShapes.clear();
}
void Destroy()
{
DestroyBuffers();
m_context.reset();
m_engine.reset();
m_runtime.reset();
}
bool ValidateTensorSize(const std::string& name, size_t byteCount) const
{
if (m_tensorShapes.empty())
{
LOG_ERROR("ValidateTensorSize: InitInputs has not been called.");
return false;
}
if (!m_tensorShapes.contains(name))
{
LOG_ERROR("ValidateTensorSize: Tensor " + name + " not found.");
return false;
}
size_t elementCount = 1;
const auto& tensorShape = m_tensorShapes.at(name);
for (int32_t d = 0; d < tensorShape.nbDims; ++d)
elementCount *= tensorShape.d[d];
const size_t expectedByteCount = elementCount * m_dataTypeSizes.at(name);
if (expectedByteCount != byteCount)
{
LOG_ERROR(
"Invalid data size for tensor [" + name + "] containing " + std::to_string(elementCount) + " elements. Expected " +
std::to_string(expectedByteCount) + " bytes, got " + std::to_string(byteCount) + " bytes instead.");
return false;
}
return true;
}
std::vector<std::string> GetInputBufferNames() const
{
std::vector<std::string> names;
names.reserve(m_inputBuffers.size());
for (const auto& pair : m_inputBuffers)
{
names.push_back(pair.first);
}
return names;
}
std::vector<std::string> GetOutputBufferNames() const
{
std::vector<std::string> names;
names.reserve(m_outputBuffers.size());
for (const auto& pair : m_outputBuffers)
{
names.push_back(pair.first);
}
return names;
}
void SetInputData(const std::string& name, const void* data, size_t byteCount)
{
if(!ValidateTensorSize(name, byteCount))
{
LOG_ERROR("SetInputData: Tensor " + name + " is not valid.");
return;
}
s_logger.log(cudaMemcpy(m_inputBuffers[name], data, byteCount, cudaMemcpyHostToDevice));
}
void SetInputDataAsync(const std::string& name, const void* data, size_t byteCount, cudaStream_t stream)
{
if(!ValidateTensorSize(name, byteCount))
{
LOG_ERROR("SetInputDataAsync: Tensor " + name + " is not valid.");
return;
}
s_logger.log(cudaMemcpyAsync(m_inputBuffers[name], data, byteCount, cudaMemcpyHostToDevice, stream));
}
void GetOutputData(const std::string& name, void* data, size_t byteCount)
{
if(!ValidateTensorSize(name, byteCount))
{
LOG_ERROR("GetOutputData: Tensor " + name + " is not valid.");
return;
}
s_logger.log(cudaMemcpy(data, m_outputBuffers[name], byteCount, cudaMemcpyDeviceToHost));
}
void GetOutputDataAsync(const std::string& name, void* data, size_t byteCount, cudaStream_t stream)
{
if(!ValidateTensorSize(name, byteCount))
{
LOG_ERROR("GetOutputDataAsync: Tensor " + name + " is not valid.");
return;
}
s_logger.log(cudaMemcpyAsync(data, m_outputBuffers[name], byteCount, cudaMemcpyDeviceToHost, stream));
}
bool Enqueue( cudaStream_t stream )
{
if (m_tensorShapes.empty())
{
LOG_ERROR("Enqueue: InitInputs has not been called.");
return false;
}
if (!m_context->allInputDimensionsSpecified())
{
LOG_ERROR("Inference engine inputs aren't defined.");
return false;
}
if(!m_context->enqueueV3(stream))
{
LOG_ERROR("Enqueue: Failed to enqueue.");
return false;
}
return true;
}
bool GetTensorShape(std::string name, std::vector<int64_t>& shape) const
{
if (m_tensorShapes.empty())
{
LOG_ERROR("ValidateTensorSize: InitInputs has not been called.");
return false;
}
if (!m_tensorShapes.contains(name))
{
LOG_ERROR("ValidateTensorSize: Tensor " + name + " not found.");
return false;
}
const auto& tensorShape = m_tensorShapes.at(name);
shape.clear();
for (int dim=0; dim < tensorShape.nbDims; ++dim)
{
shape.push_back(tensorShape.d[dim]);
}
return true;
}
nvinfer1::DataType GetTensorDataType(std::string name) const
{
auto tensorDataType = m_engine->getTensorDataType(name.c_str());
return tensorDataType;
}
std::unique_ptr<nvinfer1::IExecutionContext> m_context = nullptr;
std::unique_ptr<nvinfer1::ICudaEngine> m_engine = nullptr;
std::unique_ptr<nvinfer1::IRuntime> m_runtime = nullptr;
std::map<std::string, nvinfer1::Dims> m_tensorShapes;
std::map<std::string, void*> m_inputBuffers;
std::map<std::string, void*> m_outputBuffers;
std::map<std::string, int> m_dataTypeSizes;
Options::AxisNames m_axis_names;
};
TRTInferenceEngine::TRTInferenceEngine() : m_impl( new Impl )
{
}
TRTInferenceEngine::~TRTInferenceEngine()
{
}
bool TRTInferenceEngine::Initialize(const std::string& trtPath, int deviceIndex, const Options::AxisNames& axisNames)
{
return m_impl->Initialize(trtPath, deviceIndex, axisNames);
}
bool TRTInferenceEngine::InitInputs(const AxisSizes& axisSizes)
{
return m_impl->InitInputs(axisSizes);
}
void TRTInferenceEngine::Destroy()
{
m_impl->Destroy();
}
std::vector<std::string> TRTInferenceEngine::GetInputTensorNames() const
{
return m_impl->GetInputBufferNames();
}
std::vector<std::string> TRTInferenceEngine::GetOutputTensorNames() const
{
return m_impl->GetOutputBufferNames();
}
void TRTInferenceEngine::SetInputData(const std::string& name, const void* data, size_t byteCount)
{
m_impl->SetInputData(name, data, byteCount);
}
void TRTInferenceEngine::GetOutputData(const std::string& name, void* data, size_t byteCount)
{
m_impl->GetOutputData( name, data, byteCount);
}
void TRTInferenceEngine::SetInputDataAsync(const std::string& name, const void* data, size_t byteCount, cudaStream_t stream)
{
m_impl->SetInputDataAsync(name, data, byteCount, stream);
}
void TRTInferenceEngine::GetOutputDataAsync(const std::string& name, void* data, size_t byteCount, cudaStream_t stream)
{
m_impl->GetOutputDataAsync(name, data, byteCount, stream);
}
bool TRTInferenceEngine::Enqueue(cudaStream_t stream)
{
return m_impl->Enqueue(stream);
}
bool TRTInferenceEngine::GetTensorShape(std::string name, std::vector<int64_t>& shape) const
{
return m_impl->GetTensorShape(name, shape);
}
DataType TRTInferenceEngine::GetTensorDataType(std::string name) const
{
auto dataType = m_impl->GetTensorDataType(name);
switch (dataType)
{
case nvinfer1::DataType::kFLOAT:
return DataType::FLOAT;
case nvinfer1::DataType::kHALF:
return DataType::HALF;
case nvinfer1::DataType::kINT8:
return DataType::INT8;
case nvinfer1::DataType::kINT32:
return DataType::INT32;
case nvinfer1::DataType::kBOOL:
return DataType::BOOL;
case nvinfer1::DataType::kUINT8:
return DataType::UINT8;
case nvinfer1::DataType::kINT64:
return DataType::INT64;
default:
LOG_ERROR("ValidateTensorSize: Tensor " + name + " not found.");
return DataType::UNKNOWN;
}
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293#pragma once
#include "Utility.h"
#include <string>
#include <memory>
#include <vector>
#include <map>
enum class Precision
{
FP32,
FP16
};
enum class DataType
{
FLOAT,
HALF,
INT8,
INT32,
BOOL,
UINT8,
INT64,
UNKNOWN
};
struct Options
{
using AxisNames = std::map< std::string, std::map<int, std::string> >;
using AxisSizes = std::map<std::string, std::tuple<int, int, int> >;
using ShapeTensorSizes = std::map<std::string, std::tuple<std::vector<int>, std::vector<int>, std::vector<int>> >;
Precision precision = Precision::FP32;
AxisNames dynamic_axes_names;
AxisSizes dynamic_axes_sizes;
ShapeTensorSizes shape_tensor_sizes;
std::tuple<int, int, int> defaultSizes = { 1,8,16 };
int deviceID = 0;
};
bool ConvertONNXToTRT(
const Options& options,
const std::string& onnxModelPath,
std::string& generatedTRTFile,
const std::string prefix = "",
bool forceConvert = false
);
// Forward declaration
typedef struct CUstream_st *cudaStream_t;
class TRTInferenceEngine
{
public:
TRTInferenceEngine();
~TRTInferenceEngine();
using AxisSizes = std::map<std::string, int >;
bool Initialize(const std::string& trtPath, int deviceID, const Options::AxisNames& axisNames = {});
bool InitInputs(const AxisSizes& axisSizes = {});
void Destroy();
void SetInputData(const std::string& name, const void* data, size_t byteCount);
template<typename T> void SetInputData(const std::string& name, const T* data, size_t elementCount);
template<typename T> void SetInputData(const std::string& name, const TPinnedVector<T>& data);
void GetOutputData(const std::string& name, void* data, size_t byteCount);
template<typename T> void GetOutputData(const std::string& name, T* data, size_t elementCount);
template<typename T> void GetOutputData(const std::string& name, TPinnedVector<T>& data);
void SetInputDataAsync(const std::string& name, const void* data, size_t byteCount, cudaStream_t stream);
template<typename T> void SetInputDataAsync(const std::string& name, const T* data, size_t elementCount, cudaStream_t stream);
template<typename T> void SetInputDataAsync(const std::string& name, const TPinnedVector<T>& data, cudaStream_t stream);
void GetOutputDataAsync(const std::string& name, void* data, size_t byteCount, cudaStream_t stream);
template<typename T> void GetOutputDataAsync(const std::string& name, T* data, size_t elementCount, cudaStream_t stream);
template<typename T> void GetOutputDataAsync(const std::string& name, TPinnedVector<T>& data, cudaStream_t stream);
std::vector<std::string> GetInputTensorNames() const;
std::vector<std::string> GetOutputTensorNames() const;
bool GetTensorShape(std::string name, std::vector<int64_t>& shape) const;
DataType GetTensorDataType(std::string name) const;
bool Enqueue(cudaStream_t stream);
private:
class Impl;
std::shared_ptr<Impl> m_impl = nullptr;
};
#include "InferenceEngine.inl"third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_23dof.xmlAdded+477
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_29dof.xmlAdded+296
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_29dof_old.xmlAdded+521
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/g1_29dof_with_hand.xmlAdded+743
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_23dof.xmlAdded+23
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_29dof.xmlAdded+29
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_29dof_with_hand.xmlAdded+23
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/g1/scene_empty.xmlAdded+28
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/observation_config_example.yamlAdded+150
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config.yamlAdded+80
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config_low_latency.yamlAdded+92
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config_sonic_release.yamlAdded+79
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/release/observation_config_sonic_v1_1.yamlAdded+74
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/policy/sonic_v1_1/observation_config.yamlAdded+74
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/convert_motions.pyAdded+274
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464/info.txtAdded+52
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464/metadata.txtAdded+17
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464_M/info.txtAdded+52
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/dance_in_da_party_001__A464_M/metadata.txtAdded+17
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/forward_lunge_R_001__A359_M/info.txtAdded+51
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/forward_lunge_R_001__A359_M/metadata.txtAdded+17
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545/info.txtAdded+54
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545/metadata.txtAdded+17
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545_M/info.txtAdded+52
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/macarena_001__A545_M/metadata.txtAdded+17
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543/info.txtAdded+52
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543/metadata.txtAdded+17
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543_M/info.txtAdded+52
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/neutral_kick_R_001__A543_M/metadata.txtAdded+17
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/squat_001__A359/info.txtAdded+51
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/squat_001__A359/metadata.txtAdded+17
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_forward_lunge_R_001__A359_M/info.txtAdded+51
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_forward_lunge_R_001__A359_M/metadata.txtAdded+17
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359/info.txtAdded+53
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359/metadata.txtAdded+17
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359_M/info.txtAdded+51
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/tired_one_leg_jumping_R_001__A359_M/metadata.txtAdded+17
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428/info.txtAdded+51
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428/metadata.txtAdded+17
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428_M/info.txtAdded+51
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/reference/example/walking_quip_360_R_002__A428_M/metadata.txtAdded+17
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/install_deps.shAdded+926
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/install_ros2_humble.shAdded+163
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/restore_ubuntu_sources.shAdded+43
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/setup_env.shAdded+351
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/scripts/setup_wifi.shAdded+265
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/CMakeLists.txtAdded+3
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/TRTInference/CMakeLists.txtAdded+38
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/TRTInference/InferenceEngine.cppAdded+794
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/src/TRTInference/InferenceEngine.hAdded+93