robotic 0.2.9.dev1__cp311-cp311-manylinux2014_x86_64.whl → 0.3.4.dev5__cp311-cp311-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/DataGen.pyi +11 -1
- robotic/__init__.py +8 -1
- robotic/_robotic.pyi +228 -110
- robotic/_robotic.so +0 -0
- robotic/algo.pyi +17 -0
- robotic/include/rai/{Geo → Algo}/Lewiner/MarchingCubes.h +0 -29
- robotic/include/rai/Algo/SplineCtrlFeed.h +1 -1
- robotic/include/rai/Algo/marching_cubes.h +9 -0
- robotic/include/rai/Algo/rungeKutta.h +2 -2
- robotic/include/rai/Algo/spline.h +4 -8
- robotic/include/rai/Algo/trilinear.h +10 -0
- robotic/include/rai/Control/CtrlSolver.h +1 -1
- robotic/include/rai/Control/TimingMPC.h +2 -2
- robotic/include/rai/Core/array.h +99 -64
- robotic/include/rai/Core/array.ipp +290 -139
- robotic/include/rai/Core/arrayDouble.h +36 -26
- robotic/include/rai/Core/defines.h +7 -9
- robotic/include/rai/Core/graph.h +27 -23
- robotic/include/rai/Core/h5.h +3 -1
- robotic/include/rai/Core/thread.h +12 -12
- robotic/include/rai/Core/util.h +58 -79
- robotic/include/rai/DataGen/rndStableConfigs.h +1 -0
- robotic/include/rai/DataGen/shapenetGrasps.h +5 -3
- robotic/include/rai/Geo/depth2PointCloud.h +2 -0
- robotic/include/rai/Geo/geo.h +23 -15
- robotic/include/rai/Geo/{fclInterface.h → i_fcl.h} +3 -1
- robotic/include/rai/Geo/mesh.h +18 -13
- robotic/include/rai/Geo/pairCollision.h +43 -43
- robotic/include/rai/Geo/signedDistanceFunctions.h +7 -5
- robotic/include/rai/Geo/stb_image.h +1 -1
- robotic/include/rai/Gui/RenderData.h +9 -7
- robotic/include/rai/Gui/opengl.h +6 -6
- robotic/include/rai/Gui/plot.h +1 -1
- robotic/include/rai/KOMO/komo.h +6 -3
- robotic/include/rai/KOMO/komo_NLP.h +2 -2
- robotic/include/rai/KOMO/manipTools.h +7 -2
- robotic/include/rai/KOMO/testProblems_KOMO.h +5 -9
- robotic/include/rai/Kin/F_forces.h +3 -3
- robotic/include/rai/Kin/cameraview.h +24 -36
- robotic/include/rai/Kin/dof_forceExchange.h +7 -7
- robotic/include/rai/Kin/feature.h +1 -1
- robotic/include/rai/Kin/frame.h +22 -24
- robotic/include/rai/Kin/{kin_physx.h → i_Physx.h} +10 -8
- robotic/include/rai/Kin/kin.h +29 -21
- robotic/include/rai/Kin/proxy.h +1 -1
- robotic/include/rai/Kin/simulation.h +20 -10
- robotic/include/rai/Kin/viewer.h +14 -1
- robotic/include/rai/LGP/LGP_TAMP_Abstraction.h +33 -0
- robotic/include/rai/LGP/LGP_Tool.h +4 -25
- robotic/include/rai/LGP/LGP_computers.h +1 -1
- robotic/include/rai/LGP/LGP_computers2.h +196 -0
- robotic/include/rai/LGP/NLP_Descriptor.h +5 -0
- robotic/include/rai/Logic/folWorld.h +1 -1
- robotic/include/rai/Logic/treeSearchDomain.h +2 -2
- robotic/include/rai/Optim/BayesOpt.h +13 -6
- robotic/include/rai/Optim/CMA/boundary_transformation.h +73 -0
- robotic/include/rai/Optim/CMA/cmaes.h +175 -0
- robotic/include/rai/Optim/CMA/cmaes_interface.h +68 -0
- robotic/include/rai/Optim/GlobalIterativeNewton.h +7 -3
- robotic/include/rai/Optim/NLP.h +23 -7
- robotic/include/rai/Optim/NLP_GraphSolver.h +1 -1
- robotic/include/rai/Optim/NLP_Solver.h +5 -5
- robotic/include/rai/Optim/constrained.h +4 -4
- robotic/include/rai/Optim/{opt-ceres.h → i_Ceres.h} +2 -2
- robotic/include/rai/Optim/{opt-nlopt.h → i_NLopt.h} +4 -0
- robotic/include/rai/Optim/lagrangian.h +7 -5
- robotic/include/rai/Optim/liblbfgs/liblbfgs.h +755 -0
- robotic/include/rai/Optim/m_EvoStrategies.h +114 -0
- robotic/include/rai/Optim/{gradient.h → m_Gradient.h} +13 -12
- robotic/include/rai/Optim/m_LBFGS.h +21 -0
- robotic/include/rai/Optim/m_LeastSquaresZeroOrder.h +104 -0
- robotic/include/rai/Optim/m_LocalGreedy.h +31 -0
- robotic/include/rai/Optim/m_NelderMead.h +23 -0
- robotic/include/rai/Optim/{newton.h → m_Newton.h} +7 -4
- robotic/include/rai/Optim/{SlackGaussNewton.h → m_SlackGaussNewton.h} +0 -10
- robotic/include/rai/Optim/options.h +8 -7
- robotic/include/rai/Optim/primalDual.h +10 -6
- robotic/include/rai/Optim/testProblems_Opt.h +25 -19
- robotic/include/rai/Optim/utils.h +16 -85
- robotic/include/rai/PathAlgos/ConfigurationProblem.h +3 -2
- robotic/include/rai/PathAlgos/RRT_PathFinder.h +2 -2
- robotic/include/rai/Perception/pcl.h +10 -10
- robotic/include/rai/Perception/surfels.h +1 -1
- robotic/include/rai/Search/TreeSearchNode.h +1 -1
- robotic/include/rai/ry/py-algo.h +17 -0
- robotic/include/rai/ry/types.h +4 -2
- robotic/librai.so +0 -0
- robotic/manipulation.py +5 -7
- robotic/meshTool +0 -0
- robotic/mujoco-import.py +8 -0
- robotic/rai-robotModels/g1/g1.g +11 -2
- robotic/rai-robotModels/g1/g1_29dof_conv.yml +64 -0
- 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 +10 -10
- 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 +5 -7
- robotic/rai-robotModels/panda/panda_withoutCollisionModels.g +3 -11
- 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 +12 -12
- robotic/rai-robotModels/pr2/pr2_clean.g +122 -118
- 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_arg2f_85_model_conv.yml +19 -0
- robotic/rai-robotModels/robotiq/robotiq_clean.g +16 -16
- robotic/rai-robotModels/scenarios/ballFinger.g +2 -2
- robotic/rai-robotModels/scenarios/liftRing.g +2 -2
- robotic/rai-robotModels/scenarios/pandaFloatingGripper.g +1 -1
- robotic/rai-robotModels/scenarios/pandaSingle.g +1 -1
- robotic/rai-robotModels/scenarios/panda_fixRobotiq.g +3 -3
- robotic/rai-robotModels/tests/arm.g +18 -19
- 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 +3 -12
- robotic/ry-test +5 -4
- robotic/ry-urdfConvert.py +74 -0
- robotic/ry-view +28 -6
- robotic/src/cleanMeshes.py +59 -0
- robotic/src/h5_helper.py +46 -0
- robotic/src/h5_helper.py~ +42 -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/urdf_io.py +237 -0
- robotic/src/yaml_helper.py +29 -0
- robotic/version.py +1 -1
- robotic-0.3.4.dev5.data/scripts/ry-h5info +23 -0
- {robotic-0.2.9.dev1.data → robotic-0.3.4.dev5.data}/scripts/ry-test +5 -4
- robotic-0.3.4.dev5.data/scripts/ry-urdfConvert.py +74 -0
- robotic-0.3.4.dev5.data/scripts/ry-view +46 -0
- {robotic-0.2.9.dev1.dist-info → robotic-0.3.4.dev5.dist-info}/METADATA +18 -22
- robotic-0.3.4.dev5.dist-info/RECORD +386 -0
- {robotic-0.2.9.dev1.dist-info → robotic-0.3.4.dev5.dist-info}/WHEEL +1 -1
- robotic/nlp.py +0 -113
- 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-h5info +0 -32
- 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.data/scripts/ry-view +0 -24
- robotic-0.2.9.dev1.dist-info/RECORD +0 -421
- /robotic/include/rai/{Geo → Algo}/Lewiner/LookUpTable.h +0 -0
- /robotic/include/rai/Geo/{assimpInterface.h → i_assimp.h} +0 -0
- /robotic/include/rai/Kin/{kin_bullet.h → i_Bullet.h} +0 -0
- /robotic/include/rai/Kin/{kin_feather.h → i_Feather.h} +0 -0
- /robotic/include/rai/Kin/{kin_ode.h → i_Ode.h} +0 -0
- /robotic/include/rai/Optim/{opt-ipopt.h → i_Ipopt.h} +0 -0
- /robotic/rai-robotModels/robotiq/meshes/{visual/robotiq_ft300.ply → robotiq_ft300.ply} +0 -0
- /robotic/{import.py → src/__init__.py} +0 -0
- {robotic-0.2.9.dev1.data → robotic-0.3.4.dev5.data}/scripts/ry-bot +0 -0
- {robotic-0.2.9.dev1.data → robotic-0.3.4.dev5.data}/scripts/ry-info +0 -0
- {robotic-0.2.9.dev1.data → robotic-0.3.4.dev5.data}/scripts/ry-meshTool +0 -0
- {robotic-0.2.9.dev1.dist-info → robotic-0.3.4.dev5.dist-info}/licenses/LICENSE +0 -0
- {robotic-0.2.9.dev1.dist-info → robotic-0.3.4.dev5.dist-info}/top_level.txt +0 -0
robotic/src/mujoco_io.py
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
|
|
2
|
+
import os
|
|
3
|
+
import numpy as np
|
|
4
|
+
import robotic as ry
|
|
5
|
+
import xml.etree.ElementTree as ET
|
|
6
|
+
from copy import copy
|
|
7
|
+
|
|
8
|
+
class MujocoLoader():
|
|
9
|
+
|
|
10
|
+
def __init__(self, file, visualsOnly=True, defaultConType='0', basePos=[0,0,0], baseQuat=[0,0,0,1]):
|
|
11
|
+
ry.params_add({'cd_into_mesh_files': False})
|
|
12
|
+
|
|
13
|
+
self.visualsOnly = visualsOnly
|
|
14
|
+
self.defaultConType = defaultConType
|
|
15
|
+
self.debug_counter = 0
|
|
16
|
+
self.muj2rai_joint_map = {
|
|
17
|
+
'1 0 0': ry.JT.hingeX,
|
|
18
|
+
'0 1 0': ry.JT.hingeY,
|
|
19
|
+
'0 0 1': ry.JT.hingeZ,
|
|
20
|
+
'-1 0 0': ry.JT.hingeX,
|
|
21
|
+
'0 -1 0': ry.JT.hingeY,
|
|
22
|
+
'0 0 -1': ry.JT.hingeZ,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
tree = ET.parse(file)
|
|
26
|
+
path, _ = os.path.split(file)
|
|
27
|
+
root = tree.getroot()
|
|
28
|
+
|
|
29
|
+
self.materials = {}
|
|
30
|
+
self.textures = {}
|
|
31
|
+
self.meshes = {}
|
|
32
|
+
self.load_assets(root, path)
|
|
33
|
+
self.bodyCount = -1
|
|
34
|
+
|
|
35
|
+
self.C = ry.Config()
|
|
36
|
+
self.base = self.C.addFrame('base')
|
|
37
|
+
self.base.setAttributes({'multibody':True})
|
|
38
|
+
self.base.setPosition(basePos)
|
|
39
|
+
self.base.setQuaternion(baseQuat)
|
|
40
|
+
self.add_node(root, self.base, path, 0)
|
|
41
|
+
|
|
42
|
+
def as_floats(self, input_string):
|
|
43
|
+
return [float(num) for num in input_string.replace(',', ' ').split()]
|
|
44
|
+
|
|
45
|
+
def load_assets(self, root, path):
|
|
46
|
+
texs = root.findall('.//texture')
|
|
47
|
+
for tex in texs:
|
|
48
|
+
name = tex.attrib.get('name', '')
|
|
49
|
+
file = tex.attrib.get('file', '')
|
|
50
|
+
self.textures[name] = os.path.join(path, file)
|
|
51
|
+
|
|
52
|
+
maters = root.findall('.//material')
|
|
53
|
+
for mater in maters:
|
|
54
|
+
name = mater.attrib.get('name', '')
|
|
55
|
+
color = mater.attrib.get('rgba', '')
|
|
56
|
+
texture_name = mater.attrib.get('texture', '')
|
|
57
|
+
if texture_name:
|
|
58
|
+
self.materials[name] = self.textures[texture_name]
|
|
59
|
+
elif color:
|
|
60
|
+
self.materials[name] = color
|
|
61
|
+
else:
|
|
62
|
+
self.materials[name] = ''
|
|
63
|
+
|
|
64
|
+
for mesh in root.findall('.//mesh'):
|
|
65
|
+
name = mesh.attrib.get('name', '')
|
|
66
|
+
file = mesh.attrib.get('file', '')
|
|
67
|
+
if file.startswith('visual') or file.startswith('collision'): #HACK: the true path is hidden in some compiler attribute
|
|
68
|
+
file = 'meshes/'+file
|
|
69
|
+
mesh.attrib['file'] = file
|
|
70
|
+
self.meshes[name] = mesh.attrib
|
|
71
|
+
|
|
72
|
+
def add_node(self, node, f_parent, path, level):
|
|
73
|
+
if 'file' in node.attrib:
|
|
74
|
+
file = node.attrib['file']
|
|
75
|
+
node.attrib['file'] = os.path.join(path, file)
|
|
76
|
+
|
|
77
|
+
print('|'+level*' ', node.tag, node.attrib)
|
|
78
|
+
|
|
79
|
+
if node.tag == 'include':
|
|
80
|
+
file = node.attrib['file']
|
|
81
|
+
tree = ET.parse(file)
|
|
82
|
+
root = tree.getroot()
|
|
83
|
+
path, _ = os.path.split(file)
|
|
84
|
+
self.load_assets(root, path)
|
|
85
|
+
self.add_node(root, f_parent, path, level+1)
|
|
86
|
+
|
|
87
|
+
f_body = None
|
|
88
|
+
|
|
89
|
+
if node.tag == 'body':
|
|
90
|
+
f_body = self.add_body(node, f_parent)
|
|
91
|
+
|
|
92
|
+
for child in node:
|
|
93
|
+
if f_body is None:
|
|
94
|
+
self.add_node(child, f_parent, path, level+1)
|
|
95
|
+
else:
|
|
96
|
+
self.add_node(child, f_body, path, level+1)
|
|
97
|
+
|
|
98
|
+
def add_body(self, body, f_parent):
|
|
99
|
+
self.bodyCount += 1
|
|
100
|
+
body_name = body.attrib.get('name', f'body_{self.bodyCount}')
|
|
101
|
+
|
|
102
|
+
# if self.C.getFrame(body_name, False):
|
|
103
|
+
body_name = f'{body_name}_{self.bodyCount}'
|
|
104
|
+
f_body = self.C.addFrame(body_name)
|
|
105
|
+
f_body.setParent(f_parent)
|
|
106
|
+
self.setRelativePose(f_body, body.attrib)
|
|
107
|
+
|
|
108
|
+
for i, joint in enumerate(body.findall('./joint')):
|
|
109
|
+
axis = joint.attrib.get('axis', None)
|
|
110
|
+
limits = joint.attrib.get('range', None)
|
|
111
|
+
joint_name = joint.attrib.get('name', f'{body_name}_joint{i*"_"}')
|
|
112
|
+
f_origin = self.C.addFrame(f'{joint_name}_origin')
|
|
113
|
+
f_origin.setParent(f_body)
|
|
114
|
+
self.setRelativePose(f_origin, joint.attrib)
|
|
115
|
+
f_origin.unLink()
|
|
116
|
+
f_origin.setParent(f_parent, True)
|
|
117
|
+
|
|
118
|
+
if axis:
|
|
119
|
+
if axis in self.muj2rai_joint_map:
|
|
120
|
+
axis = self.muj2rai_joint_map[axis]
|
|
121
|
+
else:
|
|
122
|
+
vec1 = np.array([0., 0., 1.])
|
|
123
|
+
vec2 = np.array(self.as_floats(axis))
|
|
124
|
+
quat = ry.Quaternion().setDiff(vec1, vec2).asArr()
|
|
125
|
+
f_origin.setRelativeQuaternion(quat)
|
|
126
|
+
axis = ry.JT.hingeZ
|
|
127
|
+
else:
|
|
128
|
+
axis = ry.JT.hingeZ
|
|
129
|
+
|
|
130
|
+
if joint.attrib.get('type', 'hinge')=='slide':
|
|
131
|
+
trans_map = {
|
|
132
|
+
ry.JT.hingeX: ry.JT.transX,
|
|
133
|
+
ry.JT.hingeY: ry.JT.transY,
|
|
134
|
+
ry.JT.hingeZ: ry.JT.transZ}
|
|
135
|
+
axis = trans_map[axis]
|
|
136
|
+
|
|
137
|
+
if not limits:
|
|
138
|
+
limits = '-1 1'
|
|
139
|
+
|
|
140
|
+
# if self.C.getFrame(joint_name, False):
|
|
141
|
+
# joint_name = f'{joint_name}_{self.bodyCount}'
|
|
142
|
+
f_joint = self.C.addFrame(joint_name)
|
|
143
|
+
f_joint.setParent(f_origin)
|
|
144
|
+
f_joint.setJoint(axis, self.as_floats(limits))
|
|
145
|
+
|
|
146
|
+
# relink body:
|
|
147
|
+
f_parent = f_joint
|
|
148
|
+
f_body.unLink()
|
|
149
|
+
f_body.setParent(f_parent, True)
|
|
150
|
+
|
|
151
|
+
for i, geom in enumerate(body.findall('./geom')):
|
|
152
|
+
isColl = geom.attrib.get('contype', self.defaultConType)!='0' or 'coll' in geom.attrib.get('class','')
|
|
153
|
+
if self.visualsOnly and isColl:
|
|
154
|
+
continue
|
|
155
|
+
|
|
156
|
+
f_shape = self.C.addFrame(f'{body_name}_shape{i}')
|
|
157
|
+
f_shape.setParent(f_body)
|
|
158
|
+
|
|
159
|
+
if 'mesh' in geom.attrib:
|
|
160
|
+
mesh = geom.attrib.get('mesh', '')
|
|
161
|
+
material_name = geom.attrib.get('material', '')
|
|
162
|
+
texture_path = self.materials.get(material_name, None)
|
|
163
|
+
meshfile = self.meshes[mesh]['file']
|
|
164
|
+
scale = self.as_floats(self.meshes[mesh].get('scale', '1 1 1'))
|
|
165
|
+
|
|
166
|
+
f_shape.setMeshFile(meshfile, scale[0])
|
|
167
|
+
|
|
168
|
+
if texture_path:
|
|
169
|
+
if len(texture_path.split()) == 4: # Is a color rgba
|
|
170
|
+
f_shape.setColor(self.as_floats(texture_path))
|
|
171
|
+
|
|
172
|
+
elif 'type' in geom.attrib:
|
|
173
|
+
size = self.as_floats(geom.attrib['size'])
|
|
174
|
+
if geom.attrib['type']=='capsule':
|
|
175
|
+
if 'fromto' in geom.attrib:
|
|
176
|
+
fromto = self.as_floats(geom.attrib['fromto'])
|
|
177
|
+
a, b = np.array(fromto[:3]), np.array(fromto[3:])
|
|
178
|
+
l = np.linalg.norm(b-a)
|
|
179
|
+
q = ry.Quaternion().setDiff([0,0,1],(b-a)/l)
|
|
180
|
+
f_shape.setRelativePosition(0.5*(a+b))
|
|
181
|
+
f_shape.setRelativeQuaternion(q.asArr())
|
|
182
|
+
f_shape.setShape(ry.ST.capsule, [l, size[0]])
|
|
183
|
+
elif len(size)==2:
|
|
184
|
+
f_shape.setShape(ry.ST.capsule, [2.*size[1], size[0]])
|
|
185
|
+
|
|
186
|
+
elif geom.attrib['type']=='cylinder':
|
|
187
|
+
if len(size)==2:
|
|
188
|
+
f_shape.setShape(ry.ST.cylinder, [2.*size[1], size[0]])
|
|
189
|
+
|
|
190
|
+
elif geom.attrib['type']=='box':
|
|
191
|
+
assert len(size)==3
|
|
192
|
+
size = [2.*f for f in size]
|
|
193
|
+
f_shape.setShape(ry.ST.box, size)
|
|
194
|
+
if geom.attrib.get('material', None):
|
|
195
|
+
texture_path = self.materials[geom.attrib.get('material', None)]
|
|
196
|
+
if len(texture_path.split()) == 4: # Is a color rgba
|
|
197
|
+
f_shape.setColor(self.as_floats(texture_path))
|
|
198
|
+
else:
|
|
199
|
+
print('applying to box:', texture_path)
|
|
200
|
+
#TODO incorperate <texrepeat> tag correctly
|
|
201
|
+
uv_coords = np.array([
|
|
202
|
+
[0, 0], # vertex 0
|
|
203
|
+
[size[0], 0], # vertex 1
|
|
204
|
+
[size[0], size[1]], # vertex 2
|
|
205
|
+
[0, size[1]], # vertex 3
|
|
206
|
+
[0, 0], # vertex 0
|
|
207
|
+
[size[0], 0], # vertex 1
|
|
208
|
+
[size[0], size[1]], # vertex 2
|
|
209
|
+
[0, size[1]], # vertex 3
|
|
210
|
+
])
|
|
211
|
+
|
|
212
|
+
f_shape.setTextureFile(texture_path, uv_coords)
|
|
213
|
+
|
|
214
|
+
elif geom.attrib['type']=='sphere':
|
|
215
|
+
if len(size)==1:
|
|
216
|
+
f_shape.setShape(ry.ST.sphere, size)
|
|
217
|
+
|
|
218
|
+
self.setRelativePose(f_shape, geom.attrib)
|
|
219
|
+
|
|
220
|
+
if geom.attrib.get('rgba', None):
|
|
221
|
+
if geom.attrib.get('material', None) is None:
|
|
222
|
+
f_shape.setColor(self.as_floats(geom.attrib['rgba']))
|
|
223
|
+
|
|
224
|
+
elif isColl:
|
|
225
|
+
f_shape.setColor([1,0,0,.2])
|
|
226
|
+
|
|
227
|
+
return f_body
|
|
228
|
+
|
|
229
|
+
def setRelativePose(self, f, attrib):
|
|
230
|
+
pos = attrib.get('pos', None)
|
|
231
|
+
if pos:
|
|
232
|
+
f.setRelativePosition(self.as_floats(pos))
|
|
233
|
+
|
|
234
|
+
quat = attrib.get('quat', None)
|
|
235
|
+
if quat:
|
|
236
|
+
f.setRelativeQuaternion(self.as_floats(quat))
|
|
237
|
+
|
|
238
|
+
rpy = attrib.get('euler', None)
|
|
239
|
+
if rpy:
|
|
240
|
+
q = ry.Quaternion()
|
|
241
|
+
q.setRollPitchYaw(self.as_floats(rpy))
|
|
242
|
+
f.setRelativeQuaternion(q.asArr())
|
robotic/src/urdf_io.py
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import numpy as np
|
|
3
|
+
import robotic as ry
|
|
4
|
+
from lxml import etree
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class URDFLoader():
|
|
8
|
+
|
|
9
|
+
def __init__(self, file, visualsOnly=True, meshPathRemove='', meshExt=None):
|
|
10
|
+
self.meshPathRemove = meshPathRemove
|
|
11
|
+
self.meshExt = meshExt
|
|
12
|
+
|
|
13
|
+
xmlData = etree.parse(file)
|
|
14
|
+
self.path, _ = os.path.split(file)
|
|
15
|
+
|
|
16
|
+
self.C = ry.Config()
|
|
17
|
+
|
|
18
|
+
useCollisionShapes = not visualsOnly
|
|
19
|
+
|
|
20
|
+
# materials
|
|
21
|
+
|
|
22
|
+
self.materials = {}
|
|
23
|
+
mats = xmlData.findall('./material')
|
|
24
|
+
for mat in mats:
|
|
25
|
+
name = mat.attrib.get('name', '')
|
|
26
|
+
tex = mat.find('texture')
|
|
27
|
+
if tex is not None:
|
|
28
|
+
tex_file = tex.attrib['filename'].replace(self.meshPathRemove,'',1)
|
|
29
|
+
self.materials[name] = os.path.join(self.path, tex_file)
|
|
30
|
+
else:
|
|
31
|
+
col = mat.find('color')
|
|
32
|
+
if col is not None:
|
|
33
|
+
self.materials[name] = self.as_floats(col.attrib['rgba'])
|
|
34
|
+
|
|
35
|
+
# links with shapes
|
|
36
|
+
|
|
37
|
+
links = xmlData.findall('./link')
|
|
38
|
+
for link in links:
|
|
39
|
+
link_name = link.attrib['name']
|
|
40
|
+
f_link = self.C.addFrame(link_name)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
elem = link.find('inertial/inertia')
|
|
44
|
+
matrix=[]
|
|
45
|
+
if elem is not None:
|
|
46
|
+
tags = ['ixx', 'ixy', 'ixz', 'iyy', 'iyz', 'izz']
|
|
47
|
+
matrix = [float(elem.attrib[tag]) for tag in tags]
|
|
48
|
+
|
|
49
|
+
elem = link.find('inertial/mass')
|
|
50
|
+
if elem is not None:
|
|
51
|
+
mass = float(elem.attrib['value'])
|
|
52
|
+
f_link.setMass(mass, matrix)
|
|
53
|
+
|
|
54
|
+
for visual in link.findall('visual'):
|
|
55
|
+
self.add_shape(visual, f'{link_name}_0', f_link, isVisual=True)
|
|
56
|
+
|
|
57
|
+
# collision shape
|
|
58
|
+
if useCollisionShapes:
|
|
59
|
+
for collision in link.findall('collision'):
|
|
60
|
+
f_shape = self.add_shape(collision, f'{link_name}_1', f_link, isVisual=False)
|
|
61
|
+
f_shape.setColor([1,0,0,.2])
|
|
62
|
+
|
|
63
|
+
# joints
|
|
64
|
+
|
|
65
|
+
joints = xmlData.findall('./joint')
|
|
66
|
+
for joint in joints:
|
|
67
|
+
joint_name = joint.attrib['name']
|
|
68
|
+
if joint.find('child') is None:
|
|
69
|
+
continue
|
|
70
|
+
|
|
71
|
+
parent_name = joint.find('parent').attrib['link']
|
|
72
|
+
f_parent = self.C.getFrame(parent_name)
|
|
73
|
+
if f_parent is None:
|
|
74
|
+
print('SHIT', joint_name)
|
|
75
|
+
break
|
|
76
|
+
|
|
77
|
+
# add an origin frame as pre frame?
|
|
78
|
+
elem = joint.find('origin')
|
|
79
|
+
if elem is not None:
|
|
80
|
+
f_origin = self.C.addFrame(f'{joint_name}_origin')
|
|
81
|
+
f_origin.setParent(f_parent)
|
|
82
|
+
self.setRelativePose(f_origin, elem)
|
|
83
|
+
f_parent = f_origin
|
|
84
|
+
|
|
85
|
+
f_joint = self.C.addFrame(joint_name)
|
|
86
|
+
f_joint.setParent(f_parent)
|
|
87
|
+
|
|
88
|
+
child_name = joint.find('child').attrib['link']
|
|
89
|
+
f_child = self.C.getFrame(child_name)
|
|
90
|
+
if f_child is None:
|
|
91
|
+
print('SHIT', joint_name)
|
|
92
|
+
break
|
|
93
|
+
f_child.setParent(f_joint, False)
|
|
94
|
+
|
|
95
|
+
elem = joint.find('limit')
|
|
96
|
+
limits = []
|
|
97
|
+
if elem is not None:
|
|
98
|
+
lo = elem.attrib.get('lower')
|
|
99
|
+
up = elem.attrib.get('upper')
|
|
100
|
+
eff = elem.attrib.get('effort')
|
|
101
|
+
vel = elem.attrib.get('velocity')
|
|
102
|
+
if eff=='0':
|
|
103
|
+
eff=None
|
|
104
|
+
if vel=='0':
|
|
105
|
+
vel=None
|
|
106
|
+
if lo is not None:
|
|
107
|
+
limits = [float(lo), float(up)]
|
|
108
|
+
# if vel is not None:
|
|
109
|
+
# print(' ctrl_limits: [%s -1 %s],' % (vel, eff), end='') #the 2nd value is an acceleration limit
|
|
110
|
+
# else:
|
|
111
|
+
# elem = joint.find('safety_controller')
|
|
112
|
+
# if elem is not None:
|
|
113
|
+
# lo = elem.attrib.get('soft_lower_limit')
|
|
114
|
+
# up = elem.attrib.get('soft_upper_limit')
|
|
115
|
+
# if lo is not None:
|
|
116
|
+
# print(' limits: [%s %s],' % (lo, up), end='')
|
|
117
|
+
|
|
118
|
+
elem = joint.find('mimic')
|
|
119
|
+
f_mimic = None
|
|
120
|
+
if elem is not None:
|
|
121
|
+
f_mimic = self.C.getFrame(elem.attrib['joint'])
|
|
122
|
+
if f_mimic is None:
|
|
123
|
+
print('SHIT', elem.attrib['joint'])
|
|
124
|
+
break
|
|
125
|
+
|
|
126
|
+
att = joint.attrib.get('type')
|
|
127
|
+
|
|
128
|
+
if att in ['revolute', 'continuous']:
|
|
129
|
+
elem = joint.find('axis')
|
|
130
|
+
if elem is not None:
|
|
131
|
+
axis = elem.attrib['xyz']
|
|
132
|
+
if axis=='1 0 0':
|
|
133
|
+
f_joint.setJoint(ry.JT.hingeX, limits, 1., f_mimic)
|
|
134
|
+
elif axis=='0 1 0':
|
|
135
|
+
f_joint.setJoint(ry.JT.hingeY, limits, 1., f_mimic)
|
|
136
|
+
elif axis=='0 0 1':
|
|
137
|
+
f_joint.setJoint(ry.JT.hingeZ, limits, 1., f_mimic)
|
|
138
|
+
elif axis=='0 0 -1':
|
|
139
|
+
f_joint.setJoint(ry.JT.hingeZ, limits, -1., f_mimic)
|
|
140
|
+
else:
|
|
141
|
+
raise Exception('CAN ONLY PROCESS X Y Z hinge joints, not', axis)
|
|
142
|
+
else:
|
|
143
|
+
f_joint.setJoint(ry.JT.hingeX, limits, 1., f_mimic)
|
|
144
|
+
|
|
145
|
+
if att == 'prismatic':
|
|
146
|
+
elem = joint.find('axis')
|
|
147
|
+
if elem is not None:
|
|
148
|
+
axis = elem.attrib['xyz']
|
|
149
|
+
if axis=='1 0 0':
|
|
150
|
+
f_joint.setJoint(ry.JT.transX, limits, 1., f_mimic)
|
|
151
|
+
elif axis=='0 1 0':
|
|
152
|
+
f_joint.setJoint(ry.JT.transY, limits, 1., f_mimic)
|
|
153
|
+
elif axis=='0 -1 0':
|
|
154
|
+
f_joint.setJoint(ry.JT.transY, limits, -1., f_mimic)
|
|
155
|
+
elif axis=='0 0 1':
|
|
156
|
+
f_joint.setJoint(ry.JT.transZ, limits, 1., f_mimic)
|
|
157
|
+
elif axis=='0 0 -1':
|
|
158
|
+
f_joint.setJoint(ry.JT.transZ, limits, -1., f_mimic)
|
|
159
|
+
else:
|
|
160
|
+
raise Exception('CAN ONLY PROCESS X Y Z prismatic joints, not', axis)
|
|
161
|
+
else:
|
|
162
|
+
f_joint.setJoint(ry.JT.transX, limits, 1., f_mimic)
|
|
163
|
+
|
|
164
|
+
if att == 'fixed':
|
|
165
|
+
f_joint.setJoint(ry.JT.rigid)
|
|
166
|
+
|
|
167
|
+
#elem = joint.find('axis')
|
|
168
|
+
#if elem is not None:
|
|
169
|
+
# print('axis:[%s]' % elem.attrib['xyz'])
|
|
170
|
+
|
|
171
|
+
def add_shape(self, shape, shape_name, f_link, isVisual):
|
|
172
|
+
f_shape = self.C.addFrame(shape_name)
|
|
173
|
+
f_shape.setParent(f_link)
|
|
174
|
+
|
|
175
|
+
elem = shape.find('origin')
|
|
176
|
+
if elem is not None:
|
|
177
|
+
self.setRelativePose(f_shape, elem)
|
|
178
|
+
|
|
179
|
+
elem = shape.find('geometry/box')
|
|
180
|
+
if elem is not None:
|
|
181
|
+
size = self.as_floats(elem.attrib['size'])
|
|
182
|
+
f_shape.setShape(ry.ST.box, size)
|
|
183
|
+
|
|
184
|
+
elem = shape.find('geometry/sphere')
|
|
185
|
+
if elem is not None:
|
|
186
|
+
size = self.as_floats(elem.attrib['size'])
|
|
187
|
+
f_shape.setShape(ry.ST.sphere, size)
|
|
188
|
+
|
|
189
|
+
elem = shape.find('geometry/cylinder')
|
|
190
|
+
if elem is not None:
|
|
191
|
+
size = [float(elem.attrib[tag]) for tag in ['length', 'radius']]
|
|
192
|
+
f_shape.setShape(ry.ST.cylinder, size)
|
|
193
|
+
|
|
194
|
+
elem = shape.find('geometry/mesh')
|
|
195
|
+
if elem is not None:
|
|
196
|
+
filename = elem.attrib['filename'].replace(self.meshPathRemove,'',1)
|
|
197
|
+
if self.meshExt is not None:
|
|
198
|
+
filename = filename[:-3] + self.meshExt
|
|
199
|
+
if 'scale' in elem.attrib:
|
|
200
|
+
scale = self.as_floats(elem.attrib['scale'])[0]
|
|
201
|
+
else:
|
|
202
|
+
scale = 1
|
|
203
|
+
filename = os.path.join(self.path, filename)
|
|
204
|
+
f_shape.setMeshFile(filename, scale)
|
|
205
|
+
|
|
206
|
+
elem = shape.find('material/color')
|
|
207
|
+
if elem is not None:
|
|
208
|
+
f_shape.setColor(self.as_floats(elem.attrib['rgba']))
|
|
209
|
+
|
|
210
|
+
# elem = shape.find('material')
|
|
211
|
+
# if elem is not None and 'name' in elem.attrib:
|
|
212
|
+
# mat = self.materials[elem.attrib['name']]
|
|
213
|
+
# if len(mat)==4: #rgba
|
|
214
|
+
# f_shape.setColor(mat)
|
|
215
|
+
# else:
|
|
216
|
+
# f_shape.setTextureFile(mat)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
return f_shape
|
|
220
|
+
|
|
221
|
+
def as_floats(self, input_string):
|
|
222
|
+
return [float(num) for num in input_string.replace(',', ' ').split()]
|
|
223
|
+
|
|
224
|
+
def setRelativePose(self, f, attrib):
|
|
225
|
+
pos = attrib.get('xyz')
|
|
226
|
+
if pos=='0 0 0':
|
|
227
|
+
pos=None
|
|
228
|
+
if pos is not None:
|
|
229
|
+
f.setRelativePosition(self.as_floats(pos))
|
|
230
|
+
|
|
231
|
+
rpy = attrib.get('rpy')
|
|
232
|
+
if rpy=='0 0 0':
|
|
233
|
+
rpy=None
|
|
234
|
+
if rpy is not None:
|
|
235
|
+
q = ry.Quaternion()
|
|
236
|
+
q.setRollPitchYaw(self.as_floats(rpy))
|
|
237
|
+
f.setRelativeQuaternion(q.getArr())
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
import yaml
|
|
5
|
+
#from ruamel import yaml
|
|
6
|
+
|
|
7
|
+
# yaml dump tweaks
|
|
8
|
+
class noflow_dict(dict):
|
|
9
|
+
pass
|
|
10
|
+
def noflow_dict_rep(dumper, data):
|
|
11
|
+
return dumper.represent_mapping("tag:yaml.org,2002:map", data, flow_style=False)
|
|
12
|
+
yaml.add_representer(noflow_dict, noflow_dict_rep)
|
|
13
|
+
|
|
14
|
+
class quoted_string(str):
|
|
15
|
+
pass
|
|
16
|
+
def quoted_string_rep(dumper, data):
|
|
17
|
+
return dumper.represent_scalar("tag:yaml.org,2002:str", data, style='"')
|
|
18
|
+
yaml.add_representer(quoted_string, quoted_string_rep)
|
|
19
|
+
|
|
20
|
+
def yaml_write_dict(data, filename):
|
|
21
|
+
with open(filename, 'w') as fil:
|
|
22
|
+
yaml.dump(noflow_dict(data), fil, default_flow_style=True, sort_keys=False, width=500)
|
|
23
|
+
|
|
24
|
+
if __name__ == "__main__":
|
|
25
|
+
filename = sys.argv[1]
|
|
26
|
+
with open(filename, 'r', encoding='utf-8') as fil:
|
|
27
|
+
data = yaml.safe_load(fil)
|
|
28
|
+
print(yaml.dump(noflow_dict(data), None, default_flow_style=True, sort_keys=False, width=500))
|
|
29
|
+
|
robotic/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '0.
|
|
1
|
+
__version__ = '0.3.4.dev5'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!python
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import h5py
|
|
5
|
+
from robotic.src.h5_helper import *
|
|
6
|
+
|
|
7
|
+
parser = argparse.ArgumentParser(description='h5-file info')
|
|
8
|
+
|
|
9
|
+
parser.add_argument('FILE', type=str,
|
|
10
|
+
help='h5-file name')
|
|
11
|
+
|
|
12
|
+
def main():
|
|
13
|
+
args = parser.parse_args()
|
|
14
|
+
|
|
15
|
+
print('=== file', args.FILE)
|
|
16
|
+
try:
|
|
17
|
+
h5 = H5Reader(args.FILE)
|
|
18
|
+
h5.print_info()
|
|
19
|
+
except KeyboardInterrupt:
|
|
20
|
+
sys.exit(1)
|
|
21
|
+
|
|
22
|
+
if __name__ == "__main__":
|
|
23
|
+
main()
|
|
@@ -10,7 +10,8 @@ C.addFile(ry.raiPath('panda/panda.g'), 'b_').setPosition([0,0,.5])
|
|
|
10
10
|
C.addFrame('box1') .setShape(ry.ST.ssBox,[.3, .3, .3, .05]) .setPosition([1.3, 0, 2.]) .setMass(3)
|
|
11
11
|
C.addFrame('box2') .setShape(ry.ST.ssBox,[.3, .3, .3, .05]) .setPosition([.5, .0, 1.8]) .setMass(3)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
C.view(False)
|
|
14
|
+
time.sleep(.5)
|
|
14
15
|
|
|
15
16
|
q0 = C.getJointState()
|
|
16
17
|
qT = q0
|
|
@@ -18,7 +19,7 @@ qT[0] += 1.
|
|
|
18
19
|
|
|
19
20
|
sim = ry.Simulation(C, ry.SimulationEngine.physx, verbose=2) #try verbose=3 or 1
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
state = sim.getState()
|
|
22
23
|
|
|
23
24
|
tau=.01
|
|
24
25
|
|
|
@@ -33,7 +34,7 @@ for t in range(int(4./tau)):
|
|
|
33
34
|
# C.view(False, f'Note: the sim operates *directly* on the given config\nt:{t:4d} = {tau*t:5.2f}sec')
|
|
34
35
|
|
|
35
36
|
if (t%100)==0:
|
|
36
|
-
sim.setState(
|
|
37
|
-
q0 = q
|
|
37
|
+
sim.setState(*state)
|
|
38
|
+
#q0 = q
|
|
38
39
|
sim.resetSplineRef()
|
|
39
40
|
sim.setSplineRef(qT, [1.])
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!python
|
|
2
|
+
|
|
3
|
+
# from config_mujoco import *
|
|
4
|
+
# from config_urdf import *
|
|
5
|
+
# from mesh_helper import *
|
|
6
|
+
from robotic.src.yaml_helper import *
|
|
7
|
+
import robotic as ry
|
|
8
|
+
import argparse
|
|
9
|
+
import glob
|
|
10
|
+
import os
|
|
11
|
+
|
|
12
|
+
parser = argparse.ArgumentParser(
|
|
13
|
+
description='Utility to clean meshes in meshes/')
|
|
14
|
+
|
|
15
|
+
parser.add_argument('file', type=str, help='urdf file', nargs='?', default='none')
|
|
16
|
+
|
|
17
|
+
parser.add_argument('-view', help='view mesh', action="store_true", default=True)
|
|
18
|
+
parser.add_argument('-flipDaeYZ', help='view mesh', action="store_true", default=False)
|
|
19
|
+
parser.add_argument('-pruneRigidJoints', help='view mesh', action="store_true")
|
|
20
|
+
parser.add_argument('-recomputeInertias', help='view mesh', action="store_true")
|
|
21
|
+
parser.add_argument('-processMeshes', help='view mesh', action="store_true", default=True)
|
|
22
|
+
parser.add_argument('-meshlab', help='apply meshlab filters', action="store_true", default=False)
|
|
23
|
+
|
|
24
|
+
def main():
|
|
25
|
+
args = parser.parse_args()
|
|
26
|
+
|
|
27
|
+
if args.file=='none':
|
|
28
|
+
# args.file = '/home/mtoussai/git/rai-robotModels/pr2/pr2.urdf'
|
|
29
|
+
args.file = '/home/mtoussai/git/rai-robotModels/panda/panda_arm_hand.urdf'
|
|
30
|
+
# args.file = '/home/mtoussai/git/rai-robotModels/g1/g1_description/g1_29dof.urdf'
|
|
31
|
+
# args.file = '/home/mtoussai/git/rai-robotModels/ranger/ranger_mini.urdf'
|
|
32
|
+
|
|
33
|
+
print('=== URDF CONVERT ===', args.file)
|
|
34
|
+
|
|
35
|
+
path, file = os.path.split(args.file)
|
|
36
|
+
filebase, _ = os.path.splitext(file)
|
|
37
|
+
|
|
38
|
+
if args.flipDaeYZ:
|
|
39
|
+
ry.params_add({'assimp/daeFlipYZ': False})
|
|
40
|
+
|
|
41
|
+
C = ry.URDFLoader(args.file, visualsOnly=True, meshPathRemove='package://').C
|
|
42
|
+
|
|
43
|
+
C.processStructure(args.pruneRigidJoints, True, False, False)
|
|
44
|
+
C.processInertias(args.recomputeInertias)
|
|
45
|
+
C.processStructure(args.pruneRigidJoints, True, False, False)
|
|
46
|
+
|
|
47
|
+
os.system('rm -Rf meshes/')
|
|
48
|
+
C.writeMeshes('meshes/', copyTextures=True)
|
|
49
|
+
|
|
50
|
+
print('#frames: ', C.getFrameDimension())
|
|
51
|
+
with open(f'{filebase}_conv.g', 'w') as fil:
|
|
52
|
+
#yaml.dump(C.asDict(), file, default_flow_style=False)
|
|
53
|
+
fil.write(C.write())
|
|
54
|
+
|
|
55
|
+
yaml_write_dict(C.asDict(), f'{filebase}_conv.yml')
|
|
56
|
+
|
|
57
|
+
C.view(True)
|
|
58
|
+
# C.animate()
|
|
59
|
+
|
|
60
|
+
if args.processMeshes:
|
|
61
|
+
for file in sorted(glob.glob('meshes/*.h5')):
|
|
62
|
+
|
|
63
|
+
M = ry.MeshHelper(file)
|
|
64
|
+
if M.mesh is None:
|
|
65
|
+
continue
|
|
66
|
+
|
|
67
|
+
M.repair(mergeTolerance=1e-4)
|
|
68
|
+
print(' watertight:', M.mesh.is_watertight)
|
|
69
|
+
print(' oriented:', M.mesh.is_winding_consistent)
|
|
70
|
+
M.report()
|
|
71
|
+
M.export_h5()
|
|
72
|
+
|
|
73
|
+
if __name__ == "__main__":
|
|
74
|
+
main()
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!python
|
|
2
|
+
|
|
3
|
+
import robotic as ry
|
|
4
|
+
import argparse
|
|
5
|
+
import os
|
|
6
|
+
|
|
7
|
+
parser = argparse.ArgumentParser(
|
|
8
|
+
description='View a file (.g .yml .h5 or some mesh file). If config file, you can edit while viewing')
|
|
9
|
+
|
|
10
|
+
parser.add_argument('FILE', type=str,
|
|
11
|
+
help='g-file name')
|
|
12
|
+
parser.add_argument('-v', '--version', action='version',
|
|
13
|
+
version=f'%(prog)s -- robotic package version: {ry.__version__}, {ry.compiled()}')
|
|
14
|
+
|
|
15
|
+
def main():
|
|
16
|
+
args = parser.parse_args()
|
|
17
|
+
|
|
18
|
+
ext = os.path.splitext(args.FILE)[1]
|
|
19
|
+
|
|
20
|
+
print('=== viewing file:', args.FILE)
|
|
21
|
+
|
|
22
|
+
if ext in ['.g', '.yml']:
|
|
23
|
+
print(' assuming this is a configuration')
|
|
24
|
+
try:
|
|
25
|
+
C = ry.Config()
|
|
26
|
+
C.watchFile(args.FILE)
|
|
27
|
+
except KeyboardInterrupt:
|
|
28
|
+
exit(1)
|
|
29
|
+
|
|
30
|
+
elif ext in ['.h5']:
|
|
31
|
+
print(' assuming this is a h5 object (mesh & decomp & inertia)')
|
|
32
|
+
C = ry.Config()
|
|
33
|
+
C.addH5Object('object', args.FILE)
|
|
34
|
+
print(C.write())
|
|
35
|
+
C.view(True)
|
|
36
|
+
|
|
37
|
+
else:
|
|
38
|
+
print(' assuming this is a mesh file (using assimp to load)')
|
|
39
|
+
C = ry.Config()
|
|
40
|
+
f = C.addFrame('mesh')
|
|
41
|
+
f.setMeshFile(args.FILE)
|
|
42
|
+
print(C.write())
|
|
43
|
+
C.view(True)
|
|
44
|
+
|
|
45
|
+
if __name__ == "__main__":
|
|
46
|
+
main()
|