robotic 0.2.9.dev1__cp312-cp312-manylinux2014_x86_64.whl → 0.3.0__cp312-cp312-manylinux2014_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- robotic/__init__.py +4 -0
- robotic/_robotic.pyi +13 -13
- robotic/_robotic.so +0 -0
- robotic/include/rai/Algo/rungeKutta.h +1 -1
- robotic/include/rai/Control/TimingMPC.h +2 -2
- robotic/include/rai/Core/array.h +64 -40
- robotic/include/rai/Core/array.ipp +247 -81
- robotic/include/rai/Core/arrayDouble.h +10 -13
- robotic/include/rai/Core/graph.h +22 -2
- robotic/include/rai/Core/h5.h +3 -1
- robotic/include/rai/Core/util.h +8 -7
- robotic/include/rai/Geo/fclInterface.h +3 -1
- robotic/include/rai/Geo/geo.h +6 -2
- robotic/include/rai/Geo/mesh.h +11 -5
- robotic/include/rai/Geo/pairCollision.h +4 -4
- robotic/include/rai/Gui/RenderData.h +4 -3
- robotic/include/rai/Gui/opengl.h +1 -1
- robotic/include/rai/KOMO/komo.h +1 -0
- robotic/include/rai/KOMO/manipTools.h +2 -2
- robotic/include/rai/Kin/F_forces.h +1 -1
- robotic/include/rai/Kin/dof_forceExchange.h +4 -4
- robotic/include/rai/Kin/frame.h +6 -5
- robotic/include/rai/Kin/kin.h +26 -17
- robotic/include/rai/Kin/kin_physx.h +2 -2
- robotic/include/rai/Logic/folWorld.h +1 -1
- robotic/include/rai/Optim/testProblems_Opt.h +2 -2
- robotic/include/rai/Optim/utils.h +2 -2
- robotic/include/rai/PathAlgos/ConfigurationProblem.h +3 -2
- robotic/include/rai/PathAlgos/RRT_PathFinder.h +1 -1
- robotic/include/rai/ry/types.h +3 -2
- robotic/librai.so +0 -0
- robotic/meshTool +0 -0
- robotic/mujoco-import.py +10 -0
- robotic/rai-robotModels/g1/g1.g +11 -2
- robotic/rai-robotModels/g1/g1_clean.g +38 -73
- robotic/rai-robotModels/g1/meshes/head_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/left_ankle_pitch_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/left_ankle_roll_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/left_elbow_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/left_hip_pitch_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/left_hip_roll_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/left_hip_yaw_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/left_knee_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/left_rubber_hand.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/left_shoulder_pitch_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/left_shoulder_roll_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/left_shoulder_yaw_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/left_wrist_pitch_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/left_wrist_roll_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/left_wrist_yaw_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/logo_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/pelvis.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/pelvis_contour_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/right_ankle_pitch_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/right_ankle_roll_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/right_elbow_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/right_hip_pitch_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/right_hip_roll_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/right_hip_yaw_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/right_knee_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/right_rubber_hand.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/right_shoulder_pitch_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/right_shoulder_roll_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/right_shoulder_yaw_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/right_wrist_pitch_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/right_wrist_roll_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/right_wrist_yaw_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/torso_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/waist_roll_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/waist_support_link.h5 +0 -0
- robotic/rai-robotModels/g1/meshes/waist_yaw_link.h5 +0 -0
- robotic/rai-robotModels/objects/shelf.g +1 -1
- robotic/rai-robotModels/panda/meshes/finger.h5 +0 -0
- robotic/rai-robotModels/panda/meshes/hand.h5 +0 -0
- robotic/rai-robotModels/panda/meshes/link0.h5 +0 -0
- robotic/rai-robotModels/panda/meshes/link1.h5 +0 -0
- robotic/rai-robotModels/panda/meshes/link2.h5 +0 -0
- robotic/rai-robotModels/panda/meshes/link3.h5 +0 -0
- robotic/rai-robotModels/panda/meshes/link4.h5 +0 -0
- robotic/rai-robotModels/panda/meshes/link5.h5 +0 -0
- robotic/rai-robotModels/panda/meshes/link6.h5 +0 -0
- robotic/rai-robotModels/panda/meshes/link7.h5 +0 -0
- robotic/rai-robotModels/panda/panda.g +1 -1
- robotic/rai-robotModels/panda/panda_arm_hand_conv.g +24 -0
- robotic/rai-robotModels/panda/panda_arm_hand_conv.yml +24 -0
- robotic/rai-robotModels/panda/panda_clean.g +21 -45
- robotic/rai-robotModels/panda/panda_gripper.g +3 -3
- robotic/rai-robotModels/pr2/meshes/base.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/base_color.png +0 -0
- robotic/rai-robotModels/pr2/meshes/caster.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/elbow_flex.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/elbow_flex_color.png +0 -0
- robotic/rai-robotModels/pr2/meshes/forearm.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/forearm_color.png +0 -0
- robotic/rai-robotModels/pr2/meshes/forearm_roll.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/gripper_palm.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/gripper_palm_color.png +0 -0
- robotic/rai-robotModels/pr2/meshes/head_pan.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/head_pan_color.png +0 -0
- robotic/rai-robotModels/pr2/meshes/head_tilt.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/head_tilt_color.png +0 -0
- robotic/rai-robotModels/pr2/meshes/l_finger.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/l_finger_color.png +0 -0
- robotic/rai-robotModels/pr2/meshes/l_finger_tip.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/l_finger_tip_color.png +0 -0
- robotic/rai-robotModels/pr2/meshes/shoulder_lift.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/shoulder_lift_color.png +0 -0
- robotic/rai-robotModels/pr2/meshes/shoulder_pan.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/shoulder_pan_color.png +0 -0
- robotic/rai-robotModels/pr2/meshes/tilting_hokuyo.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/tilting_hokuyo_color.png +0 -0
- robotic/rai-robotModels/pr2/meshes/torso_lift.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/torso_lift_color.png +0 -0
- robotic/rai-robotModels/pr2/meshes/upper_arm.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/upper_arm_color.png +0 -0
- robotic/rai-robotModels/pr2/meshes/upper_arm_roll.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/upper_arm_roll_color.png +0 -0
- robotic/rai-robotModels/pr2/meshes/wheel.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/wheel_color.png +0 -0
- robotic/rai-robotModels/pr2/meshes/wrist_color.png +0 -0
- robotic/rai-robotModels/pr2/meshes/wrist_flex.h5 +0 -0
- robotic/rai-robotModels/pr2/meshes/wrist_roll.h5 +0 -0
- robotic/rai-robotModels/pr2/pr2.g +7 -7
- robotic/rai-robotModels/pr2/pr2_clean.g +119 -115
- robotic/rai-robotModels/pr2/pr2_conv.g +218 -0
- robotic/rai-robotModels/pr2/pr2_modifications.g +2 -2
- robotic/rai-robotModels/ranger/meshes/ranger_mini3.h5 +0 -0
- robotic/rai-robotModels/ranger/meshes/ranger_mini_v3_wheel.h5 +0 -0
- robotic/rai-robotModels/ranger/meshes/ranger_mini_v3_wheel_right.h5 +0 -0
- robotic/rai-robotModels/ranger/ranger.g +8 -8
- robotic/rai-robotModels/ranger/ranger_clean.g +5 -5
- robotic/rai-robotModels/ranger/ranger_mini_conv.g +14 -0
- robotic/rai-robotModels/robotiq/meshes/robotiq_arg2f_85_base_link.h5 +0 -0
- robotic/rai-robotModels/robotiq/meshes/robotiq_arg2f_85_inner_finger.h5 +0 -0
- robotic/rai-robotModels/robotiq/meshes/robotiq_arg2f_85_inner_knuckle.h5 +0 -0
- robotic/rai-robotModels/robotiq/meshes/robotiq_arg2f_85_outer_finger.h5 +0 -0
- robotic/rai-robotModels/robotiq/meshes/robotiq_arg2f_85_outer_knuckle.h5 +0 -0
- robotic/rai-robotModels/robotiq/robotiq.g +2 -2
- robotic/rai-robotModels/robotiq/robotiq_clean.g +16 -16
- robotic/rai-robotModels/scenarios/ballFinger.g +2 -2
- robotic/rai-robotModels/scenarios/panda_fixRobotiq.g +3 -3
- robotic/rai-robotModels/tests/arm.g +11 -11
- robotic/rai-robotModels/tests/compound.g +3 -6
- robotic/rai-robotModels/ur10/meshes/base.h5 +0 -0
- robotic/rai-robotModels/ur10/meshes/forearm.h5 +0 -0
- robotic/rai-robotModels/ur10/meshes/shoulder.h5 +0 -0
- robotic/rai-robotModels/ur10/meshes/upperarm.h5 +0 -0
- robotic/rai-robotModels/ur10/meshes/wrist1.h5 +0 -0
- robotic/rai-robotModels/ur10/meshes/wrist2.h5 +0 -0
- robotic/rai-robotModels/ur10/meshes/wrist3.h5 +0 -0
- robotic/rai-robotModels/ur10/ur10.g +2 -2
- robotic/rai-robotModels/ur10/ur10_clean.g +8 -8
- robotic/rai-robotModels/ur10/ur10_conv.g +17 -0
- robotic/ry-h5info +2 -2
- robotic/ry-urdfConvert.py +74 -0
- robotic/src/cleanMeshes.py +59 -0
- robotic/src/config_urdf.py +237 -0
- robotic/src/mesh_helper.py +395 -0
- robotic/{rai-robotModels/ranger/meshes/cleanMeshes.mlx → src/meshlabFilters.mlx} +0 -3
- robotic/src/mujoco_io.py +242 -0
- robotic/src/yaml_helper.py +19 -0
- robotic/test.py +15 -0
- robotic/version.py +1 -1
- {robotic-0.2.9.dev1.data → robotic-0.3.0.data}/scripts/ry-h5info +2 -2
- robotic-0.3.0.data/scripts/ry-urdfConvert.py +74 -0
- {robotic-0.2.9.dev1.dist-info → robotic-0.3.0.dist-info}/METADATA +3 -7
- robotic-0.3.0.dist-info/RECORD +367 -0
- {robotic-0.2.9.dev1.dist-info → robotic-0.3.0.dist-info}/WHEEL +1 -1
- robotic/import.py +0 -0
- robotic/rai-robotModels/baxter/baxter.g +0 -49
- robotic/rai-robotModels/baxter/baxter_clean.g +0 -116
- robotic/rai-robotModels/baxter/baxter_clean2.g +0 -205
- robotic/rai-robotModels/baxter/baxter_clean3.g +0 -223
- robotic/rai-robotModels/baxter/baxter_description/meshes/base/PEDESTAL.ply +0 -0
- robotic/rai-robotModels/baxter/baxter_description/meshes/base/pedestal_link_collision.ply +0 -0
- robotic/rai-robotModels/baxter/baxter_description/meshes/head/H0.ply +0 -0
- robotic/rai-robotModels/baxter/baxter_description/meshes/head/H1.ply +0 -0
- robotic/rai-robotModels/baxter/baxter_description/meshes/lower_elbow/E1.ply +0 -0
- robotic/rai-robotModels/baxter/baxter_description/meshes/lower_forearm/W1.ply +0 -0
- robotic/rai-robotModels/baxter/baxter_description/meshes/lower_shoulder/S1.ply +0 -0
- robotic/rai-robotModels/baxter/baxter_description/meshes/torso/base_link.ply +0 -0
- robotic/rai-robotModels/baxter/baxter_description/meshes/torso/base_link_collision.ply +0 -0
- robotic/rai-robotModels/baxter/baxter_description/meshes/upper_elbow/E0.ply +0 -0
- robotic/rai-robotModels/baxter/baxter_description/meshes/upper_forearm/W0.ply +0 -0
- robotic/rai-robotModels/baxter/baxter_description/meshes/upper_shoulder/S0.ply +0 -0
- robotic/rai-robotModels/baxter/baxter_description/meshes/wrist/W2.ply +0 -0
- robotic/rai-robotModels/baxter/baxter_new.g +0 -53
- robotic/rai-robotModels/baxter/rethink_ee_description/meshes/electric_gripper/electric_gripper_base.ply +0 -0
- robotic/rai-robotModels/baxter/rethink_ee_description/meshes/electric_gripper/fingers/extended_narrow.ply +0 -0
- robotic/rai-robotModels/baxter/rethink_ee_description/meshes/electric_gripper/fingers/half_round_tip.ply +0 -0
- robotic/rai-robotModels/baxter/rethink_ee_description/meshes/electric_gripper/fingers/paddle_tip.ply +0 -0
- robotic/rai-robotModels/baxter/rethink_ee_description/meshes/pneumatic_gripper/pneumatic_gripper_base.ply +0 -0
- robotic/rai-robotModels/baxter/rethink_ee_description/meshes/pneumatic_gripper/pneumatic_gripper_w_cup.ply +0 -0
- robotic/rai-robotModels/g1/meshes/head_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_ankle_pitch_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_ankle_roll_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_elbow_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_hand_index_0_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_hand_index_1_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_hand_middle_0_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_hand_middle_1_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_hand_palm_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_hand_thumb_0_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_hand_thumb_1_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_hand_thumb_2_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_hip_pitch_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_hip_roll_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_hip_yaw_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_knee_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_rubber_hand.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_shoulder_pitch_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_shoulder_roll_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_shoulder_yaw_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_wrist_pitch_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_wrist_roll_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_wrist_roll_rubber_hand.ply +0 -0
- robotic/rai-robotModels/g1/meshes/left_wrist_yaw_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/logo_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/pelvis.ply +0 -0
- robotic/rai-robotModels/g1/meshes/pelvis_contour_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_ankle_pitch_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_ankle_roll_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_elbow_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_hand_index_0_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_hand_index_1_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_hand_middle_0_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_hand_middle_1_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_hand_palm_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_hand_thumb_0_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_hand_thumb_1_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_hand_thumb_2_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_hip_pitch_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_hip_roll_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_hip_yaw_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_knee_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_rubber_hand.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_shoulder_pitch_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_shoulder_roll_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_shoulder_yaw_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_wrist_pitch_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_wrist_roll_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_wrist_roll_rubber_hand.ply +0 -0
- robotic/rai-robotModels/g1/meshes/right_wrist_yaw_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/torso_constraint_L_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/torso_constraint_L_rod_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/torso_constraint_R_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/torso_constraint_R_rod_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/torso_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/waist_constraint_L.ply +0 -0
- robotic/rai-robotModels/g1/meshes/waist_constraint_R.ply +0 -0
- robotic/rai-robotModels/g1/meshes/waist_roll_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/waist_support_link.ply +0 -0
- robotic/rai-robotModels/g1/meshes/waist_yaw_link.ply +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/collision/finger.stl +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/collision/hand.stl +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/collision/link0.stl +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/collision/link1.stl +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/collision/link2.stl +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/collision/link3.stl +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/collision/link4.stl +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/collision/link5.stl +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/collision/link6.stl +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/collision/link7.stl +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/visual/HOWTO.sh +0 -10
- robotic/rai-robotModels/panda/franka_description/meshes/visual/HOWTO2.sh +0 -7
- robotic/rai-robotModels/panda/franka_description/meshes/visual/convMeshes.mlx +0 -38
- robotic/rai-robotModels/panda/franka_description/meshes/visual/finger.ply +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/visual/hand.ply +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/visual/link0.ply +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/visual/link1.ply +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/visual/link2.ply +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/visual/link3.ply +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/visual/link4.ply +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/visual/link5.ply +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/visual/link6.ply +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/visual/link7.ply +0 -0
- robotic/rai-robotModels/panda/franka_description/meshes/visual/script.mlx +0 -28
- robotic/rai-robotModels/pr2/pr2_description/meshes/base_v0/base.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/base_v0/base_L.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/base_v0/caster.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/base_v0/caster_L.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/base_v0/pr2_wheel.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/base_v0/wheel.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/forearm_v0/forearm.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/forearm_v0/wrist_flex.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/forearm_v0/wrist_roll.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/forearm_v0/wrist_roll_L.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/gripper_v0/gripper_palm.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/gripper_v0/l_finger.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/gripper_v0/l_finger_tip.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/head_v0/head_pan.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/head_v0/head_pan_L.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/head_v0/head_tilt.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/head_v0/head_tilt_L.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/shoulder_v0/shoulder_lift.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/shoulder_v0/shoulder_pan.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/shoulder_v0/shoulder_yaw.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/shoulder_v0/upper_arm_roll.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/shoulder_v0/upper_arm_roll_L.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/tilting_laser_v0/hok_tilt.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/tilting_laser_v0/tilting_hokuyo.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/tilting_laser_v0/tilting_hokuyo_L.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/torso_v0/torso.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/torso_v0/torso_lift.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/torso_v0/torso_lift_L.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/upper_arm_v0/elbow_flex.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/upper_arm_v0/forearm_roll.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/upper_arm_v0/forearm_roll_L.ply +0 -0
- robotic/rai-robotModels/pr2/pr2_description/meshes/upper_arm_v0/upper_arm.ply +0 -0
- robotic/rai-robotModels/ranger/meshes/cleanMeshes.sh +0 -8
- robotic/rai-robotModels/ranger/meshes/ranger_mini3.ply +0 -0
- robotic/rai-robotModels/ranger/meshes/ranger_mini_v3_wheel.ply +0 -0
- robotic/rai-robotModels/ranger/meshes/ranger_mini_v3_wheel_right.ply +0 -0
- robotic/rai-robotModels/robotiq/meshes/visual/robotiq_arg2f_85_base_link.ply +0 -0
- robotic/rai-robotModels/robotiq/meshes/visual/robotiq_arg2f_85_base_link_x.ply +0 -10
- robotic/rai-robotModels/robotiq/meshes/visual/robotiq_arg2f_85_inner_finger.ply +0 -0
- robotic/rai-robotModels/robotiq/meshes/visual/robotiq_arg2f_85_inner_knuckle.ply +0 -0
- robotic/rai-robotModels/robotiq/meshes/visual/robotiq_arg2f_85_outer_finger.ply +0 -0
- robotic/rai-robotModels/robotiq/meshes/visual/robotiq_arg2f_85_outer_knuckle.ply +0 -0
- robotic/rai-robotModels/robotiq/meshes/visual/robotiq_arg2f_85_pad.ply +0 -0
- robotic/rai-robotModels/robotiq/meshes/visual/robotiq_gripper_coupling.ply +0 -0
- robotic/rai-robotModels/ur10/ur_description/meshes/ur10/visual/Base.ply +0 -0
- robotic/rai-robotModels/ur10/ur_description/meshes/ur10/visual/Forearm.ply +0 -0
- robotic/rai-robotModels/ur10/ur_description/meshes/ur10/visual/Shoulder.ply +0 -0
- robotic/rai-robotModels/ur10/ur_description/meshes/ur10/visual/UpperArm.ply +0 -0
- robotic/rai-robotModels/ur10/ur_description/meshes/ur10/visual/Wrist1.ply +0 -0
- robotic/rai-robotModels/ur10/ur_description/meshes/ur10/visual/Wrist2.ply +0 -0
- robotic/rai-robotModels/ur10/ur_description/meshes/ur10/visual/Wrist3.ply +0 -0
- robotic/ry-urdf2rai +0 -222
- robotic/ry-urdf2yaml +0 -250
- robotic-0.2.9.dev1.data/scripts/ry-urdf2rai +0 -222
- robotic-0.2.9.dev1.data/scripts/ry-urdf2yaml +0 -250
- robotic-0.2.9.dev1.dist-info/RECORD +0 -421
- /robotic/rai-robotModels/robotiq/meshes/{visual/robotiq_ft300.ply → robotiq_ft300.ply} +0 -0
- {robotic-0.2.9.dev1.data → robotic-0.3.0.data}/scripts/ry-bot +0 -0
- {robotic-0.2.9.dev1.data → robotic-0.3.0.data}/scripts/ry-info +0 -0
- {robotic-0.2.9.dev1.data → robotic-0.3.0.data}/scripts/ry-meshTool +0 -0
- {robotic-0.2.9.dev1.data → robotic-0.3.0.data}/scripts/ry-test +0 -0
- {robotic-0.2.9.dev1.data → robotic-0.3.0.data}/scripts/ry-view +0 -0
- {robotic-0.2.9.dev1.dist-info → robotic-0.3.0.dist-info}/licenses/LICENSE +0 -0
- {robotic-0.2.9.dev1.dist-info → robotic-0.3.0.dist-info}/top_level.txt +0 -0
robotic/ry-urdf2rai
DELETED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
|
|
3
|
-
import sys
|
|
4
|
-
from lxml import etree
|
|
5
|
-
import argparse
|
|
6
|
-
|
|
7
|
-
parser = argparse.ArgumentParser(description='convert urdf to yaml (rai convention)')
|
|
8
|
-
|
|
9
|
-
parser.add_argument('urdf_file', type=str,
|
|
10
|
-
help='required input file')
|
|
11
|
-
|
|
12
|
-
parser.add_argument('-coll', type=bool, default=False,
|
|
13
|
-
help='use collision shapes?')
|
|
14
|
-
|
|
15
|
-
parser.add_argument('-meshRemove', type=str, default='package://',
|
|
16
|
-
help='a prefix from the mesh files to be removed')
|
|
17
|
-
|
|
18
|
-
parser.add_argument('-meshExt', type=str,
|
|
19
|
-
help='overwrite the mesh file extension')
|
|
20
|
-
|
|
21
|
-
args = parser.parse_args()
|
|
22
|
-
|
|
23
|
-
inFile = args.urdf_file
|
|
24
|
-
xmlData = etree.parse(inFile)
|
|
25
|
-
|
|
26
|
-
useCollisionShapes = False
|
|
27
|
-
if args.coll:
|
|
28
|
-
useCollisionShapes = True
|
|
29
|
-
|
|
30
|
-
def writeShape(link):
|
|
31
|
-
elem = link.find('origin')
|
|
32
|
-
if elem is not None:
|
|
33
|
-
xyz = elem.attrib.get('xyz')
|
|
34
|
-
rpy = elem.attrib.get('rpy')
|
|
35
|
-
if rpy=='0 0 0':
|
|
36
|
-
rpy=None
|
|
37
|
-
if xyz=='0 0 0':
|
|
38
|
-
xyz=None
|
|
39
|
-
if xyz is not None and rpy is not None:
|
|
40
|
-
print(' rel: "t(%s) E(%s)",' % (xyz, rpy), end='')
|
|
41
|
-
else:
|
|
42
|
-
if rpy is not None:
|
|
43
|
-
print(' rel: "E(%s)",' % (rpy), end='')
|
|
44
|
-
if xyz is not None:
|
|
45
|
-
print(' rel: [%s],' % (xyz), end='')
|
|
46
|
-
|
|
47
|
-
elem = link.find('geometry/box')
|
|
48
|
-
if elem is not None:
|
|
49
|
-
print(' shape: box\n size: [%s 0],' % elem.attrib['size'], end='')
|
|
50
|
-
|
|
51
|
-
elem = link.find('geometry/sphere')
|
|
52
|
-
if elem is not None:
|
|
53
|
-
print(' shape: sphere\n size: [0 0 0 %s],' % elem.attrib['radius'], end='')
|
|
54
|
-
|
|
55
|
-
elem = link.find('geometry/cylinder')
|
|
56
|
-
if elem is not None:
|
|
57
|
-
print(' shape: cylinder\n size: [0 0 %s %s],' % (elem.attrib['length'], elem.attrib['radius']), end='')
|
|
58
|
-
|
|
59
|
-
elem = link.find('geometry/mesh')
|
|
60
|
-
if elem is not None:
|
|
61
|
-
filename = elem.attrib['filename'].replace(args.meshRemove,'',1)
|
|
62
|
-
if args.meshExt is not None:
|
|
63
|
-
filename = filename[:-3] + args.meshExt
|
|
64
|
-
print(' mesh: <%s>,' % filename, end='')
|
|
65
|
-
if elem.find('scale') is not None:
|
|
66
|
-
print(' meshscale: [%s],' % elem.attrib['scale'], end='')
|
|
67
|
-
|
|
68
|
-
elem = link.find('material/color')
|
|
69
|
-
if elem is not None:
|
|
70
|
-
print(' color: [%s],' % elem.attrib['rgba'], end='')
|
|
71
|
-
|
|
72
|
-
# elem = link.find('material')
|
|
73
|
-
# if elem is not None:
|
|
74
|
-
# if elem.attrib['name'] is not None:
|
|
75
|
-
# print('colorName:%s' % elem.attrib['name'])
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
links = xmlData.findall('./link')
|
|
79
|
-
for link in links:
|
|
80
|
-
name = link.attrib['name']
|
|
81
|
-
print('%s: {' % name, end='')
|
|
82
|
-
|
|
83
|
-
elem = link.find('inertial/mass')
|
|
84
|
-
if elem is not None:
|
|
85
|
-
print(' mass: %s,' % elem.attrib['value'], end='')
|
|
86
|
-
|
|
87
|
-
elem = link.find('inertial/inertia')
|
|
88
|
-
if elem is not None:
|
|
89
|
-
print(' inertia: [%s %s %s %s %s %s],' % (
|
|
90
|
-
elem.attrib['ixx'],
|
|
91
|
-
elem.attrib['ixy'],
|
|
92
|
-
elem.attrib['ixz'],
|
|
93
|
-
elem.attrib['iyy'],
|
|
94
|
-
elem.attrib['iyz'],
|
|
95
|
-
elem.attrib['izz']), end='')
|
|
96
|
-
|
|
97
|
-
print('}') # end of body
|
|
98
|
-
|
|
99
|
-
# visual shape
|
|
100
|
-
for visual in link.findall('visual'):
|
|
101
|
-
print('%s_0 (%s): {' % (name, name), end='')
|
|
102
|
-
writeShape(visual)
|
|
103
|
-
#if not useCollisionShapes:
|
|
104
|
-
# print(' contact: -2,', end='')
|
|
105
|
-
print(' visual: true }') # end of shape
|
|
106
|
-
|
|
107
|
-
# collision shape
|
|
108
|
-
if useCollisionShapes:
|
|
109
|
-
for collision in link.findall('collision'):
|
|
110
|
-
print('%s_1 (%s): {' % (name, name), end='')
|
|
111
|
-
print(' color: [.8 .2 .2 .5],', end='')
|
|
112
|
-
writeShape(collision)
|
|
113
|
-
print(' contact: -2 }') # end of shape
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
joints = xmlData.findall('./joint')
|
|
117
|
-
for joint in joints:
|
|
118
|
-
name = joint.attrib['name']
|
|
119
|
-
if joint.find('child') is not None:
|
|
120
|
-
|
|
121
|
-
parent = joint.find('parent').attrib['link']
|
|
122
|
-
|
|
123
|
-
# add an origin frame as pre frame?
|
|
124
|
-
elem = joint.find('origin')
|
|
125
|
-
if elem is not None:
|
|
126
|
-
xyz = elem.attrib.get('xyz')
|
|
127
|
-
rpy = elem.attrib.get('rpy')
|
|
128
|
-
if rpy=='0 0 0':
|
|
129
|
-
rpy=None
|
|
130
|
-
if xyz=='0 0 0':
|
|
131
|
-
xyz=None
|
|
132
|
-
if xyz is not None and rpy is not None:
|
|
133
|
-
print('%s (%s): { Q: "t(%s) E(%s)" }' % (name+'_origin', parent, xyz, rpy))
|
|
134
|
-
parent = name+'_origin'
|
|
135
|
-
elif rpy is not None:
|
|
136
|
-
print('%s (%s): { Q: "E(%s)" }' % (name+'_origin', parent, rpy))
|
|
137
|
-
parent = name+'_origin'
|
|
138
|
-
elif xyz is not None:
|
|
139
|
-
print('%s (%s): { Q: [%s] }' % (name+'_origin', parent, xyz))
|
|
140
|
-
parent = name+'_origin'
|
|
141
|
-
|
|
142
|
-
#print('%s (%s): {' % (name, parent), end='')
|
|
143
|
-
print('%s (%s %s): {' % (name, parent, joint.find('child').attrib['link']), end='')
|
|
144
|
-
|
|
145
|
-
# figure out joint type
|
|
146
|
-
att = joint.attrib.get('type')
|
|
147
|
-
|
|
148
|
-
if att in ['revolute', 'continuous']:
|
|
149
|
-
elem = joint.find('axis')
|
|
150
|
-
if elem is not None:
|
|
151
|
-
axis = elem.attrib['xyz']
|
|
152
|
-
if axis=='1 0 0':
|
|
153
|
-
print(' joint: hingeX,', end='')
|
|
154
|
-
elif axis=='0 1 0':
|
|
155
|
-
print(' joint: hingeY,', end='')
|
|
156
|
-
elif axis=='0 0 1':
|
|
157
|
-
print(' joint: hingeZ,', end='')
|
|
158
|
-
elif axis=='0 0 -1':
|
|
159
|
-
print(' joint: hingeZ, joint_scale: -1,', end='')
|
|
160
|
-
else:
|
|
161
|
-
raise Exception('CAN ONLY PROCESS X Y Z prismatic joints, not', axis)
|
|
162
|
-
else:
|
|
163
|
-
print(' joint: hingeX,', end='')
|
|
164
|
-
|
|
165
|
-
if att == 'prismatic':
|
|
166
|
-
elem = joint.find('axis')
|
|
167
|
-
if elem is not None:
|
|
168
|
-
axis = elem.attrib['xyz']
|
|
169
|
-
if axis=='1 0 0':
|
|
170
|
-
print(' joint: transX,', end='')
|
|
171
|
-
elif axis=='0 1 0':
|
|
172
|
-
print(' joint: transY,', end='')
|
|
173
|
-
elif axis=='0 -1 0':
|
|
174
|
-
print(' joint: transY, joint_scale: -1,', end='')
|
|
175
|
-
elif axis=='0 0 1':
|
|
176
|
-
print(' joint: transZ,', end='')
|
|
177
|
-
elif axis=='0 0 -1':
|
|
178
|
-
print(' joint: transZ, joint_scale: -1,', end='')
|
|
179
|
-
else:
|
|
180
|
-
raise Exception('CAN ONLY PROCESS X Y Z prismatic joints, not', axis)
|
|
181
|
-
else:
|
|
182
|
-
print(' joint: transX,', end='')
|
|
183
|
-
|
|
184
|
-
if att == 'fixed':
|
|
185
|
-
print(' joint: rigid,', end='')
|
|
186
|
-
|
|
187
|
-
elem = joint.find('mimic')
|
|
188
|
-
if elem is not None:
|
|
189
|
-
print(' mimic: %s,' % elem.attrib['joint'], end='')
|
|
190
|
-
|
|
191
|
-
#elem = joint.find('axis')
|
|
192
|
-
#if elem is not None:
|
|
193
|
-
# print('axis:[%s]' % elem.attrib['xyz'])
|
|
194
|
-
|
|
195
|
-
elem = joint.find('limit')
|
|
196
|
-
if elem is not None:
|
|
197
|
-
lo = elem.attrib.get('lower')
|
|
198
|
-
up = elem.attrib.get('upper')
|
|
199
|
-
eff = elem.attrib.get('effort')
|
|
200
|
-
vel = elem.attrib.get('velocity')
|
|
201
|
-
if eff=='0':
|
|
202
|
-
eff=None
|
|
203
|
-
if vel=='0':
|
|
204
|
-
vel=None
|
|
205
|
-
if lo is not None:
|
|
206
|
-
print(' limits: [%s %s],' % (lo, up), end='')
|
|
207
|
-
if vel is not None:
|
|
208
|
-
print(' ctrl_limits: [%s -1 %s],' % (vel, eff), end='') #the 2nd value is an acceleration limit
|
|
209
|
-
else:
|
|
210
|
-
elem = joint.find('safety_controller')
|
|
211
|
-
if elem is not None:
|
|
212
|
-
lo = elem.attrib.get('soft_lower_limit')
|
|
213
|
-
up = elem.attrib.get('soft_upper_limit')
|
|
214
|
-
if lo is not None:
|
|
215
|
-
print(' limits: [%s %s],' % (lo, up), end='')
|
|
216
|
-
|
|
217
|
-
print('}')
|
|
218
|
-
|
|
219
|
-
#print('Edit %s (%s): {}' % (joint.find('child').attrib['link'], name) )
|
|
220
|
-
|
|
221
|
-
#print(etree.tostring(links[22]))
|
|
222
|
-
#print(etree.tostring(joints[0]))
|
robotic/ry-urdf2yaml
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
|
|
3
|
-
import sys
|
|
4
|
-
from lxml import etree
|
|
5
|
-
import argparse
|
|
6
|
-
import yaml
|
|
7
|
-
#from ruamel import yaml
|
|
8
|
-
|
|
9
|
-
parser = argparse.ArgumentParser(description='convert urdf to yaml (rai convention)')
|
|
10
|
-
|
|
11
|
-
parser.add_argument('urdf_file', type=str,
|
|
12
|
-
help='required input file')
|
|
13
|
-
|
|
14
|
-
parser.add_argument('-coll', type=bool, default=False,
|
|
15
|
-
help='use collision shapes?')
|
|
16
|
-
|
|
17
|
-
parser.add_argument('-meshRemove', type=str, default='package://',
|
|
18
|
-
help='a prefix from the mesh files to be removed')
|
|
19
|
-
|
|
20
|
-
parser.add_argument('-meshExt', type=str,
|
|
21
|
-
help='overwrite the mesh file extension')
|
|
22
|
-
|
|
23
|
-
args = parser.parse_args()
|
|
24
|
-
|
|
25
|
-
# yaml dump tweaks
|
|
26
|
-
class noflow_dict(dict):
|
|
27
|
-
pass
|
|
28
|
-
def noflow_dict_rep(dumper, data):
|
|
29
|
-
return dumper.represent_mapping("tag:yaml.org,2002:map", data, flow_style=False)
|
|
30
|
-
yaml.add_representer(noflow_dict, noflow_dict_rep)
|
|
31
|
-
|
|
32
|
-
class quoted_string(str):
|
|
33
|
-
pass
|
|
34
|
-
def quoted_string_rep(dumper, data):
|
|
35
|
-
return dumper.represent_scalar("tag:yaml.org,2002:str", data, style='"')
|
|
36
|
-
yaml.add_representer(quoted_string, quoted_string_rep)
|
|
37
|
-
|
|
38
|
-
def writeShape(_elem, link):
|
|
39
|
-
elem = link.find('origin')
|
|
40
|
-
if elem is not None:
|
|
41
|
-
xyz = elem.attrib.get('xyz')
|
|
42
|
-
rpy = elem.attrib.get('rpy')
|
|
43
|
-
if rpy=='0 0 0':
|
|
44
|
-
rpy=None
|
|
45
|
-
if xyz=='0 0 0':
|
|
46
|
-
xyz=None
|
|
47
|
-
if xyz is not None and rpy is not None:
|
|
48
|
-
_elem['rel'] = quoted_string("t(%s) E(%s)" % (xyz, rpy))
|
|
49
|
-
else:
|
|
50
|
-
if rpy is not None:
|
|
51
|
-
_elem['rel'] = quoted_string("E(%s)" % (rpy))
|
|
52
|
-
if xyz is not None:
|
|
53
|
-
_elem['rel'] = quoted_string("[%s]" % (xyz))
|
|
54
|
-
|
|
55
|
-
elem = link.find('geometry/box')
|
|
56
|
-
if elem is not None:
|
|
57
|
-
_elem['shape']='box'
|
|
58
|
-
_elem['size'] = [float(s) for s in elem.attrib['size'].split()]
|
|
59
|
-
|
|
60
|
-
elem = link.find('geometry/sphere')
|
|
61
|
-
if elem is not None:
|
|
62
|
-
_elem['shape']='sphere'
|
|
63
|
-
_elem['size'] = [float(elem.attrib['radius'])]
|
|
64
|
-
|
|
65
|
-
elem = link.find('geometry/cylinder')
|
|
66
|
-
if elem is not None:
|
|
67
|
-
_elem['shape']='cylinder'
|
|
68
|
-
_elem['size'] = [float(elem.attrib['length']), float(elem.attrib['radius'])]
|
|
69
|
-
|
|
70
|
-
elem = link.find('geometry/mesh')
|
|
71
|
-
if elem is not None:
|
|
72
|
-
filename = elem.attrib['filename'].replace(args.meshRemove,'',1)
|
|
73
|
-
if args.meshExt is not None:
|
|
74
|
-
filename = filename[:-3] + args.meshExt
|
|
75
|
-
_elem['mesh'] = '<%s>' % filename
|
|
76
|
-
if elem.find('scale') is not None:
|
|
77
|
-
_elem['meshscale'] = float(elem.attrib['scale'])
|
|
78
|
-
|
|
79
|
-
elem = link.find('material/color')
|
|
80
|
-
if elem is not None:
|
|
81
|
-
_elem['color'] = elem.attrib['rgba']
|
|
82
|
-
|
|
83
|
-
# elem = link.find('material')
|
|
84
|
-
# if elem is not None:
|
|
85
|
-
# if elem.attrib['name'] is not None:
|
|
86
|
-
# print('colorName:%s' % elem.attrib['name'])
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
def addLink(config, link, useCollisionShapes):
|
|
90
|
-
name = link.attrib['name']
|
|
91
|
-
_link = dict()
|
|
92
|
-
config[name] = _link
|
|
93
|
-
|
|
94
|
-
elem = link.find('inertial/mass')
|
|
95
|
-
if elem is not None:
|
|
96
|
-
_link['mass'] = float(elem.attrib['value'])
|
|
97
|
-
|
|
98
|
-
elem = link.find('inertial/inertia')
|
|
99
|
-
if elem is not None:
|
|
100
|
-
_link['inertia'] = [float(elem.attrib['ixx']), float(elem.attrib['ixy']), float(elem.attrib['ixz']),
|
|
101
|
-
float(elem.attrib['iyy']), float(elem.attrib['iyz']),
|
|
102
|
-
float(elem.attrib['izz'])]
|
|
103
|
-
|
|
104
|
-
# visual shape
|
|
105
|
-
for visual in link.findall('visual'):
|
|
106
|
-
_shape = dict()
|
|
107
|
-
config[f'{name}_0 ({name})'] = _shape
|
|
108
|
-
writeShape(_shape, visual)
|
|
109
|
-
_shape['visual'] = True
|
|
110
|
-
|
|
111
|
-
# collision shape
|
|
112
|
-
if useCollisionShapes:
|
|
113
|
-
for collision in link.findall('collision'):
|
|
114
|
-
_shape = dict()
|
|
115
|
-
config[f'{name}_1 ({name})'] = _shape
|
|
116
|
-
_shape['color'] = [.8, .2, .2, .5]
|
|
117
|
-
writeShape(_shape, collision)
|
|
118
|
-
_shape['contact'] = -2
|
|
119
|
-
|
|
120
|
-
def addJoint(config, joint):
|
|
121
|
-
name = joint.attrib['name']
|
|
122
|
-
|
|
123
|
-
if joint.find('child') is not None:
|
|
124
|
-
|
|
125
|
-
parent = joint.find('parent').attrib['link']
|
|
126
|
-
|
|
127
|
-
# add an origin frame as pre frame?
|
|
128
|
-
elem = joint.find('origin')
|
|
129
|
-
if elem is not None:
|
|
130
|
-
xyz = elem.attrib.get('xyz')
|
|
131
|
-
rpy = elem.attrib.get('rpy')
|
|
132
|
-
if rpy=='0 0 0':
|
|
133
|
-
rpy=None
|
|
134
|
-
if xyz=='0 0 0':
|
|
135
|
-
xyz=None
|
|
136
|
-
if xyz is not None and rpy is not None:
|
|
137
|
-
_joint = dict()
|
|
138
|
-
config[f'{name+"_origin"} ({parent})'] = _joint
|
|
139
|
-
_joint['Q'] = quoted_string("t(%s) E(%s)" % (xyz, rpy))
|
|
140
|
-
parent = name+'_origin'
|
|
141
|
-
elif rpy is not None:
|
|
142
|
-
_joint = dict()
|
|
143
|
-
config[f'{name+"_origin"} ({parent})'] = _joint
|
|
144
|
-
_joint['Q'] = quoted_string("E(%s)" % (rpy))
|
|
145
|
-
parent = name+'_origin'
|
|
146
|
-
elif xyz is not None:
|
|
147
|
-
_joint = dict()
|
|
148
|
-
config[f'{name+"_origin"} ({parent})'] = _joint
|
|
149
|
-
_joint['Q'] = quoted_string("t(%s)" % (xyz))
|
|
150
|
-
parent = name+'_origin'
|
|
151
|
-
|
|
152
|
-
_joint = dict()
|
|
153
|
-
config[f'{name} ({parent} {joint.find("child").attrib["link"]})'] = _joint
|
|
154
|
-
|
|
155
|
-
# figure out joint type
|
|
156
|
-
att = joint.attrib.get('type')
|
|
157
|
-
|
|
158
|
-
if att in ['revolute', 'continuous']:
|
|
159
|
-
elem = joint.find('axis')
|
|
160
|
-
if elem is not None:
|
|
161
|
-
axis = elem.attrib['xyz']
|
|
162
|
-
if axis=='1 0 0':
|
|
163
|
-
_joint['joint'] = 'hingeX'
|
|
164
|
-
elif axis=='0 1 0':
|
|
165
|
-
_joint['joint'] = 'hingeY'
|
|
166
|
-
elif axis=='0 0 1':
|
|
167
|
-
_joint['joint'] = 'hingeZ'
|
|
168
|
-
elif axis=='0 0 -1':
|
|
169
|
-
_joint['joint'] = 'hingeZ'
|
|
170
|
-
_joint['joint_scale'] = -1
|
|
171
|
-
else:
|
|
172
|
-
raise Exception('CAN ONLY PROCESS X Y Z prismatic joints, not', axis)
|
|
173
|
-
else:
|
|
174
|
-
_joint['joint'] = 'hingeX'
|
|
175
|
-
|
|
176
|
-
if att == 'prismatic':
|
|
177
|
-
elem = joint.find('axis')
|
|
178
|
-
if elem is not None:
|
|
179
|
-
axis = elem.attrib['xyz']
|
|
180
|
-
if axis=='1 0 0':
|
|
181
|
-
_joint['joint'] = 'transX'
|
|
182
|
-
elif axis=='-1 0 0':
|
|
183
|
-
_joint['joint'] = 'transX'
|
|
184
|
-
_joint['joint_scale'] = -1
|
|
185
|
-
elif axis=='0 1 0':
|
|
186
|
-
_joint['joint'] = 'transY'
|
|
187
|
-
elif axis=='0 -1 0':
|
|
188
|
-
_joint['joint'] = 'transY'
|
|
189
|
-
_joint['joint_scale'] = -1
|
|
190
|
-
elif axis=='0 0 1':
|
|
191
|
-
_joint['joint'] = 'transZ'
|
|
192
|
-
elif axis=='0 0 -1':
|
|
193
|
-
_joint['joint'] = 'transZ'
|
|
194
|
-
_joint['joint_scale'] = -1
|
|
195
|
-
else:
|
|
196
|
-
raise Exception('CAN ONLY PROCESS X Y Z prismatic joints, not', axis)
|
|
197
|
-
else:
|
|
198
|
-
_joint['joint'] = 'transX'
|
|
199
|
-
|
|
200
|
-
if att == 'fixed':
|
|
201
|
-
_joint['joint'] = 'rigid'
|
|
202
|
-
|
|
203
|
-
elem = joint.find('mimic')
|
|
204
|
-
if elem is not None:
|
|
205
|
-
_joint['mimic'] = elem.attrib['joint']
|
|
206
|
-
|
|
207
|
-
elem = joint.find('limit')
|
|
208
|
-
if elem is not None:
|
|
209
|
-
lo = elem.attrib.get('lower')
|
|
210
|
-
up = elem.attrib.get('upper')
|
|
211
|
-
eff = elem.attrib.get('effort')
|
|
212
|
-
vel = elem.attrib.get('velocity')
|
|
213
|
-
if eff=='0':
|
|
214
|
-
eff=None
|
|
215
|
-
if vel=='0':
|
|
216
|
-
vel=None
|
|
217
|
-
if lo is not None:
|
|
218
|
-
_joint['limits'] = [float(lo), float(up)]
|
|
219
|
-
if vel is not None:
|
|
220
|
-
_joint['ctrl_limits'] = [float(vel), -1, float(eff)] #the 2nd value is an acceleration limit
|
|
221
|
-
else:
|
|
222
|
-
elem = joint.find('safety_controller')
|
|
223
|
-
if elem is not None:
|
|
224
|
-
lo = float(elem.attrib.get('soft_lower_limit'))
|
|
225
|
-
up = float(elem.attrib.get('soft_upper_limit'))
|
|
226
|
-
if lo is not None:
|
|
227
|
-
_joint['limits'] = [lo, up]
|
|
228
|
-
|
|
229
|
-
#print(etree.tostring(links[22]))
|
|
230
|
-
#print(etree.tostring(joints[0]))
|
|
231
|
-
|
|
232
|
-
def main():
|
|
233
|
-
inFile = args.urdf_file
|
|
234
|
-
xmlData = etree.parse(inFile)
|
|
235
|
-
|
|
236
|
-
config = dict()
|
|
237
|
-
|
|
238
|
-
links = xmlData.findall('/link')
|
|
239
|
-
for link in links:
|
|
240
|
-
addLink(config, link, args.coll)
|
|
241
|
-
|
|
242
|
-
joints = xmlData.findall('/joint')
|
|
243
|
-
for joint in joints:
|
|
244
|
-
addJoint(config, joint)
|
|
245
|
-
|
|
246
|
-
with open('z.yaml', 'w') as fil:
|
|
247
|
-
yaml.dump(noflow_dict(config), fil, default_flow_style=True, sort_keys=False, width=500)
|
|
248
|
-
|
|
249
|
-
if __name__ == "__main__":
|
|
250
|
-
main()
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
#!python
|
|
2
|
-
|
|
3
|
-
import sys
|
|
4
|
-
from lxml import etree
|
|
5
|
-
import argparse
|
|
6
|
-
|
|
7
|
-
parser = argparse.ArgumentParser(description='convert urdf to yaml (rai convention)')
|
|
8
|
-
|
|
9
|
-
parser.add_argument('urdf_file', type=str,
|
|
10
|
-
help='required input file')
|
|
11
|
-
|
|
12
|
-
parser.add_argument('-coll', type=bool, default=False,
|
|
13
|
-
help='use collision shapes?')
|
|
14
|
-
|
|
15
|
-
parser.add_argument('-meshRemove', type=str, default='package://',
|
|
16
|
-
help='a prefix from the mesh files to be removed')
|
|
17
|
-
|
|
18
|
-
parser.add_argument('-meshExt', type=str,
|
|
19
|
-
help='overwrite the mesh file extension')
|
|
20
|
-
|
|
21
|
-
args = parser.parse_args()
|
|
22
|
-
|
|
23
|
-
inFile = args.urdf_file
|
|
24
|
-
xmlData = etree.parse(inFile)
|
|
25
|
-
|
|
26
|
-
useCollisionShapes = False
|
|
27
|
-
if args.coll:
|
|
28
|
-
useCollisionShapes = True
|
|
29
|
-
|
|
30
|
-
def writeShape(link):
|
|
31
|
-
elem = link.find('origin')
|
|
32
|
-
if elem is not None:
|
|
33
|
-
xyz = elem.attrib.get('xyz')
|
|
34
|
-
rpy = elem.attrib.get('rpy')
|
|
35
|
-
if rpy=='0 0 0':
|
|
36
|
-
rpy=None
|
|
37
|
-
if xyz=='0 0 0':
|
|
38
|
-
xyz=None
|
|
39
|
-
if xyz is not None and rpy is not None:
|
|
40
|
-
print(' rel: "t(%s) E(%s)",' % (xyz, rpy), end='')
|
|
41
|
-
else:
|
|
42
|
-
if rpy is not None:
|
|
43
|
-
print(' rel: "E(%s)",' % (rpy), end='')
|
|
44
|
-
if xyz is not None:
|
|
45
|
-
print(' rel: [%s],' % (xyz), end='')
|
|
46
|
-
|
|
47
|
-
elem = link.find('geometry/box')
|
|
48
|
-
if elem is not None:
|
|
49
|
-
print(' shape: box\n size: [%s 0],' % elem.attrib['size'], end='')
|
|
50
|
-
|
|
51
|
-
elem = link.find('geometry/sphere')
|
|
52
|
-
if elem is not None:
|
|
53
|
-
print(' shape: sphere\n size: [0 0 0 %s],' % elem.attrib['radius'], end='')
|
|
54
|
-
|
|
55
|
-
elem = link.find('geometry/cylinder')
|
|
56
|
-
if elem is not None:
|
|
57
|
-
print(' shape: cylinder\n size: [0 0 %s %s],' % (elem.attrib['length'], elem.attrib['radius']), end='')
|
|
58
|
-
|
|
59
|
-
elem = link.find('geometry/mesh')
|
|
60
|
-
if elem is not None:
|
|
61
|
-
filename = elem.attrib['filename'].replace(args.meshRemove,'',1)
|
|
62
|
-
if args.meshExt is not None:
|
|
63
|
-
filename = filename[:-3] + args.meshExt
|
|
64
|
-
print(' mesh: <%s>,' % filename, end='')
|
|
65
|
-
if elem.find('scale') is not None:
|
|
66
|
-
print(' meshscale: [%s],' % elem.attrib['scale'], end='')
|
|
67
|
-
|
|
68
|
-
elem = link.find('material/color')
|
|
69
|
-
if elem is not None:
|
|
70
|
-
print(' color: [%s],' % elem.attrib['rgba'], end='')
|
|
71
|
-
|
|
72
|
-
# elem = link.find('material')
|
|
73
|
-
# if elem is not None:
|
|
74
|
-
# if elem.attrib['name'] is not None:
|
|
75
|
-
# print('colorName:%s' % elem.attrib['name'])
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
links = xmlData.findall('./link')
|
|
79
|
-
for link in links:
|
|
80
|
-
name = link.attrib['name']
|
|
81
|
-
print('%s: {' % name, end='')
|
|
82
|
-
|
|
83
|
-
elem = link.find('inertial/mass')
|
|
84
|
-
if elem is not None:
|
|
85
|
-
print(' mass: %s,' % elem.attrib['value'], end='')
|
|
86
|
-
|
|
87
|
-
elem = link.find('inertial/inertia')
|
|
88
|
-
if elem is not None:
|
|
89
|
-
print(' inertia: [%s %s %s %s %s %s],' % (
|
|
90
|
-
elem.attrib['ixx'],
|
|
91
|
-
elem.attrib['ixy'],
|
|
92
|
-
elem.attrib['ixz'],
|
|
93
|
-
elem.attrib['iyy'],
|
|
94
|
-
elem.attrib['iyz'],
|
|
95
|
-
elem.attrib['izz']), end='')
|
|
96
|
-
|
|
97
|
-
print('}') # end of body
|
|
98
|
-
|
|
99
|
-
# visual shape
|
|
100
|
-
for visual in link.findall('visual'):
|
|
101
|
-
print('%s_0 (%s): {' % (name, name), end='')
|
|
102
|
-
writeShape(visual)
|
|
103
|
-
#if not useCollisionShapes:
|
|
104
|
-
# print(' contact: -2,', end='')
|
|
105
|
-
print(' visual: true }') # end of shape
|
|
106
|
-
|
|
107
|
-
# collision shape
|
|
108
|
-
if useCollisionShapes:
|
|
109
|
-
for collision in link.findall('collision'):
|
|
110
|
-
print('%s_1 (%s): {' % (name, name), end='')
|
|
111
|
-
print(' color: [.8 .2 .2 .5],', end='')
|
|
112
|
-
writeShape(collision)
|
|
113
|
-
print(' contact: -2 }') # end of shape
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
joints = xmlData.findall('./joint')
|
|
117
|
-
for joint in joints:
|
|
118
|
-
name = joint.attrib['name']
|
|
119
|
-
if joint.find('child') is not None:
|
|
120
|
-
|
|
121
|
-
parent = joint.find('parent').attrib['link']
|
|
122
|
-
|
|
123
|
-
# add an origin frame as pre frame?
|
|
124
|
-
elem = joint.find('origin')
|
|
125
|
-
if elem is not None:
|
|
126
|
-
xyz = elem.attrib.get('xyz')
|
|
127
|
-
rpy = elem.attrib.get('rpy')
|
|
128
|
-
if rpy=='0 0 0':
|
|
129
|
-
rpy=None
|
|
130
|
-
if xyz=='0 0 0':
|
|
131
|
-
xyz=None
|
|
132
|
-
if xyz is not None and rpy is not None:
|
|
133
|
-
print('%s (%s): { Q: "t(%s) E(%s)" }' % (name+'_origin', parent, xyz, rpy))
|
|
134
|
-
parent = name+'_origin'
|
|
135
|
-
elif rpy is not None:
|
|
136
|
-
print('%s (%s): { Q: "E(%s)" }' % (name+'_origin', parent, rpy))
|
|
137
|
-
parent = name+'_origin'
|
|
138
|
-
elif xyz is not None:
|
|
139
|
-
print('%s (%s): { Q: [%s] }' % (name+'_origin', parent, xyz))
|
|
140
|
-
parent = name+'_origin'
|
|
141
|
-
|
|
142
|
-
#print('%s (%s): {' % (name, parent), end='')
|
|
143
|
-
print('%s (%s %s): {' % (name, parent, joint.find('child').attrib['link']), end='')
|
|
144
|
-
|
|
145
|
-
# figure out joint type
|
|
146
|
-
att = joint.attrib.get('type')
|
|
147
|
-
|
|
148
|
-
if att in ['revolute', 'continuous']:
|
|
149
|
-
elem = joint.find('axis')
|
|
150
|
-
if elem is not None:
|
|
151
|
-
axis = elem.attrib['xyz']
|
|
152
|
-
if axis=='1 0 0':
|
|
153
|
-
print(' joint: hingeX,', end='')
|
|
154
|
-
elif axis=='0 1 0':
|
|
155
|
-
print(' joint: hingeY,', end='')
|
|
156
|
-
elif axis=='0 0 1':
|
|
157
|
-
print(' joint: hingeZ,', end='')
|
|
158
|
-
elif axis=='0 0 -1':
|
|
159
|
-
print(' joint: hingeZ, joint_scale: -1,', end='')
|
|
160
|
-
else:
|
|
161
|
-
raise Exception('CAN ONLY PROCESS X Y Z prismatic joints, not', axis)
|
|
162
|
-
else:
|
|
163
|
-
print(' joint: hingeX,', end='')
|
|
164
|
-
|
|
165
|
-
if att == 'prismatic':
|
|
166
|
-
elem = joint.find('axis')
|
|
167
|
-
if elem is not None:
|
|
168
|
-
axis = elem.attrib['xyz']
|
|
169
|
-
if axis=='1 0 0':
|
|
170
|
-
print(' joint: transX,', end='')
|
|
171
|
-
elif axis=='0 1 0':
|
|
172
|
-
print(' joint: transY,', end='')
|
|
173
|
-
elif axis=='0 -1 0':
|
|
174
|
-
print(' joint: transY, joint_scale: -1,', end='')
|
|
175
|
-
elif axis=='0 0 1':
|
|
176
|
-
print(' joint: transZ,', end='')
|
|
177
|
-
elif axis=='0 0 -1':
|
|
178
|
-
print(' joint: transZ, joint_scale: -1,', end='')
|
|
179
|
-
else:
|
|
180
|
-
raise Exception('CAN ONLY PROCESS X Y Z prismatic joints, not', axis)
|
|
181
|
-
else:
|
|
182
|
-
print(' joint: transX,', end='')
|
|
183
|
-
|
|
184
|
-
if att == 'fixed':
|
|
185
|
-
print(' joint: rigid,', end='')
|
|
186
|
-
|
|
187
|
-
elem = joint.find('mimic')
|
|
188
|
-
if elem is not None:
|
|
189
|
-
print(' mimic: %s,' % elem.attrib['joint'], end='')
|
|
190
|
-
|
|
191
|
-
#elem = joint.find('axis')
|
|
192
|
-
#if elem is not None:
|
|
193
|
-
# print('axis:[%s]' % elem.attrib['xyz'])
|
|
194
|
-
|
|
195
|
-
elem = joint.find('limit')
|
|
196
|
-
if elem is not None:
|
|
197
|
-
lo = elem.attrib.get('lower')
|
|
198
|
-
up = elem.attrib.get('upper')
|
|
199
|
-
eff = elem.attrib.get('effort')
|
|
200
|
-
vel = elem.attrib.get('velocity')
|
|
201
|
-
if eff=='0':
|
|
202
|
-
eff=None
|
|
203
|
-
if vel=='0':
|
|
204
|
-
vel=None
|
|
205
|
-
if lo is not None:
|
|
206
|
-
print(' limits: [%s %s],' % (lo, up), end='')
|
|
207
|
-
if vel is not None:
|
|
208
|
-
print(' ctrl_limits: [%s -1 %s],' % (vel, eff), end='') #the 2nd value is an acceleration limit
|
|
209
|
-
else:
|
|
210
|
-
elem = joint.find('safety_controller')
|
|
211
|
-
if elem is not None:
|
|
212
|
-
lo = elem.attrib.get('soft_lower_limit')
|
|
213
|
-
up = elem.attrib.get('soft_upper_limit')
|
|
214
|
-
if lo is not None:
|
|
215
|
-
print(' limits: [%s %s],' % (lo, up), end='')
|
|
216
|
-
|
|
217
|
-
print('}')
|
|
218
|
-
|
|
219
|
-
#print('Edit %s (%s): {}' % (joint.find('child').attrib['link'], name) )
|
|
220
|
-
|
|
221
|
-
#print(etree.tostring(links[22]))
|
|
222
|
-
#print(etree.tostring(joints[0]))
|