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
|
@@ -158,35 +158,6 @@ public :
|
|
|
158
158
|
void clean_all () ;
|
|
159
159
|
|
|
160
160
|
|
|
161
|
-
//-----------------------------------------------------------------------------
|
|
162
|
-
// Exportation
|
|
163
|
-
public :
|
|
164
|
-
/**
|
|
165
|
-
* PLY exportation of the generated mesh
|
|
166
|
-
* \param fn name of the PLY file to create
|
|
167
|
-
* \param bin if true, the PLY will be written in binary mode
|
|
168
|
-
*/
|
|
169
|
-
void writePLY( const char *fn, bool bin = false ) ;
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* PLY importation of a mesh
|
|
173
|
-
* \param fn name of the PLY file to read from
|
|
174
|
-
*/
|
|
175
|
-
void readPLY( const char *fn ) ;
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* VRML / Open Inventor exportation of the generated mesh
|
|
179
|
-
* \param fn name of the IV file to create
|
|
180
|
-
*/
|
|
181
|
-
void writeIV ( const char *fn ) ;
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* ISO exportation of the input grid
|
|
185
|
-
* \param fn name of the ISO file to create
|
|
186
|
-
*/
|
|
187
|
-
void writeISO( const char *fn ) ;
|
|
188
|
-
|
|
189
|
-
|
|
190
161
|
//-----------------------------------------------------------------------------
|
|
191
162
|
// Algorithm
|
|
192
163
|
public :
|
|
@@ -40,7 +40,7 @@ struct BSplineCtrlReference : ReferenceFeed {
|
|
|
40
40
|
//info:
|
|
41
41
|
double getEndTime() { return spline.get()->end(); }
|
|
42
42
|
arr getEndPoint() { return spline.get()->ctrlPoints[-1].copy(); }
|
|
43
|
-
void eval(arr& x, arr& xDot, arr& xDDot, double t) { spline.get()->
|
|
43
|
+
void eval(arr& x, arr& xDot, arr& xDDot, double t) { spline.get()->eval3(x, xDot, xDDot, t); }
|
|
44
44
|
|
|
45
45
|
void report(double ctrlTime);
|
|
46
46
|
};
|
|
@@ -14,12 +14,12 @@ namespace rai {
|
|
|
14
14
|
|
|
15
15
|
//----- Runge-Kutta
|
|
16
16
|
/// standard Runge-Kutta 4
|
|
17
|
-
void rk4(arr& x, const arr& x0,
|
|
17
|
+
void rk4(arr& x, const arr& x0, VectorFunction f, double dt);
|
|
18
18
|
/// same for second order diff equation
|
|
19
19
|
//void rk4dd(arr& x1, arr& v1, const arr& x0, const arr& v0,
|
|
20
20
|
// void (*ddf)(arr& xdd, const arr& x, const arr& v),
|
|
21
21
|
// double dt);
|
|
22
|
-
|
|
22
|
+
arr rk4_2ndOrder(const arr& x0, const std::function<arr (const arr&, const arr&)>& f, double dt);
|
|
23
23
|
|
|
24
24
|
/** RK with discrete event localization (zero-crossing detection): the
|
|
25
25
|
function sf computes some double-valued indicators. If one of
|
|
@@ -29,27 +29,23 @@ struct BSpline {
|
|
|
29
29
|
arr getBmatrix(const arr& sampleTimes, bool startDuplicates=false, bool endDuplicates=false);
|
|
30
30
|
|
|
31
31
|
//-- methods concerning ctrl points
|
|
32
|
-
void setCtrlPoints(const arr&
|
|
33
|
-
void append(const arr& points, const arr& times, bool inside);
|
|
32
|
+
void setCtrlPoints(const arr& points, bool addStartDuplicates=true, bool addEndDuplicates=true, const arr& setStartVel=NoArr, const arr& setEndVel=NoArr);
|
|
34
33
|
|
|
35
34
|
//-- convenience user functions
|
|
36
35
|
BSpline& set(uint _degree, const arr& points, const arr& times, const arr& startVel=NoArr, const arr& endVel=NoArr);
|
|
36
|
+
void overwriteSmooth(const arr& points, const arr& times_rel, double time_cut);
|
|
37
|
+
void append(const arr& points, const arr& times_rel, bool inside);
|
|
37
38
|
void clear();
|
|
38
39
|
arr& getKnots(){ return knots; }
|
|
39
40
|
arr& getCtrlPoints(){ return ctrlPoints; }
|
|
40
41
|
arr getPoints();
|
|
41
42
|
|
|
42
|
-
//-- obsolete
|
|
43
|
-
// BSpline& set_vel(uint degree, const arr& points, const arr& velocities, const arr& _times);
|
|
44
|
-
|
|
45
|
-
|
|
46
43
|
//experimental
|
|
47
44
|
void doubleKnot(uint t);
|
|
48
45
|
void setDoubleKnotVel(int t, const arr& vel);
|
|
49
46
|
|
|
50
47
|
/// core method to evaluate spline
|
|
51
|
-
|
|
52
|
-
void eval2(arr& x, arr& xDot, arr& xDDot, double t, arr& Jpoints=NoArr, arr& Jtimes=NoArr) const;
|
|
48
|
+
void eval3(arr& x, arr& xDot, arr& xDDot, double t, arr& Jpoints=NoArr, arr& Jtimes=NoArr) const;
|
|
53
49
|
arr eval(double t, uint derivative=0) const;
|
|
54
50
|
arr eval(const arr& sampleTimes, uint derivative=0) const;
|
|
55
51
|
|
|
@@ -44,8 +44,8 @@ struct TimingMPC {
|
|
|
44
44
|
|
|
45
45
|
uint nPhases() const { return waypoints.d0; }
|
|
46
46
|
bool done() const { return phase>=nPhases(); }
|
|
47
|
-
arr getWaypoints() const { if(done()) return waypoints[-1].copy().reshape(1, -1); return waypoints({phase,
|
|
48
|
-
arr getTimes() const { if(done()) return {.1}; return integral(tau({phase,
|
|
47
|
+
arr getWaypoints() const { if(done()) return waypoints[-1].copy().reshape(1, -1); return waypoints({phase,0}).copy(); }
|
|
48
|
+
arr getTimes() const { if(done()) return {.1}; return integral(tau({phase,0})); }
|
|
49
49
|
arr getVels() const;
|
|
50
50
|
|
|
51
51
|
bool set_progressedTime(double gap, double tauCutoff=0.);
|
robotic/include/rai/Core/array.h
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
#include <initializer_list>
|
|
15
15
|
#include <tuple>
|
|
16
16
|
#include <iostream>
|
|
17
|
+
#include <memory>
|
|
18
|
+
#include <vector>
|
|
17
19
|
|
|
18
20
|
using std::endl;
|
|
19
21
|
|
|
@@ -26,6 +28,8 @@ namespace rai {
|
|
|
26
28
|
extern const char* arrayElemsep;
|
|
27
29
|
extern const char* arrayLinesep;
|
|
28
30
|
extern const char* arrayBrackets;
|
|
31
|
+
extern int64_t globalMemoryTotal, globalMemoryBound;
|
|
32
|
+
extern bool globalMemoryStrict;
|
|
29
33
|
|
|
30
34
|
// default sorting methods
|
|
31
35
|
template<class T> bool lower(const T& a, const T& b) { return a<b; }
|
|
@@ -42,9 +46,13 @@ template<class T> bool greaterEqual(const T& a, const T& b) { return a>=b; }
|
|
|
42
46
|
|
|
43
47
|
namespace rai {
|
|
44
48
|
|
|
49
|
+
//fwd declarations
|
|
45
50
|
template<class T> struct ArrayModRaw;
|
|
46
51
|
template<class T> struct ArrayModList;
|
|
47
52
|
struct SpecialArray;
|
|
53
|
+
struct SparseVector;
|
|
54
|
+
struct SparseMatrix;
|
|
55
|
+
struct RowShifted;
|
|
48
56
|
|
|
49
57
|
/** Simple array container to store arbitrary-dimensional arrays (tensors).
|
|
50
58
|
Can buffer more memory than necessary for faster
|
|
@@ -59,7 +67,7 @@ template<class T> struct Array {
|
|
|
59
67
|
uint N; ///< number of elements
|
|
60
68
|
uint nd; ///< number of dimensions
|
|
61
69
|
uint d0, d1, d2; ///< 0th, 1st, 2nd dim
|
|
62
|
-
uint*
|
|
70
|
+
uint* _shape; ///< pointer to dimensions (for nd<=3 points to d0)
|
|
63
71
|
bool isReference; ///< true if this refers to memory of another array
|
|
64
72
|
uint M; ///< memory allocated (>=N)
|
|
65
73
|
SpecialArray* special=0; ///< auxiliary data, e.g. if this is a sparse matrics, depends on special type
|
|
@@ -78,6 +86,7 @@ template<class T> struct Array {
|
|
|
78
86
|
explicit Array(uint D0, uint D1, uint D2);
|
|
79
87
|
Array(std::initializer_list<T> values);
|
|
80
88
|
Array(std::initializer_list<uint> dim, std::initializer_list<T> values);
|
|
89
|
+
explicit Array(const T* p, uint size, bool byReference);
|
|
81
90
|
virtual ~Array();
|
|
82
91
|
|
|
83
92
|
/// @name assignments
|
|
@@ -86,24 +95,30 @@ template<class T> struct Array {
|
|
|
86
95
|
Array<T>& operator=(const Array<T>& a);
|
|
87
96
|
|
|
88
97
|
/// @name iterators
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
98
|
+
using iterator = T*;
|
|
99
|
+
using const_iterator = const T*;
|
|
100
|
+
// struct iterator {
|
|
101
|
+
// using reference = T&;
|
|
102
|
+
// T* p;
|
|
103
|
+
// T& operator()() { return *p; } //access to value by user
|
|
104
|
+
// void operator++() { p++; }
|
|
105
|
+
// reference operator*() { return *p; } //in for(auto& it:array.enumerated()) it is assigned to *iterator
|
|
106
|
+
// friend bool operator!=(const iterator& i, const iterator& j) { return i.p!=j.p; }
|
|
107
|
+
// friend long int operator-(const iterator& i, const iterator& j) { return (long int)(i.p-j.p); }
|
|
108
|
+
// friend iterator operator+(const iterator& i, int j) { return iterator{i.p+j}; }
|
|
109
|
+
// friend iterator operator-(const iterator& i, int j) { return iterator{i.p-j}; }
|
|
110
|
+
// friend reference operator*(const iterator& i, int j) { return i.p[j]; }
|
|
111
|
+
// T& operator->() { return *p; }
|
|
112
|
+
// };
|
|
113
|
+
// struct const_iterator {
|
|
114
|
+
// using reference = const T&;
|
|
115
|
+
// const T* p;
|
|
116
|
+
// const T& operator()() { return *p; } //access to value by user
|
|
117
|
+
// void operator++() { p++; }
|
|
118
|
+
// reference operator*() { return *p; } //in for(auto& it:array.enumerated()) it is assigned to *iterator
|
|
119
|
+
// friend bool operator!=(const const_iterator& i, const const_iterator& j) { return i.p!=j.p; }
|
|
120
|
+
// const T& operator->() { return *p; }
|
|
121
|
+
// };
|
|
107
122
|
|
|
108
123
|
iterator begin() { return iterator{p}; }
|
|
109
124
|
const_iterator begin() const { return const_iterator{p}; }
|
|
@@ -132,7 +147,6 @@ template<class T> struct Array {
|
|
|
132
147
|
Array<T>& resizeAs(const Array<T>& a);
|
|
133
148
|
Array<T>& reshapeAs(const Array<T>& a);
|
|
134
149
|
Array<T>& resizeCopyAs(const Array<T>& a);
|
|
135
|
-
Array<T>& reshapeFlat();
|
|
136
150
|
Array<T>& dereference();
|
|
137
151
|
|
|
138
152
|
/// @name dimensionality access
|
|
@@ -142,7 +156,7 @@ template<class T> struct Array {
|
|
|
142
156
|
/// @name initializing/assigning entries
|
|
143
157
|
Array<T>& clear();
|
|
144
158
|
Array<T>& setZero(byte zero=0);
|
|
145
|
-
void
|
|
159
|
+
void setConst(const T& scalar, int d=-1);
|
|
146
160
|
void setId(int d=-1);
|
|
147
161
|
void setDiag(const T& scalar, int d=-1);
|
|
148
162
|
void setDiag(const Array<T>& vector);
|
|
@@ -156,17 +170,16 @@ template<class T> struct Array {
|
|
|
156
170
|
void setReversePerm(int n=-1);
|
|
157
171
|
void setRandomPerm(int n=-1);
|
|
158
172
|
Array<T>& setCarray(const T* buffer, uint D0);
|
|
159
|
-
Array<T>& setCarray(const
|
|
173
|
+
Array<T>& setCarray(T* const* buffer, uint D0, uint D1);
|
|
160
174
|
Array<T>& referTo(const T* buffer, uint n);
|
|
161
175
|
void referTo(const Array<T>& a);
|
|
162
|
-
void referToRange(const Array<T>& a, int
|
|
163
|
-
void referToRange(const Array<T>& a, int i,
|
|
164
|
-
void referToRange(const Array<T>& a, int i, int j,
|
|
176
|
+
void referToRange(const Array<T>& a, std::pair<int, int> I);
|
|
177
|
+
void referToRange(const Array<T>& a, int i, std::pair<int, int> J);
|
|
178
|
+
void referToRange(const Array<T>& a, int i, int j, std::pair<int, int> K);
|
|
165
179
|
void referToDim(const Array<T>& a, int i);
|
|
166
180
|
void referToDim(const Array<T>& a, uint i, uint j);
|
|
167
181
|
void referToDim(const Array<T>& a, uint i, uint j, uint k);
|
|
168
182
|
void takeOver(Array<T>& a); //a is cleared (earlier: becomes a reference to its previously owned memory)
|
|
169
|
-
Array<T>& setGrid(uint dim, T lo, T hi, uint steps);
|
|
170
183
|
|
|
171
184
|
/// @name access by reference (direct memory access)
|
|
172
185
|
Array<T> ref() const; //a reference on this
|
|
@@ -191,11 +204,11 @@ template<class T> struct Array {
|
|
|
191
204
|
|
|
192
205
|
/// @name access by copy
|
|
193
206
|
Array<T> copy() const;
|
|
194
|
-
Array<T> sub(int
|
|
195
|
-
Array<T> sub(int
|
|
196
|
-
Array<T> sub(int
|
|
197
|
-
Array<T>
|
|
198
|
-
Array<T>
|
|
207
|
+
Array<T> sub(std::pair<int, int> I) const;
|
|
208
|
+
Array<T> sub(std::pair<int, int> I, std::pair<int, int> J) const;
|
|
209
|
+
Array<T> sub(std::pair<int, int> I, std::pair<int, int> J, std::pair<int, int> K) const;
|
|
210
|
+
Array<T> pick(std::pair<int, int> I, Array<uint> cols) const;
|
|
211
|
+
Array<T> pick(Array<uint> elems) const;
|
|
199
212
|
Array<T> row(uint row_index) const;
|
|
200
213
|
Array<T> rows(uint start_row, uint end_row) const;
|
|
201
214
|
Array<T> col(uint col_index) const;
|
|
@@ -225,7 +238,7 @@ template<class T> struct Array {
|
|
|
225
238
|
void delRows(int i, uint k=1);
|
|
226
239
|
void delColumns(int i, uint k=1);
|
|
227
240
|
void insRows(int i, uint k=1);
|
|
228
|
-
|
|
241
|
+
Array<T>& insColumns(int i, uint k=1);
|
|
229
242
|
void resizeDim(uint k, uint dk);
|
|
230
243
|
void setAppend(const T& x); //? same as if(findValue(x)==-1) append(x)
|
|
231
244
|
void setAppend(const Array<T>& x);
|
|
@@ -256,6 +269,22 @@ template<class T> struct Array {
|
|
|
256
269
|
void permuteRandomly();
|
|
257
270
|
void shift(int offset, bool wrapAround=true);
|
|
258
271
|
|
|
272
|
+
/// @name special matrices -- only for double
|
|
273
|
+
double sparsity();
|
|
274
|
+
SparseMatrix& sparse();
|
|
275
|
+
const SparseMatrix& sparse() const;
|
|
276
|
+
SparseVector& sparseVec();
|
|
277
|
+
const SparseVector& sparseVec() const;
|
|
278
|
+
RowShifted& rowShifted();
|
|
279
|
+
const RowShifted& rowShifted() const;
|
|
280
|
+
|
|
281
|
+
/// @name attached Jacobian -- only for double
|
|
282
|
+
std::unique_ptr<Array<double>> jac=0; ///< optional pointer to Jacobian, to enable autodiff
|
|
283
|
+
void J_setId();
|
|
284
|
+
Array<double>& J();
|
|
285
|
+
Array<double> noJ() const;
|
|
286
|
+
Array<double> J_reset();
|
|
287
|
+
|
|
259
288
|
/// @name I/O
|
|
260
289
|
void write(std::ostream& os=std::cout, const char* ELEMSEP=nullptr, const char* LINESEP=nullptr, const char* BRACKETS=nullptr, bool dimTag=false, bool binary=false) const;
|
|
261
290
|
Array<T>& read(std::istream& is);
|
|
@@ -281,7 +310,7 @@ template<class T> struct Array {
|
|
|
281
310
|
void resizeMEM(uint n, bool copy, int Mforce=-1);
|
|
282
311
|
void reserveMEM(uint Mforce) { resizeMEM(N, true, Mforce); if(!nd) nd=1; }
|
|
283
312
|
void freeMEM();
|
|
284
|
-
void
|
|
313
|
+
void resetShape(uint* dim=0);
|
|
285
314
|
|
|
286
315
|
/// @name serialization
|
|
287
316
|
uint serial_size();
|
|
@@ -299,33 +328,15 @@ template<class T> bool operator==(const Array<T>& v, const Array<T>& w); //equal
|
|
|
299
328
|
template<class T> Array<byte> operator==(const Array<T>& v, const T& w); //element-wise equal
|
|
300
329
|
template<class T> bool operator!=(const Array<T>& v, const Array<T>& w);
|
|
301
330
|
template<class T> std::istream& operator>>(std::istream& is, Array<T>& x);
|
|
302
|
-
template<class T> Array<T>& operator>>(Array<T>& x, std::istream& is);
|
|
303
331
|
template<class T> std::ostream& operator<<(std::ostream& os, const Array<T>& x);
|
|
304
332
|
|
|
305
|
-
template<class T> void operator+=(Array<T>& x, const Array<T>& y)
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
T* xp=x.p, *xstop=xp+x.N;
|
|
313
|
-
for(; xp!=xstop; xp++) *xp += y;
|
|
314
|
-
}
|
|
315
|
-
template<class T> void operator-=(Array<T>& x, const Array<T>& y) {
|
|
316
|
-
CHECK_EQ(x.N, y.N, "update operator on different array dimensions (" <<x.N <<", " <<y.N <<")");
|
|
317
|
-
T* xp=x.p, *xstop=xp+x.N;
|
|
318
|
-
const T* yp=y.p;
|
|
319
|
-
for(; xp!=xstop; xp++, yp++) *xp -= *yp;
|
|
320
|
-
}
|
|
321
|
-
template<class T> void operator-=(Array<T>& x, const T& y) {
|
|
322
|
-
T* xp=x.p, *xstop=xp+x.N;
|
|
323
|
-
for(; xp!=xstop; xp++) *xp -= y;
|
|
324
|
-
}
|
|
325
|
-
template<class T> void operator*=(Array<T>& x, const T& y) {
|
|
326
|
-
T* xp=x.p, *xstop=xp+x.N;
|
|
327
|
-
for(; xp!=xstop; xp++) *xp *= y;
|
|
328
|
-
}
|
|
333
|
+
template<class T> void operator+=(Array<T>& x, const Array<T>& y);
|
|
334
|
+
template<class T> void operator+=(Array<T>& x, const T& y);
|
|
335
|
+
template<class T> void operator-=(Array<T>& x, const Array<T>& y);
|
|
336
|
+
template<class T> void operator-=(Array<T>& x, const T& y);
|
|
337
|
+
template<class T> void operator*=(Array<T>& x, const T& y);
|
|
338
|
+
template<class T> void operator/=(Array<T>& x, const T& y);
|
|
339
|
+
|
|
329
340
|
template<class T> Array<T> operator+(const Array<T>& y, const Array<T>& z) { Array<T> x(y); x+=z; return x; }
|
|
330
341
|
template<class T> Array<T> operator+(const Array<T>& y, T z) { Array<T> x(y); x+=z; return x; }
|
|
331
342
|
template<class T> Array<T> operator-(const Array<T>& y, const Array<T>& z) { Array<T> x(y); x-=z; return x; }
|
|
@@ -360,6 +371,7 @@ template <class T> std::ostream& operator<<(std::ostream& os, const ArrayModList
|
|
|
360
371
|
/// @name standard types
|
|
361
372
|
/// @{
|
|
362
373
|
|
|
374
|
+
typedef rai::Array<double> arr;
|
|
363
375
|
typedef rai::Array<uint> uintA;
|
|
364
376
|
typedef rai::Array<int> intA;
|
|
365
377
|
typedef rai::Array<char> charA;
|
|
@@ -373,6 +385,8 @@ typedef rai::Array<intA> intAA;
|
|
|
373
385
|
typedef rai::Array<uintA> uintAA;
|
|
374
386
|
|
|
375
387
|
namespace rai { struct String; }
|
|
388
|
+
typedef rai::Array<rai::String> strA;
|
|
389
|
+
typedef rai::Array<rai::String> strAA;
|
|
376
390
|
typedef rai::Array<rai::String> StringA;
|
|
377
391
|
typedef rai::Array<StringA> StringAA;
|
|
378
392
|
typedef rai::Array<rai::String*> StringL;
|
|
@@ -385,7 +399,7 @@ typedef rai::Array<rai::String*> StringL;
|
|
|
385
399
|
namespace rai {
|
|
386
400
|
|
|
387
401
|
/// return array of c's
|
|
388
|
-
template<class T> Array<T> consts(const T& c, const uintA& d) { Array<T> z; z.resize(d); z.
|
|
402
|
+
template<class T> Array<T> consts(const T& c, const uintA& d) { Array<T> z; z.resize(d); z.setConst(c); return z; }
|
|
389
403
|
/// return VECTOR of c's
|
|
390
404
|
template<class T> Array<T> consts(const T& c, uint n) { return consts(c, uintA{n}); }
|
|
391
405
|
/// return matrix of c's
|
|
@@ -410,6 +424,11 @@ template<class T> Array<Array<T>> getArrayArray(const Array<T>& data) {
|
|
|
410
424
|
return xx;
|
|
411
425
|
}
|
|
412
426
|
|
|
427
|
+
/** @brief return a `dim'-dimensional grid with `steps' intervals
|
|
428
|
+
filling the range [lo, hi] in each dimension. Note: returned array is
|
|
429
|
+
`flat', rather than grid-shaped. */
|
|
430
|
+
template<class T> Array<T> grid(uint dim, T lo, T hi, uint steps);
|
|
431
|
+
|
|
413
432
|
}
|
|
414
433
|
|
|
415
434
|
//===========================================================================
|
|
@@ -435,8 +454,8 @@ template<class T> Array<T> catCol(const rai::Array<T>& a, const rai::Array<T>& b
|
|
|
435
454
|
namespace rai {
|
|
436
455
|
template<class T, class S> void resizeAs(Array<T>& x, const Array<S>& a) {
|
|
437
456
|
x.nd=a.nd; x.d0=a.d0; x.d1=a.d1; x.d2=a.d2;
|
|
438
|
-
x.
|
|
439
|
-
if(x.nd>3) { x.
|
|
457
|
+
x.resetShape();
|
|
458
|
+
if(x.nd>3) { x._shape=new uint[x.nd]; memmove(x._shape, a._shape, x.nd*sizeof(uint)); }
|
|
440
459
|
x.resizeMEM(a.N, false);
|
|
441
460
|
}
|
|
442
461
|
template<class T, class S> void resizeCopyAs(Array<T>& x, const Array<S>& a);
|
|
@@ -526,8 +545,7 @@ template<class T> Array<T> setSectionSorted(const Array<T>& x, const Array<T>& y
|
|
|
526
545
|
return R;
|
|
527
546
|
}
|
|
528
547
|
|
|
529
|
-
template<class T>
|
|
530
|
-
void setMinusSorted(Array<T>& x, const Array<T>& y, bool (*comp)(const T& a, const T& b)) {
|
|
548
|
+
template<class T> void setMinusSorted(Array<T>& x, const Array<T>& y, bool (*comp)(const T& a, const T& b)) {
|
|
531
549
|
#if 1
|
|
532
550
|
int i=x.N-1, j=y.N-1;
|
|
533
551
|
if(j<0) return;
|
|
@@ -563,6 +581,7 @@ template<class T> uint numberSharedElements(const Array<T>& x, const Array<T>& y
|
|
|
563
581
|
//
|
|
564
582
|
// special iterators
|
|
565
583
|
|
|
584
|
+
|
|
566
585
|
namespace rai {
|
|
567
586
|
|
|
568
587
|
template<class T>
|
|
@@ -665,7 +684,10 @@ template<class T> Array<T>& Array<T>::setNoArr() { special = new SpecialArray(Sp
|
|
|
665
684
|
|
|
666
685
|
namespace rai {
|
|
667
686
|
uint product(const uintA& x);
|
|
668
|
-
|
|
687
|
+
template<class T> T& min(const Array<T>& x);
|
|
688
|
+
template<class T> T& max(const Array<T>& x);
|
|
689
|
+
template<class T> std::tuple<T&,uint> min_arg(const Array<T>& x);
|
|
690
|
+
template<class T> std::tuple<T&,uint> max_arg(const Array<T>& x);
|
|
669
691
|
uint sum(const uintA& x);
|
|
670
692
|
float sum(const floatA& x);
|
|
671
693
|
template<class T> Array<T> integral(const Array<T>& x);
|
|
@@ -687,6 +709,19 @@ void b64_encode(char* code, int code_len, const char* data, int data_len);
|
|
|
687
709
|
void b64_decode(char* data, int data_len, const char* code, int code_len);
|
|
688
710
|
}
|
|
689
711
|
|
|
712
|
+
//===========================================================================
|
|
713
|
+
//
|
|
714
|
+
// conversions
|
|
715
|
+
//
|
|
716
|
+
|
|
717
|
+
template<class T> rai::Array<T> as_arr(const std::vector<T>& a, bool byReference) {
|
|
718
|
+
return rai::Array<T>(&a.front(), a.size(), byReference);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
template<class T> std::vector<T> as_vector(const rai::Array<T>& a) {
|
|
722
|
+
return std::vector<T>(a.p, a.p+a.N);
|
|
723
|
+
}
|
|
724
|
+
|
|
690
725
|
//===========================================================================
|
|
691
726
|
//
|
|
692
727
|
// implementations
|