robotic 0.2.8.dev4__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.
Files changed (411) hide show
  1. robotic/DataGen.pyi +11 -1
  2. robotic/__init__.py +8 -1
  3. robotic/_robotic.pyi +236 -114
  4. robotic/_robotic.so +0 -0
  5. robotic/algo.pyi +17 -0
  6. robotic/include/rai/{Geo → Algo}/Lewiner/MarchingCubes.h +0 -29
  7. robotic/include/rai/Algo/SplineCtrlFeed.h +1 -1
  8. robotic/include/rai/Algo/marching_cubes.h +9 -0
  9. robotic/include/rai/Algo/rungeKutta.h +2 -2
  10. robotic/include/rai/Algo/spline.h +4 -8
  11. robotic/include/rai/Algo/trilinear.h +10 -0
  12. robotic/include/rai/Control/CtrlSolver.h +1 -1
  13. robotic/include/rai/Control/TimingMPC.h +2 -2
  14. robotic/include/rai/Core/array.h +99 -64
  15. robotic/include/rai/Core/array.ipp +290 -136
  16. robotic/include/rai/Core/arrayDouble.h +36 -26
  17. robotic/include/rai/Core/defines.h +7 -9
  18. robotic/include/rai/Core/graph.h +33 -37
  19. robotic/include/rai/Core/h5.h +3 -1
  20. robotic/include/rai/Core/thread.h +12 -12
  21. robotic/include/rai/Core/util.h +58 -79
  22. robotic/include/rai/DataGen/rndStableConfigs.h +1 -0
  23. robotic/include/rai/DataGen/shapenetGrasps.h +5 -3
  24. robotic/include/rai/Geo/depth2PointCloud.h +2 -0
  25. robotic/include/rai/Geo/geo.h +24 -16
  26. robotic/include/rai/Geo/{fclInterface.h → i_fcl.h} +3 -1
  27. robotic/include/rai/Geo/mesh.h +22 -16
  28. robotic/include/rai/Geo/pairCollision.h +43 -43
  29. robotic/include/rai/Geo/signedDistanceFunctions.h +7 -5
  30. robotic/include/rai/Geo/stb_image.h +1 -1
  31. robotic/include/rai/Gui/RenderData.h +12 -9
  32. robotic/include/rai/Gui/opengl.h +6 -6
  33. robotic/include/rai/Gui/plot.h +1 -1
  34. robotic/include/rai/KOMO/komo.h +6 -3
  35. robotic/include/rai/KOMO/komo_NLP.h +2 -2
  36. robotic/include/rai/KOMO/manipTools.h +7 -2
  37. robotic/include/rai/KOMO/testProblems_KOMO.h +5 -9
  38. robotic/include/rai/Kin/F_forces.h +3 -3
  39. robotic/include/rai/Kin/cameraview.h +24 -36
  40. robotic/include/rai/Kin/dof_forceExchange.h +7 -7
  41. robotic/include/rai/Kin/feature.h +1 -1
  42. robotic/include/rai/Kin/frame.h +24 -26
  43. robotic/include/rai/Kin/{kin_physx.h → i_Physx.h} +11 -10
  44. robotic/include/rai/Kin/kin.h +30 -20
  45. robotic/include/rai/Kin/proxy.h +1 -1
  46. robotic/include/rai/Kin/simulation.h +20 -10
  47. robotic/include/rai/Kin/viewer.h +14 -1
  48. robotic/include/rai/LGP/LGP_TAMP_Abstraction.h +33 -0
  49. robotic/include/rai/LGP/LGP_Tool.h +4 -25
  50. robotic/include/rai/LGP/LGP_computers.h +1 -1
  51. robotic/include/rai/LGP/LGP_computers2.h +196 -0
  52. robotic/include/rai/LGP/NLP_Descriptor.h +5 -0
  53. robotic/include/rai/Logic/folWorld.h +1 -1
  54. robotic/include/rai/Logic/treeSearchDomain.h +2 -2
  55. robotic/include/rai/Optim/BayesOpt.h +13 -6
  56. robotic/include/rai/Optim/CMA/boundary_transformation.h +73 -0
  57. robotic/include/rai/Optim/CMA/cmaes.h +175 -0
  58. robotic/include/rai/Optim/CMA/cmaes_interface.h +68 -0
  59. robotic/include/rai/Optim/GlobalIterativeNewton.h +7 -3
  60. robotic/include/rai/Optim/NLP.h +23 -7
  61. robotic/include/rai/Optim/NLP_GraphSolver.h +1 -1
  62. robotic/include/rai/Optim/NLP_Solver.h +5 -5
  63. robotic/include/rai/Optim/constrained.h +4 -4
  64. robotic/include/rai/Optim/{opt-ceres.h → i_Ceres.h} +2 -2
  65. robotic/include/rai/Optim/{opt-nlopt.h → i_NLopt.h} +4 -0
  66. robotic/include/rai/Optim/lagrangian.h +7 -5
  67. robotic/include/rai/Optim/liblbfgs/liblbfgs.h +755 -0
  68. robotic/include/rai/Optim/m_EvoStrategies.h +114 -0
  69. robotic/include/rai/Optim/{gradient.h → m_Gradient.h} +13 -12
  70. robotic/include/rai/Optim/m_LBFGS.h +21 -0
  71. robotic/include/rai/Optim/m_LeastSquaresZeroOrder.h +104 -0
  72. robotic/include/rai/Optim/m_LocalGreedy.h +31 -0
  73. robotic/include/rai/Optim/m_NelderMead.h +23 -0
  74. robotic/include/rai/Optim/{newton.h → m_Newton.h} +7 -4
  75. robotic/include/rai/Optim/{SlackGaussNewton.h → m_SlackGaussNewton.h} +0 -10
  76. robotic/include/rai/Optim/options.h +8 -7
  77. robotic/include/rai/Optim/primalDual.h +10 -6
  78. robotic/include/rai/Optim/testProblems_Opt.h +25 -19
  79. robotic/include/rai/Optim/utils.h +16 -85
  80. robotic/include/rai/PathAlgos/ConfigurationProblem.h +3 -2
  81. robotic/include/rai/PathAlgos/RRT_PathFinder.h +2 -2
  82. robotic/include/rai/Perception/pcl.h +10 -10
  83. robotic/include/rai/Perception/surfels.h +1 -1
  84. robotic/include/rai/Search/TreeSearchNode.h +1 -1
  85. robotic/include/rai/ry/py-algo.h +17 -0
  86. robotic/include/rai/ry/types.h +4 -2
  87. robotic/librai.so +0 -0
  88. robotic/manipulation.py +5 -7
  89. robotic/meshTool +0 -0
  90. robotic/mujoco-import.py +8 -0
  91. robotic/rai-robotModels/g1/g1.g +11 -2
  92. robotic/rai-robotModels/g1/g1_29dof_conv.yml +64 -0
  93. robotic/rai-robotModels/g1/g1_clean.g +38 -73
  94. robotic/rai-robotModels/g1/meshes/head_link.h5 +0 -0
  95. robotic/rai-robotModels/g1/meshes/left_ankle_pitch_link.h5 +0 -0
  96. robotic/rai-robotModels/g1/meshes/left_ankle_roll_link.h5 +0 -0
  97. robotic/rai-robotModels/g1/meshes/left_elbow_link.h5 +0 -0
  98. robotic/rai-robotModels/g1/meshes/left_hip_pitch_link.h5 +0 -0
  99. robotic/rai-robotModels/g1/meshes/left_hip_roll_link.h5 +0 -0
  100. robotic/rai-robotModels/g1/meshes/left_hip_yaw_link.h5 +0 -0
  101. robotic/rai-robotModels/g1/meshes/left_knee_link.h5 +0 -0
  102. robotic/rai-robotModels/g1/meshes/left_rubber_hand.h5 +0 -0
  103. robotic/rai-robotModels/g1/meshes/left_shoulder_pitch_link.h5 +0 -0
  104. robotic/rai-robotModels/g1/meshes/left_shoulder_roll_link.h5 +0 -0
  105. robotic/rai-robotModels/g1/meshes/left_shoulder_yaw_link.h5 +0 -0
  106. robotic/rai-robotModels/g1/meshes/left_wrist_pitch_link.h5 +0 -0
  107. robotic/rai-robotModels/g1/meshes/left_wrist_roll_link.h5 +0 -0
  108. robotic/rai-robotModels/g1/meshes/left_wrist_yaw_link.h5 +0 -0
  109. robotic/rai-robotModels/g1/meshes/logo_link.h5 +0 -0
  110. robotic/rai-robotModels/g1/meshes/pelvis.h5 +0 -0
  111. robotic/rai-robotModels/g1/meshes/pelvis_contour_link.h5 +0 -0
  112. robotic/rai-robotModels/g1/meshes/right_ankle_pitch_link.h5 +0 -0
  113. robotic/rai-robotModels/g1/meshes/right_ankle_roll_link.h5 +0 -0
  114. robotic/rai-robotModels/g1/meshes/right_elbow_link.h5 +0 -0
  115. robotic/rai-robotModels/g1/meshes/right_hip_pitch_link.h5 +0 -0
  116. robotic/rai-robotModels/g1/meshes/right_hip_roll_link.h5 +0 -0
  117. robotic/rai-robotModels/g1/meshes/right_hip_yaw_link.h5 +0 -0
  118. robotic/rai-robotModels/g1/meshes/right_knee_link.h5 +0 -0
  119. robotic/rai-robotModels/g1/meshes/right_rubber_hand.h5 +0 -0
  120. robotic/rai-robotModels/g1/meshes/right_shoulder_pitch_link.h5 +0 -0
  121. robotic/rai-robotModels/g1/meshes/right_shoulder_roll_link.h5 +0 -0
  122. robotic/rai-robotModels/g1/meshes/right_shoulder_yaw_link.h5 +0 -0
  123. robotic/rai-robotModels/g1/meshes/right_wrist_pitch_link.h5 +0 -0
  124. robotic/rai-robotModels/g1/meshes/right_wrist_roll_link.h5 +0 -0
  125. robotic/rai-robotModels/g1/meshes/right_wrist_yaw_link.h5 +0 -0
  126. robotic/rai-robotModels/g1/meshes/torso_link.h5 +0 -0
  127. robotic/rai-robotModels/g1/meshes/waist_roll_link.h5 +0 -0
  128. robotic/rai-robotModels/g1/meshes/waist_support_link.h5 +0 -0
  129. robotic/rai-robotModels/g1/meshes/waist_yaw_link.h5 +0 -0
  130. robotic/rai-robotModels/objects/shelf.g +1 -1
  131. robotic/rai-robotModels/panda/meshes/finger.h5 +0 -0
  132. robotic/rai-robotModels/panda/meshes/hand.h5 +0 -0
  133. robotic/rai-robotModels/panda/meshes/link0.h5 +0 -0
  134. robotic/rai-robotModels/panda/meshes/link1.h5 +0 -0
  135. robotic/rai-robotModels/panda/meshes/link2.h5 +0 -0
  136. robotic/rai-robotModels/panda/meshes/link3.h5 +0 -0
  137. robotic/rai-robotModels/panda/meshes/link4.h5 +0 -0
  138. robotic/rai-robotModels/panda/meshes/link5.h5 +0 -0
  139. robotic/rai-robotModels/panda/meshes/link6.h5 +0 -0
  140. robotic/rai-robotModels/panda/meshes/link7.h5 +0 -0
  141. robotic/rai-robotModels/panda/panda.g +10 -10
  142. robotic/rai-robotModels/panda/panda_arm_hand_conv.g +24 -0
  143. robotic/rai-robotModels/panda/panda_arm_hand_conv.yml +24 -0
  144. robotic/rai-robotModels/panda/panda_clean.g +21 -45
  145. robotic/rai-robotModels/panda/panda_gripper.g +5 -7
  146. robotic/rai-robotModels/panda/panda_withoutCollisionModels.g +3 -11
  147. robotic/rai-robotModels/pr2/meshes/base.h5 +0 -0
  148. robotic/rai-robotModels/pr2/meshes/base_color.png +0 -0
  149. robotic/rai-robotModels/pr2/meshes/caster.h5 +0 -0
  150. robotic/rai-robotModels/pr2/meshes/elbow_flex.h5 +0 -0
  151. robotic/rai-robotModels/pr2/meshes/elbow_flex_color.png +0 -0
  152. robotic/rai-robotModels/pr2/meshes/forearm.h5 +0 -0
  153. robotic/rai-robotModels/pr2/meshes/forearm_color.png +0 -0
  154. robotic/rai-robotModels/pr2/meshes/forearm_roll.h5 +0 -0
  155. robotic/rai-robotModels/pr2/meshes/gripper_palm.h5 +0 -0
  156. robotic/rai-robotModels/pr2/meshes/gripper_palm_color.png +0 -0
  157. robotic/rai-robotModels/pr2/meshes/head_pan.h5 +0 -0
  158. robotic/rai-robotModels/pr2/meshes/head_pan_color.png +0 -0
  159. robotic/rai-robotModels/pr2/meshes/head_tilt.h5 +0 -0
  160. robotic/rai-robotModels/pr2/meshes/head_tilt_color.png +0 -0
  161. robotic/rai-robotModels/pr2/meshes/l_finger.h5 +0 -0
  162. robotic/rai-robotModels/pr2/meshes/l_finger_color.png +0 -0
  163. robotic/rai-robotModels/pr2/meshes/l_finger_tip.h5 +0 -0
  164. robotic/rai-robotModels/pr2/meshes/l_finger_tip_color.png +0 -0
  165. robotic/rai-robotModels/pr2/meshes/shoulder_lift.h5 +0 -0
  166. robotic/rai-robotModels/pr2/meshes/shoulder_lift_color.png +0 -0
  167. robotic/rai-robotModels/pr2/meshes/shoulder_pan.h5 +0 -0
  168. robotic/rai-robotModels/pr2/meshes/shoulder_pan_color.png +0 -0
  169. robotic/rai-robotModels/pr2/meshes/tilting_hokuyo.h5 +0 -0
  170. robotic/rai-robotModels/pr2/meshes/tilting_hokuyo_color.png +0 -0
  171. robotic/rai-robotModels/pr2/meshes/torso_lift.h5 +0 -0
  172. robotic/rai-robotModels/pr2/meshes/torso_lift_color.png +0 -0
  173. robotic/rai-robotModels/pr2/meshes/upper_arm.h5 +0 -0
  174. robotic/rai-robotModels/pr2/meshes/upper_arm_color.png +0 -0
  175. robotic/rai-robotModels/pr2/meshes/upper_arm_roll.h5 +0 -0
  176. robotic/rai-robotModels/pr2/meshes/upper_arm_roll_color.png +0 -0
  177. robotic/rai-robotModels/pr2/meshes/wheel.h5 +0 -0
  178. robotic/rai-robotModels/pr2/meshes/wheel_color.png +0 -0
  179. robotic/rai-robotModels/pr2/meshes/wrist_color.png +0 -0
  180. robotic/rai-robotModels/pr2/meshes/wrist_flex.h5 +0 -0
  181. robotic/rai-robotModels/pr2/meshes/wrist_roll.h5 +0 -0
  182. robotic/rai-robotModels/pr2/pr2.g +12 -12
  183. robotic/rai-robotModels/pr2/pr2_clean.g +122 -118
  184. robotic/rai-robotModels/pr2/pr2_conv.g +218 -0
  185. robotic/rai-robotModels/pr2/pr2_modifications.g +2 -2
  186. robotic/rai-robotModels/ranger/meshes/ranger_mini3.h5 +0 -0
  187. robotic/rai-robotModels/ranger/meshes/ranger_mini_v3_wheel.h5 +0 -0
  188. robotic/rai-robotModels/ranger/meshes/ranger_mini_v3_wheel_right.h5 +0 -0
  189. robotic/rai-robotModels/ranger/ranger.g +33 -0
  190. robotic/rai-robotModels/ranger/ranger_clean.g +18 -0
  191. robotic/rai-robotModels/ranger/ranger_mini_conv.g +14 -0
  192. robotic/rai-robotModels/robotiq/meshes/robotiq_arg2f_85_base_link.h5 +0 -0
  193. robotic/rai-robotModels/robotiq/meshes/robotiq_arg2f_85_inner_finger.h5 +0 -0
  194. robotic/rai-robotModels/robotiq/meshes/robotiq_arg2f_85_inner_knuckle.h5 +0 -0
  195. robotic/rai-robotModels/robotiq/meshes/robotiq_arg2f_85_outer_finger.h5 +0 -0
  196. robotic/rai-robotModels/robotiq/meshes/robotiq_arg2f_85_outer_knuckle.h5 +0 -0
  197. robotic/rai-robotModels/robotiq/robotiq.g +2 -2
  198. robotic/rai-robotModels/robotiq/robotiq_arg2f_85_model_conv.yml +19 -0
  199. robotic/rai-robotModels/robotiq/robotiq_clean.g +16 -16
  200. robotic/rai-robotModels/scenarios/ballFinger.g +2 -2
  201. robotic/rai-robotModels/scenarios/liftRing.g +2 -2
  202. robotic/rai-robotModels/scenarios/pandaFloatingGripper.g +1 -1
  203. robotic/rai-robotModels/scenarios/pandaSingle.g +1 -1
  204. robotic/rai-robotModels/scenarios/panda_fixRobotiq.g +3 -3
  205. robotic/rai-robotModels/tests/arm.g +18 -19
  206. robotic/rai-robotModels/tests/compound.g +3 -6
  207. robotic/rai-robotModels/ur10/meshes/base.h5 +0 -0
  208. robotic/rai-robotModels/ur10/meshes/forearm.h5 +0 -0
  209. robotic/rai-robotModels/ur10/meshes/shoulder.h5 +0 -0
  210. robotic/rai-robotModels/ur10/meshes/upperarm.h5 +0 -0
  211. robotic/rai-robotModels/ur10/meshes/wrist1.h5 +0 -0
  212. robotic/rai-robotModels/ur10/meshes/wrist2.h5 +0 -0
  213. robotic/rai-robotModels/ur10/meshes/wrist3.h5 +0 -0
  214. robotic/rai-robotModels/ur10/ur10.g +2 -2
  215. robotic/rai-robotModels/ur10/ur10_clean.g +8 -8
  216. robotic/rai-robotModels/ur10/ur10_conv.g +17 -0
  217. robotic/ry-h5info +3 -8
  218. robotic/ry-test +6 -5
  219. robotic/ry-urdfConvert.py +74 -0
  220. robotic/ry-view +28 -6
  221. robotic/src/__init__.py +0 -0
  222. robotic/src/cleanMeshes.py +59 -0
  223. robotic/src/h5_helper.py +46 -0
  224. robotic/src/h5_helper.py~ +42 -0
  225. robotic/src/mesh_helper.py +395 -0
  226. robotic/src/meshlabFilters.mlx +20 -0
  227. robotic/src/mujoco_io.py +242 -0
  228. robotic/src/urdf_io.py +237 -0
  229. robotic/src/yaml_helper.py +29 -0
  230. robotic/version.py +1 -1
  231. {robotic-0.2.8.dev4.data → robotic-0.3.4.dev5.data}/scripts/ry-h5info +3 -8
  232. {robotic-0.2.8.dev4.data → robotic-0.3.4.dev5.data}/scripts/ry-test +6 -5
  233. robotic-0.3.4.dev5.data/scripts/ry-urdfConvert.py +74 -0
  234. robotic-0.3.4.dev5.data/scripts/ry-view +46 -0
  235. {robotic-0.2.8.dev4.dist-info → robotic-0.3.4.dev5.dist-info}/METADATA +20 -23
  236. robotic-0.3.4.dev5.dist-info/RECORD +386 -0
  237. {robotic-0.2.8.dev4.dist-info → robotic-0.3.4.dev5.dist-info}/WHEEL +1 -1
  238. robotic/nlp.py +0 -113
  239. robotic/rai-robotModels/baxter/baxter.g +0 -49
  240. robotic/rai-robotModels/baxter/baxter_clean.g +0 -116
  241. robotic/rai-robotModels/baxter/baxter_clean2.g +0 -205
  242. robotic/rai-robotModels/baxter/baxter_clean3.g +0 -223
  243. robotic/rai-robotModels/baxter/baxter_description/meshes/base/PEDESTAL.ply +0 -0
  244. robotic/rai-robotModels/baxter/baxter_description/meshes/base/pedestal_link_collision.ply +0 -0
  245. robotic/rai-robotModels/baxter/baxter_description/meshes/head/H0.ply +0 -0
  246. robotic/rai-robotModels/baxter/baxter_description/meshes/head/H1.ply +0 -0
  247. robotic/rai-robotModels/baxter/baxter_description/meshes/lower_elbow/E1.ply +0 -0
  248. robotic/rai-robotModels/baxter/baxter_description/meshes/lower_forearm/W1.ply +0 -0
  249. robotic/rai-robotModels/baxter/baxter_description/meshes/lower_shoulder/S1.ply +0 -0
  250. robotic/rai-robotModels/baxter/baxter_description/meshes/torso/base_link.ply +0 -0
  251. robotic/rai-robotModels/baxter/baxter_description/meshes/torso/base_link_collision.ply +0 -0
  252. robotic/rai-robotModels/baxter/baxter_description/meshes/upper_elbow/E0.ply +0 -0
  253. robotic/rai-robotModels/baxter/baxter_description/meshes/upper_forearm/W0.ply +0 -0
  254. robotic/rai-robotModels/baxter/baxter_description/meshes/upper_shoulder/S0.ply +0 -0
  255. robotic/rai-robotModels/baxter/baxter_description/meshes/wrist/W2.ply +0 -0
  256. robotic/rai-robotModels/baxter/baxter_new.g +0 -53
  257. robotic/rai-robotModels/baxter/rethink_ee_description/meshes/electric_gripper/electric_gripper_base.ply +0 -0
  258. robotic/rai-robotModels/baxter/rethink_ee_description/meshes/electric_gripper/fingers/extended_narrow.ply +0 -0
  259. robotic/rai-robotModels/baxter/rethink_ee_description/meshes/electric_gripper/fingers/half_round_tip.ply +0 -0
  260. robotic/rai-robotModels/baxter/rethink_ee_description/meshes/electric_gripper/fingers/paddle_tip.ply +0 -0
  261. robotic/rai-robotModels/baxter/rethink_ee_description/meshes/pneumatic_gripper/pneumatic_gripper_base.ply +0 -0
  262. robotic/rai-robotModels/baxter/rethink_ee_description/meshes/pneumatic_gripper/pneumatic_gripper_w_cup.ply +0 -0
  263. robotic/rai-robotModels/g1/meshes/head_link.ply +0 -0
  264. robotic/rai-robotModels/g1/meshes/left_ankle_pitch_link.ply +0 -0
  265. robotic/rai-robotModels/g1/meshes/left_ankle_roll_link.ply +0 -0
  266. robotic/rai-robotModels/g1/meshes/left_elbow_link.ply +0 -0
  267. robotic/rai-robotModels/g1/meshes/left_hand_index_0_link.ply +0 -0
  268. robotic/rai-robotModels/g1/meshes/left_hand_index_1_link.ply +0 -0
  269. robotic/rai-robotModels/g1/meshes/left_hand_middle_0_link.ply +0 -0
  270. robotic/rai-robotModels/g1/meshes/left_hand_middle_1_link.ply +0 -0
  271. robotic/rai-robotModels/g1/meshes/left_hand_palm_link.ply +0 -0
  272. robotic/rai-robotModels/g1/meshes/left_hand_thumb_0_link.ply +0 -0
  273. robotic/rai-robotModels/g1/meshes/left_hand_thumb_1_link.ply +0 -0
  274. robotic/rai-robotModels/g1/meshes/left_hand_thumb_2_link.ply +0 -0
  275. robotic/rai-robotModels/g1/meshes/left_hip_pitch_link.ply +0 -0
  276. robotic/rai-robotModels/g1/meshes/left_hip_roll_link.ply +0 -0
  277. robotic/rai-robotModels/g1/meshes/left_hip_yaw_link.ply +0 -0
  278. robotic/rai-robotModels/g1/meshes/left_knee_link.ply +0 -0
  279. robotic/rai-robotModels/g1/meshes/left_rubber_hand.ply +0 -0
  280. robotic/rai-robotModels/g1/meshes/left_shoulder_pitch_link.ply +0 -0
  281. robotic/rai-robotModels/g1/meshes/left_shoulder_roll_link.ply +0 -0
  282. robotic/rai-robotModels/g1/meshes/left_shoulder_yaw_link.ply +0 -0
  283. robotic/rai-robotModels/g1/meshes/left_wrist_pitch_link.ply +0 -0
  284. robotic/rai-robotModels/g1/meshes/left_wrist_roll_link.ply +0 -0
  285. robotic/rai-robotModels/g1/meshes/left_wrist_roll_rubber_hand.ply +0 -0
  286. robotic/rai-robotModels/g1/meshes/left_wrist_yaw_link.ply +0 -0
  287. robotic/rai-robotModels/g1/meshes/logo_link.ply +0 -0
  288. robotic/rai-robotModels/g1/meshes/pelvis.ply +0 -0
  289. robotic/rai-robotModels/g1/meshes/pelvis_contour_link.ply +0 -0
  290. robotic/rai-robotModels/g1/meshes/right_ankle_pitch_link.ply +0 -0
  291. robotic/rai-robotModels/g1/meshes/right_ankle_roll_link.ply +0 -0
  292. robotic/rai-robotModels/g1/meshes/right_elbow_link.ply +0 -0
  293. robotic/rai-robotModels/g1/meshes/right_hand_index_0_link.ply +0 -0
  294. robotic/rai-robotModels/g1/meshes/right_hand_index_1_link.ply +0 -0
  295. robotic/rai-robotModels/g1/meshes/right_hand_middle_0_link.ply +0 -0
  296. robotic/rai-robotModels/g1/meshes/right_hand_middle_1_link.ply +0 -0
  297. robotic/rai-robotModels/g1/meshes/right_hand_palm_link.ply +0 -0
  298. robotic/rai-robotModels/g1/meshes/right_hand_thumb_0_link.ply +0 -0
  299. robotic/rai-robotModels/g1/meshes/right_hand_thumb_1_link.ply +0 -0
  300. robotic/rai-robotModels/g1/meshes/right_hand_thumb_2_link.ply +0 -0
  301. robotic/rai-robotModels/g1/meshes/right_hip_pitch_link.ply +0 -0
  302. robotic/rai-robotModels/g1/meshes/right_hip_roll_link.ply +0 -0
  303. robotic/rai-robotModels/g1/meshes/right_hip_yaw_link.ply +0 -0
  304. robotic/rai-robotModels/g1/meshes/right_knee_link.ply +0 -0
  305. robotic/rai-robotModels/g1/meshes/right_rubber_hand.ply +0 -0
  306. robotic/rai-robotModels/g1/meshes/right_shoulder_pitch_link.ply +0 -0
  307. robotic/rai-robotModels/g1/meshes/right_shoulder_roll_link.ply +0 -0
  308. robotic/rai-robotModels/g1/meshes/right_shoulder_yaw_link.ply +0 -0
  309. robotic/rai-robotModels/g1/meshes/right_wrist_pitch_link.ply +0 -0
  310. robotic/rai-robotModels/g1/meshes/right_wrist_roll_link.ply +0 -0
  311. robotic/rai-robotModels/g1/meshes/right_wrist_roll_rubber_hand.ply +0 -0
  312. robotic/rai-robotModels/g1/meshes/right_wrist_yaw_link.ply +0 -0
  313. robotic/rai-robotModels/g1/meshes/torso_constraint_L_link.ply +0 -0
  314. robotic/rai-robotModels/g1/meshes/torso_constraint_L_rod_link.ply +0 -0
  315. robotic/rai-robotModels/g1/meshes/torso_constraint_R_link.ply +0 -0
  316. robotic/rai-robotModels/g1/meshes/torso_constraint_R_rod_link.ply +0 -0
  317. robotic/rai-robotModels/g1/meshes/torso_link.ply +0 -0
  318. robotic/rai-robotModels/g1/meshes/waist_constraint_L.ply +0 -0
  319. robotic/rai-robotModels/g1/meshes/waist_constraint_R.ply +0 -0
  320. robotic/rai-robotModels/g1/meshes/waist_roll_link.ply +0 -0
  321. robotic/rai-robotModels/g1/meshes/waist_support_link.ply +0 -0
  322. robotic/rai-robotModels/g1/meshes/waist_yaw_link.ply +0 -0
  323. robotic/rai-robotModels/panda/franka_description/meshes/collision/finger.stl +0 -0
  324. robotic/rai-robotModels/panda/franka_description/meshes/collision/hand.stl +0 -0
  325. robotic/rai-robotModels/panda/franka_description/meshes/collision/link0.stl +0 -0
  326. robotic/rai-robotModels/panda/franka_description/meshes/collision/link1.stl +0 -0
  327. robotic/rai-robotModels/panda/franka_description/meshes/collision/link2.stl +0 -0
  328. robotic/rai-robotModels/panda/franka_description/meshes/collision/link3.stl +0 -0
  329. robotic/rai-robotModels/panda/franka_description/meshes/collision/link4.stl +0 -0
  330. robotic/rai-robotModels/panda/franka_description/meshes/collision/link5.stl +0 -0
  331. robotic/rai-robotModels/panda/franka_description/meshes/collision/link6.stl +0 -0
  332. robotic/rai-robotModels/panda/franka_description/meshes/collision/link7.stl +0 -0
  333. robotic/rai-robotModels/panda/franka_description/meshes/visual/HOWTO.sh +0 -10
  334. robotic/rai-robotModels/panda/franka_description/meshes/visual/HOWTO2.sh +0 -7
  335. robotic/rai-robotModels/panda/franka_description/meshes/visual/convMeshes.mlx +0 -38
  336. robotic/rai-robotModels/panda/franka_description/meshes/visual/finger.ply +0 -0
  337. robotic/rai-robotModels/panda/franka_description/meshes/visual/hand.ply +0 -0
  338. robotic/rai-robotModels/panda/franka_description/meshes/visual/link0.ply +0 -0
  339. robotic/rai-robotModels/panda/franka_description/meshes/visual/link1.ply +0 -0
  340. robotic/rai-robotModels/panda/franka_description/meshes/visual/link2.ply +0 -0
  341. robotic/rai-robotModels/panda/franka_description/meshes/visual/link3.ply +0 -0
  342. robotic/rai-robotModels/panda/franka_description/meshes/visual/link4.ply +0 -0
  343. robotic/rai-robotModels/panda/franka_description/meshes/visual/link5.ply +0 -0
  344. robotic/rai-robotModels/panda/franka_description/meshes/visual/link6.ply +0 -0
  345. robotic/rai-robotModels/panda/franka_description/meshes/visual/link7.ply +0 -0
  346. robotic/rai-robotModels/panda/franka_description/meshes/visual/script.mlx +0 -28
  347. robotic/rai-robotModels/pr2/pr2_description/meshes/base_v0/base.ply +0 -0
  348. robotic/rai-robotModels/pr2/pr2_description/meshes/base_v0/base_L.ply +0 -0
  349. robotic/rai-robotModels/pr2/pr2_description/meshes/base_v0/caster.ply +0 -0
  350. robotic/rai-robotModels/pr2/pr2_description/meshes/base_v0/caster_L.ply +0 -0
  351. robotic/rai-robotModels/pr2/pr2_description/meshes/base_v0/pr2_wheel.ply +0 -0
  352. robotic/rai-robotModels/pr2/pr2_description/meshes/base_v0/wheel.ply +0 -0
  353. robotic/rai-robotModels/pr2/pr2_description/meshes/forearm_v0/forearm.ply +0 -0
  354. robotic/rai-robotModels/pr2/pr2_description/meshes/forearm_v0/wrist_flex.ply +0 -0
  355. robotic/rai-robotModels/pr2/pr2_description/meshes/forearm_v0/wrist_roll.ply +0 -0
  356. robotic/rai-robotModels/pr2/pr2_description/meshes/forearm_v0/wrist_roll_L.ply +0 -0
  357. robotic/rai-robotModels/pr2/pr2_description/meshes/gripper_v0/gripper_palm.ply +0 -0
  358. robotic/rai-robotModels/pr2/pr2_description/meshes/gripper_v0/l_finger.ply +0 -0
  359. robotic/rai-robotModels/pr2/pr2_description/meshes/gripper_v0/l_finger_tip.ply +0 -0
  360. robotic/rai-robotModels/pr2/pr2_description/meshes/head_v0/head_pan.ply +0 -0
  361. robotic/rai-robotModels/pr2/pr2_description/meshes/head_v0/head_pan_L.ply +0 -0
  362. robotic/rai-robotModels/pr2/pr2_description/meshes/head_v0/head_tilt.ply +0 -0
  363. robotic/rai-robotModels/pr2/pr2_description/meshes/head_v0/head_tilt_L.ply +0 -0
  364. robotic/rai-robotModels/pr2/pr2_description/meshes/shoulder_v0/shoulder_lift.ply +0 -0
  365. robotic/rai-robotModels/pr2/pr2_description/meshes/shoulder_v0/shoulder_pan.ply +0 -0
  366. robotic/rai-robotModels/pr2/pr2_description/meshes/shoulder_v0/shoulder_yaw.ply +0 -0
  367. robotic/rai-robotModels/pr2/pr2_description/meshes/shoulder_v0/upper_arm_roll.ply +0 -0
  368. robotic/rai-robotModels/pr2/pr2_description/meshes/shoulder_v0/upper_arm_roll_L.ply +0 -0
  369. robotic/rai-robotModels/pr2/pr2_description/meshes/tilting_laser_v0/hok_tilt.ply +0 -0
  370. robotic/rai-robotModels/pr2/pr2_description/meshes/tilting_laser_v0/tilting_hokuyo.ply +0 -0
  371. robotic/rai-robotModels/pr2/pr2_description/meshes/tilting_laser_v0/tilting_hokuyo_L.ply +0 -0
  372. robotic/rai-robotModels/pr2/pr2_description/meshes/torso_v0/torso.ply +0 -0
  373. robotic/rai-robotModels/pr2/pr2_description/meshes/torso_v0/torso_lift.ply +0 -0
  374. robotic/rai-robotModels/pr2/pr2_description/meshes/torso_v0/torso_lift_L.ply +0 -0
  375. robotic/rai-robotModels/pr2/pr2_description/meshes/upper_arm_v0/elbow_flex.ply +0 -0
  376. robotic/rai-robotModels/pr2/pr2_description/meshes/upper_arm_v0/forearm_roll.ply +0 -0
  377. robotic/rai-robotModels/pr2/pr2_description/meshes/upper_arm_v0/forearm_roll_L.ply +0 -0
  378. robotic/rai-robotModels/pr2/pr2_description/meshes/upper_arm_v0/upper_arm.ply +0 -0
  379. robotic/rai-robotModels/robotiq/meshes/visual/robotiq_arg2f_85_base_link.ply +0 -0
  380. robotic/rai-robotModels/robotiq/meshes/visual/robotiq_arg2f_85_base_link_x.ply +0 -10
  381. robotic/rai-robotModels/robotiq/meshes/visual/robotiq_arg2f_85_inner_finger.ply +0 -0
  382. robotic/rai-robotModels/robotiq/meshes/visual/robotiq_arg2f_85_inner_knuckle.ply +0 -0
  383. robotic/rai-robotModels/robotiq/meshes/visual/robotiq_arg2f_85_outer_finger.ply +0 -0
  384. robotic/rai-robotModels/robotiq/meshes/visual/robotiq_arg2f_85_outer_knuckle.ply +0 -0
  385. robotic/rai-robotModels/robotiq/meshes/visual/robotiq_arg2f_85_pad.ply +0 -0
  386. robotic/rai-robotModels/robotiq/meshes/visual/robotiq_gripper_coupling.ply +0 -0
  387. robotic/rai-robotModels/ur10/ur_description/meshes/ur10/visual/Base.ply +0 -0
  388. robotic/rai-robotModels/ur10/ur_description/meshes/ur10/visual/Forearm.ply +0 -0
  389. robotic/rai-robotModels/ur10/ur_description/meshes/ur10/visual/Shoulder.ply +0 -0
  390. robotic/rai-robotModels/ur10/ur_description/meshes/ur10/visual/UpperArm.ply +0 -0
  391. robotic/rai-robotModels/ur10/ur_description/meshes/ur10/visual/Wrist1.ply +0 -0
  392. robotic/rai-robotModels/ur10/ur_description/meshes/ur10/visual/Wrist2.ply +0 -0
  393. robotic/rai-robotModels/ur10/ur_description/meshes/ur10/visual/Wrist3.ply +0 -0
  394. robotic/ry-urdf2rai +0 -222
  395. robotic/ry-urdf2yaml +0 -250
  396. robotic-0.2.8.dev4.data/scripts/ry-urdf2rai +0 -222
  397. robotic-0.2.8.dev4.data/scripts/ry-urdf2yaml +0 -250
  398. robotic-0.2.8.dev4.data/scripts/ry-view +0 -24
  399. robotic-0.2.8.dev4.dist-info/RECORD +0 -413
  400. /robotic/include/rai/{Geo → Algo}/Lewiner/LookUpTable.h +0 -0
  401. /robotic/include/rai/Geo/{assimpInterface.h → i_assimp.h} +0 -0
  402. /robotic/include/rai/Kin/{kin_bullet.h → i_Bullet.h} +0 -0
  403. /robotic/include/rai/Kin/{kin_feather.h → i_Feather.h} +0 -0
  404. /robotic/include/rai/Kin/{kin_ode.h → i_Ode.h} +0 -0
  405. /robotic/include/rai/Optim/{opt-ipopt.h → i_Ipopt.h} +0 -0
  406. /robotic/rai-robotModels/robotiq/meshes/{visual/robotiq_ft300.ply → robotiq_ft300.ply} +0 -0
  407. {robotic-0.2.8.dev4.data → robotic-0.3.4.dev5.data}/scripts/ry-bot +0 -0
  408. {robotic-0.2.8.dev4.data → robotic-0.3.4.dev5.data}/scripts/ry-info +0 -0
  409. {robotic-0.2.8.dev4.data → robotic-0.3.4.dev5.data}/scripts/ry-meshTool +0 -0
  410. {robotic-0.2.8.dev4.dist-info → robotic-0.3.4.dev5.dist-info/licenses}/LICENSE +0 -0
  411. {robotic-0.2.8.dev4.dist-info → robotic-0.3.4.dev5.dist-info}/top_level.txt +0 -0
@@ -38,9 +38,6 @@ struct Serializable {
38
38
  namespace rai {
39
39
 
40
40
  //struct FileToken;
41
- struct SparseVector;
42
- struct SparseMatrix;
43
- struct RowShifted;
44
41
 
45
42
  // OLD, TODO: hide -> array.cpp
46
43
  extern bool useLapack;
@@ -66,6 +63,7 @@ extern const char* arrayBrackets;
66
63
 
67
64
  namespace rai {
68
65
 
66
+ #if 0
69
67
  /** Simple array container to store arbitrary-dimensional arrays (tensors).
70
68
  Can buffer more memory than necessary for faster
71
69
  resize; enables non-const reference of subarrays; enables fast
@@ -105,7 +103,7 @@ struct ArrayDouble : public Array<double> {
105
103
  using Array<double>::elem; //adopt all elem(..) methods
106
104
  double& elem(int i, int j); //access that also handles sparse matrices
107
105
  using Array<double>::operator(); //adopt all double& operator()(..) methods
108
- ArrayDouble operator()(std::pair<int, int> I) const { ArrayDouble z; z.referToRange(*this, I.first, I.second); return z; }
106
+ ArrayDouble operator()(std::pair<int, int> I) const { ArrayDouble z; z.referToRange(*this, I.first, I.second+1); return z; }
109
107
  ArrayDouble operator()(int i, std::pair<int, int> J) const { ArrayDouble z; z.referToRange(*this, i, J.first, J.second); return z; }
110
108
  ArrayDouble operator()(int i, int j, std::initializer_list<int> K) const;
111
109
  ArrayDouble operator[](int i) const { ArrayDouble z; z.referToDim(*this, i); return z; }
@@ -147,11 +145,10 @@ struct ArrayDouble : public Array<double> {
147
145
 
148
146
  void write(std::ostream& os=stdCout(), const char* ELEMSEP=nullptr, const char* LINESEP=nullptr, const char* BRACKETS=nullptr, bool dimTag=false, bool binary=false) const;
149
147
  };
148
+ #endif
150
149
 
151
150
  }
152
151
 
153
- typedef rai::ArrayDouble arr;
154
-
155
152
  //===========================================================================
156
153
  ///
157
154
  /// @name alternative iterators
@@ -287,12 +284,24 @@ arr& getNoArr();
287
284
  /// @{
288
285
 
289
286
  /// a generic vector-valued function \f$f:~x\mapsto y\in\mathbb{R}^d\f$, where return value may have Jacobian attached
290
- typedef std::function<arr(const arr& x)> fct;
287
+ // typedef std::function<arr(const arr& x)> fct;
291
288
  typedef std::function<arr(const arr& x)> VectorFunction;
292
-
293
- /// a scalar function \f$f:~x\mapsto y\in\mathbb{R}\f$ with optional gradient and hessian
294
289
  typedef std::function<double(arr& g, arr& H, const arr& x)> ScalarFunction;
295
290
 
291
+ // /// a scalar function \f$f:~x\mapsto y\in\mathbb{R}\f$ with optional gradient and hessian
292
+ // struct ScalarFunction {
293
+ // uint dim;
294
+ // virtual double f(arr& g, arr& H, const arr& x) = 0;
295
+ // virtual ~ScalarFunction() {}
296
+ // std::function<double(const arr& x)> cfunc(){ return [this](const arr& x){ return this->f(NoArr, NoArr, x); }; }
297
+ // };
298
+
299
+ // struct Conv_cfunc2ScalarFunction : ScalarFunction {
300
+ // std::function<double(arr& g, arr& H, const arr& x)> cfunc;
301
+ // Conv_cfunc2ScalarFunction(std::function<double(arr& g, arr& H, const arr& x)> _cfunc) : cfunc(_cfunc) {}
302
+ // double f(arr& g, arr& H, const arr& x){ return cfunc(g, H, x); }
303
+ // };
304
+
296
305
  /// a kernel function
297
306
  struct KernelFunction {
298
307
  virtual double k(const arr& x1, const arr& x2, arr& g1=NoArr, arr& Hx1=NoArr) = 0;
@@ -328,7 +337,7 @@ inline arr zeros(uint d0, uint d1) { return zeros(uintA{d0, d1}); }
328
337
  inline arr zeros(uint d0, uint d1, uint d2) { return zeros(uintA{d0, d1, d2}); }
329
338
 
330
339
  /// return array of c's
331
- inline arr consts(const double& c, const uintA& d) { arr z; z.resize(d); z.setUni(c); return z; }
340
+ inline arr consts(const double& c, const uintA& d) { arr z; z.resize(d); z.setConst(c); return z; }
332
341
  /// return VECTOR of c's
333
342
  inline arr consts(const double& c, uint n) { return consts(c, uintA{n}); }
334
343
  /// return matrix of c's
@@ -357,16 +366,15 @@ inline arr randn(uint d0, uint d1) { return randn(uintA{d0, d1}); }
357
366
 
358
367
  /// return a grid with different lo/hi/steps in each dimension
359
368
  arr grid(const arr& lo, const arr& hi, const uintA& steps);
360
- /// return a grid (1D: range) split in 'steps' steps
361
- inline arr grid(uint dim, double lo, double hi, uint steps) { arr g; g.setGrid(dim, lo, hi, steps); return g; }
362
369
  /// return a 1D-grid
363
- inline arr range(double lo, double hi, uint steps) { arr g; g.setGrid(1, lo, hi, steps).reshape(-1); return g; }
370
+ inline arr range(double lo, double hi, uint steps) { return rai::grid(1, lo, hi, steps).reshape(-1); }
364
371
  //inline uintA range(uint n) { uintA r; r.setStraightPerm(n); return r; }
365
372
 
366
373
  arr repmat(const arr& A, uint m, uint n);
374
+ arr match(const arr& A, const uintA& shape);
367
375
 
368
376
  //inline uintA randperm(uint n) { uintA z; z.setRandomPerm(n); return z; }
369
- inline arr linspace(double base, double limit, uint n) { arr z; z.setGrid(1, base, limit, n).reshape(-1); return z; }
377
+ inline arr linspace(double base, double limit, uint n) { return rai::grid(1, base, limit, n).reshape(-1); }
370
378
  arr logspace(double base, double limit, uint n);
371
379
 
372
380
  void normalizeWithJac(arr& y, arr& J, double eps=0.);
@@ -431,11 +439,13 @@ arr reshapeColor(const arr& col, int d0=-1);
431
439
 
432
440
  void scanArrFile(const char* name);
433
441
 
434
- arr finiteDifferenceGradient(const ScalarFunction& f, const arr& x, arr& Janalytic=NoArr);
435
- arr finiteDifferenceJacobian(const VectorFunction& f, const arr& _x, arr& Janalytic=NoArr);
436
- bool checkGradient(const ScalarFunction& f, const arr& x, double tolerance, bool verbose=false);
437
- bool checkHessian(const ScalarFunction& f, const arr& x, double tolerance, bool verbose=false);
438
- bool checkJacobian(const VectorFunction& f, const arr& x, double tolerance, bool verbose=false, const StringA& featureNames= {});
442
+ arr finiteDifference_gradient(ScalarFunction f, const arr& x0, double y0, double eps=1e-8);
443
+ arr finiteDifference_jacobian(VectorFunction f, const arr& x0, const arr& y0, double eps=1e-8);
444
+ // arr finiteDifferenceGradient(ScalarFunction f, const arr& x, arr& Janalytic=NoArr, double eps=1e-8);
445
+ // arr finiteDifferenceJacobian(VectorFunction f, const arr& _x, arr& Janalytic=NoArr, double eps=1e-8);
446
+ bool checkGradient(ScalarFunction f, const arr& x, double tolerance, bool verbose=false);
447
+ bool checkHessian(ScalarFunction f, const arr& x, double tolerance, bool verbose=false);
448
+ bool checkJacobian(VectorFunction f, const arr& x, double tolerance, bool verbose=false, const StringA& featureNames= {});
439
449
  void boundClip(arr& y, const arr& bounds);
440
450
  bool boundCheck(const arr& x, const arr& bounds, double eps=1e-3, bool verbose=true);
441
451
 
@@ -488,10 +498,8 @@ double euclideanDistance(const arr& v, const arr& w);
488
498
  double metricDistance(const arr& g, const arr& v, const arr& w);
489
499
 
490
500
  //min max
491
- double min(const arr& x);
492
- double max(const arr& x);
493
- arr max(const arr& v, uint d);
494
- arr min(const arr& v, uint d);
501
+ arr max(const arr& v, uint axis);
502
+ arr min(const arr& v, uint axis);
495
503
  uint argmin(const arr& x);
496
504
  uint argmax(const arr& x);
497
505
  void argmax(uint& i, uint& j, const arr& x);
@@ -501,7 +509,7 @@ double absMax(const arr& x);
501
509
  double absMin(const arr& x);
502
510
 
503
511
  double sum(const arr& v);
504
- arr sum(const arr& v, uint d);
512
+ arr sum(const arr& v, uint axis);
505
513
  double sumOfAbs(const arr& v);
506
514
  double sumOfPos(const arr& v);
507
515
  double sumOfSqr(const arr& v);
@@ -510,9 +518,9 @@ double product(const arr& v);
510
518
 
511
519
  double trace(const arr& v);
512
520
  double var(const arr& v);
513
- arr mean(const arr& v);
521
+ arr mean(const arr& v, uint axis=0);
514
522
  arr covar(const arr& X);
515
- arr stdDev(const arr& v);
523
+ arr vardiag(const arr& X);
516
524
  void clip(const arr& x, double lo, double hi);
517
525
 
518
526
  void op_transpose(arr& x, const arr& y);
@@ -612,6 +620,8 @@ inline bool isEmptyShape(const arr& X) { return X.special && X.special->type==
612
620
  inline bool isRowShifted(const arr& X) { return X.special && X.special->type==SpecialArray::RowShiftedST; }
613
621
  inline bool isSparseMatrix(const arr& X) { return X.special && X.special->type==SpecialArray::sparseMatrixST; }
614
622
  inline bool isSparseVector(const arr& X) { return X.special && X.special->type==SpecialArray::sparseVectorST; }
623
+ void special_copy(arr& x, const arr& a);
624
+ void special_write(ostream& os, const arr& x);
615
625
 
616
626
  struct RowShifted : SpecialArray {
617
627
  arr& Z; ///< references the array itself
@@ -45,21 +45,22 @@ typedef unsigned int uint;
45
45
  //
46
46
 
47
47
  //using std::cout;
48
- //using std::cerr;
49
48
  //using std::endl;
50
49
  using std::ostream;
51
50
  using std::istream;
52
51
  using std::ofstream;
53
52
  using std::ifstream;
54
53
 
54
+ namespace rai {
55
+
56
+ struct String;
57
+
55
58
  //===========================================================================
56
59
  //
57
60
  // enums
58
61
  //
59
62
 
60
- namespace rai {
61
63
  enum ArgWord { _left, _right, _sequence, _path, _xAxis, _yAxis, _zAxis, _xNegAxis, _yNegAxis, _zNegAxis };
62
- }
63
64
 
64
65
  //===========================================================================
65
66
 
@@ -84,9 +85,6 @@ struct Stepper {
84
85
  // logging
85
86
  //
86
87
 
87
- namespace rai {
88
- struct String;
89
-
90
88
  /// An object that represents a log file and/or cout logging, together with log levels read from a cfg file
91
89
  struct LogObject {
92
90
  std::ofstream* fil=0;
@@ -117,12 +115,12 @@ extern LogObject _log;
117
115
  const char* errString();
118
116
  String& errStringStream();
119
117
 
120
- }
121
-
122
118
  //----- parsing strings in a stream
123
119
  struct PARSE { const char* str; PARSE(const char* _str):str(_str) {} };
124
120
  std::istream& operator>>(std::istream& is, const PARSE&);
125
121
 
122
+ } //namespace
123
+
126
124
  //===========================================================================
127
125
  //
128
126
  // macros for LOG and CHECK
@@ -177,7 +175,7 @@ std::istream& operator>>(std::istream& is, const PARSE&);
177
175
  // macros to define the standard <<and >>operatos for most classes
178
176
  //
179
177
 
180
- #define stdInPipe(type)\
178
+ #define stdInPipe(type) \
181
179
  inline std::istream& operator>>(std::istream& is, type& x){ x.read(is); return is; }
182
180
  #define stdOutPipe(type)\
183
181
  inline std::ostream& operator<<(std::ostream& os, const type& x){ x.write(os); return os; }
@@ -25,6 +25,7 @@ struct Graph;
25
25
  struct ParseInfo;
26
26
  struct RenderingInfo;
27
27
  struct GraphEditCallback;
28
+ struct BracketOp;
28
29
  typedef Array<Node*> NodeL;
29
30
  typedef Array<GraphEditCallback*> GraphEditCallbackL;
30
31
  }
@@ -52,7 +53,6 @@ struct Node {
52
53
  void swapParent(uint i, Node* p);
53
54
 
54
55
  //-- get value
55
- //get() -> as()
56
56
  template<class T> bool is() const { return type==typeid(T); }
57
57
  template<class T> T& as() { T* x=getValue<T>(); CHECK(x, "this node '" <<*this <<"' is not of type '" <<typeid(T).name() <<"' but type '" <<type.name() <<"'"); return *x; }
58
58
  template<class T> const T& as() const { const T* x=getValue<T>(); CHECK(x, "this node '" <<*this <<"'is not of type '" <<typeid(T).name() <<"' but type '" <<type.name() <<"'"); return *x; }
@@ -60,10 +60,9 @@ struct Node {
60
60
 
61
61
  template<class T> T* getValue(); ///< query whether node type is equal to (or derived from) T, return the value if so
62
62
  template<class T> const T* getValue() const; ///< as above
63
- template<class T> std::shared_ptr<T> getPtr() const; ///< query whether node type is equal to (or derived from) shared_ptr<T>, return the shared_ptr if so
64
- template<class T> bool getFromDouble(T& x) const; ///< return value = false means parsing object of type T from the string failed
63
+ template<class T> bool getFromDouble(T& x) const; ///< return value = false means parsing object of type T from the double failed
65
64
  template<class T> bool getFromString(T& x) const; ///< return value = false means parsing object of type T from the string failed
66
- template<class T> bool getFromArr(T& x) const; ///< return value = false means parsing object of type T from the string failed
65
+ template<class T> bool getFromArr(T& x) const; ///< return value = false means parsing object of type T from the arr failed
67
66
  bool isBoolAndTrue() const { if(type!=typeid(bool)) return false; return *getValue<bool>() == true; }
68
67
  bool isBoolAndFalse() const { if(type!=typeid(bool)) return false; return *getValue<bool>() == false; }
69
68
 
@@ -81,12 +80,10 @@ struct Node {
81
80
  virtual void copyValue(Node*) {NIY}
82
81
  virtual bool hasEqualValue(Node*) {NIY}
83
82
  virtual void writeValue(std::ostream& os) const {NIY}
84
- // virtual void copyValueInto(void*) const {NIY}
85
83
  virtual Node* newClone(Graph& container) const {NIY}
86
84
  };
87
-
88
- inline std::istream& operator>>(std::istream& is, Node*& x) { HALT("prohibited"); return is; }
89
85
  stdOutPipe(Node)
86
+
90
87
  } //namespace
91
88
 
92
89
  //===========================================================================
@@ -120,7 +117,6 @@ struct Graph : NodeL {
120
117
  //-- adding nodes
121
118
  template<class T> Node_typed<T>* add(const char* key);
122
119
  template<class T> Node_typed<T>* add(const char* key, const T& x);
123
- template<class T> Node_typed<T>* add(const char* key, const T& x, const NodeL& parents);
124
120
  template<class T> Node_typed<T&>* addRef(const char* key, const T& x);
125
121
 
126
122
  //Node_typed<int>* add(const uintA& parentIdxs); ///< add 'vertex tupes' (like edges) where vertices are referred to by integers
@@ -134,12 +130,16 @@ struct Graph : NodeL {
134
130
  //-- basic node retrieval -- users should use the higher-level wrappers below
135
131
  Node* findNode(const char* key, bool recurseUp=false, bool recurseDown=false) const; ///< returns nullptr if not found
136
132
  NodeL findNodes(const char* key, bool recurseUp=false, bool recurseDown=false) const;
137
- Node* findNodeOfType(const std::type_info& type, const char* key, bool recurseUp=false, bool recurseDown=false) const;
138
- NodeL findNodesOfType(const std::type_info& type, const char* key, bool recurseUp=false, bool recurseDown=false) const;
133
+ Node* findNodeOfType(const std::type_info& type, const char* key=0, bool recurseUp=false, bool recurseDown=false) const;
134
+ NodeL findNodesOfType(const std::type_info& type, const char* key=0, bool recurseUp=false, bool recurseDown=false) const;
139
135
  NodeL findGraphNodesWithTag(const char* tag) const;
140
136
 
137
+ //
138
+ template<class T> Node* set(const char* key, const T& x){ Node* n = findNodeOfType(typeid(T), key); if(n) n->as<T>()=x; else n=add<T>(key, x); return n; }
139
+ Node* set(Node* _n){ Node* n = findNodeOfType(_n->type, _n->key); if(n) n->copyValue(_n); else n=_n->newClone(*this); return n; }
140
+
141
141
  //-- get nodes
142
- Node* operator[](const char* key) const { return findNode(key); } ///< returns nullptr if not found
142
+ BracketOp operator[](const char* key); ///< returns nullptr if not found
143
143
  Node* getNode(const char* key) const { return findNode(key); } ///< returns nullptr if not found
144
144
  Node* getEdge(Node* p1, Node* p2) const;
145
145
  Node* getEdge(const NodeL& parents) const;
@@ -185,10 +185,10 @@ struct Graph : NodeL {
185
185
  Node* readNode(std::istream& is, bool verbose, bool parseInfo); //used only internally..
186
186
  void readJson(std::istream& is);
187
187
  void writeJson(std::istream& is);
188
- void write(std::ostream& os=cout, const char* ELEMSEP=",\n", const char* BRACKETS=0, int indent=-1, bool yamlMode=false, bool binary=false) const;
188
+ void write(std::ostream& os=cout, const char* ELEMSEP="\n", const char* BRACKETS=0, int indent=-1, bool yamlMode=false, bool binary=false) const;
189
189
  void writeDot(std::ostream& os, bool withoutHeader=false, bool defaultEdges=false, int nodesOrEdges=0, int focusIndex=-1, bool subGraphsAsNodes=false);
190
190
  void writeHtml(std::ostream& os, std::istream& is);
191
- void writeYaml(std::ostream& os);
191
+ void writeYaml(std::ostream& os, bool classic = false) const;
192
192
  void writeParseInfo(std::ostream& os);
193
193
 
194
194
  void displayDot(Node* highlight=nullptr);
@@ -287,6 +287,21 @@ struct NodeInitializer {
287
287
  /// pipe node initializers into a graph (to append nodes)
288
288
  inline Graph& operator<<(Graph& G, const NodeInitializer& n) { G.addInit(n); return G; }
289
289
 
290
+ //===========================================================================
291
+
292
+ struct BracketOp {
293
+ Graph& G;
294
+ const char* key;
295
+ Node *n;
296
+ template<class T> void operator=(const T& x){
297
+ if(!n) n = G.add<T>(key, x);
298
+ else n->as<T>() = x;
299
+ }
300
+ Node* operator->() { return n; }
301
+ operator Node*() { return n; }
302
+ //T& operator->() { return *p; }
303
+ };
304
+
290
305
  //===========================================================================
291
306
  //
292
307
  // algorithms
@@ -369,12 +384,6 @@ struct Node_typed : Node {
369
384
  if(is<Graph>()) graph().isNodeOfGraph = this; //this is the only place where isNodeOfGraph is set
370
385
  }
371
386
 
372
- Node_typed(Graph& container, const char* key, const T& _value, const NodeL& parents)
373
- : Node(typeid(T), container, key), value(_value) {
374
- if(parents.N) setParents(parents);
375
- if(is<Graph>()) graph().isNodeOfGraph = this; //this is the only place where isNodeOfGraph is set
376
- }
377
-
378
387
  virtual ~Node_typed() {
379
388
  }
380
389
 
@@ -395,10 +404,6 @@ struct Node_typed : Node {
395
404
  else os <<value;
396
405
  }
397
406
 
398
- // virtual void copyValueInto(void* value_ptr) const {
399
- // *((T*)value_ptr) = value;
400
- // }
401
-
402
407
  virtual const std::type_info& getValueType() const {
403
408
  return typeid(T);
404
409
  }
@@ -409,7 +414,7 @@ struct Node_typed : Node {
409
414
  g.copy(graph());
410
415
  return g.isNodeOfGraph;
411
416
  }
412
- return container.add<T>(key, value, parents);
417
+ return container.add<T>(key, value)->setParents(parents);
413
418
  }
414
419
  };
415
420
  } //namespace
@@ -432,15 +437,6 @@ template<class T> const T* Node::getValue() const {
432
437
  return &typed->value;
433
438
  }
434
439
 
435
- template<class T> std::shared_ptr<T> Node::getPtr() const {
436
- NIY
437
- // std::shared_ptr<T> typed = std::dynamic_pointer_cast<T>(std::shared_ptr<T>(value_ptr));
438
- return std::shared_ptr<T>();
439
- // const Node_typed<std::shared_ptr<T>>* typed = dynamic_cast<const Node_typed<std::shared_ptr<T>>*>(this);
440
- // if(!typed) return nullptr;
441
- // return typed->value;
442
- }
443
-
444
440
  template<class T> bool Node::getFromDouble(T& x) const {
445
441
  if(!is<double>()) return false;
446
442
  double y = as<double>();
@@ -486,6 +482,10 @@ template<class T> NodeInitializer::NodeInitializer(const char* key, const String
486
482
  n = G.add<T>(key, x);
487
483
  }
488
484
 
485
+ inline BracketOp Graph::operator[](const char* key) {
486
+ return BracketOp{*this, key, findNode(key)};
487
+ }
488
+
489
489
  template<class T> T& Graph::get(const char* key) const {
490
490
  Node* n = findNodeOfType(typeid(T), key);
491
491
  if(!n) HALT("no node of type '" <<typeid(T).name() <<"' with key '"<< key<< "' found");
@@ -536,10 +536,6 @@ template<class T> Node_typed<T>* Graph::add(const char* key, const T& x) {
536
536
  return new Node_typed<T>(*this, key, x);
537
537
  }
538
538
 
539
- template<class T> Node_typed<T>* Graph::add(const char* key, const T& x, const NodeL& parents) {
540
- return new Node_typed<T>(*this, key, x, parents);
541
- }
542
-
543
539
  template<class T> Node_typed<T&>* Graph::addRef(const char* key, const T& x) {
544
540
  return new Node_typed<T&>(*this, key, (T&)x);
545
541
  }
@@ -23,6 +23,7 @@ struct H5_Writer {
23
23
  H5_Writer(const char* filename);
24
24
 
25
25
  template<class T> void add(const char* name, const rai::Array<T>& x);
26
+ void addDict(const char* name, const Graph& dict);
26
27
  void addGroup(const char* group);
27
28
  };
28
29
 
@@ -30,12 +31,13 @@ struct H5_Writer {
30
31
 
31
32
  struct H5_Reader {
32
33
  std::shared_ptr<H5::H5File> file;
33
- rai::Graph G;
34
34
  int verbose=0;
35
+ Graph G;
35
36
 
36
37
  H5_Reader(const char* filename);
37
38
  void readAll();
38
39
  template<class T> rai::Array<T> read(const char* name, bool ifExists=false);
40
+ Graph readDict(const char* name, bool ifExists=false);
39
41
  bool exists(const char* name);
40
42
  };
41
43
 
@@ -51,7 +51,7 @@ struct CallbackL : rai::Array<Callback<F>*> {
51
51
  struct RWLock {
52
52
  std::shared_timed_mutex rwLock;
53
53
  int rwCount=0; ///< -1==write locked, positive=numer of readers, 0=unlocked
54
- Mutex rwCountMutex;
54
+ rai::Mutex rwCountMutex;
55
55
  RWLock();
56
56
  ~RWLock();
57
57
  void readLock(); ///< multiple threads may request 'lock for read'
@@ -67,7 +67,7 @@ struct RWLock {
67
67
  //
68
68
 
69
69
  /// This RW lock counts revisions and broadcasts accesses to listeners; who is accessing can be logged; it has a unique name
70
- struct Var_base : NonCopyable {
70
+ struct Var_base : rai::NonCopyable {
71
71
  RWLock rwlock; ///< rwLock (handled via read/writeAccess)
72
72
  uint revision=0;
73
73
  rai::String name; ///< name
@@ -140,7 +140,7 @@ struct Var_data : Var_base {
140
140
 
141
141
  Var_data(const char* name=0) : Var_base(name), data() {} // default constructor for value always initializes, also primitive types 'bool' or 'int'
142
142
  ~Var_data() {
143
- if(rwlock.isLocked()) { cerr << "can't destroy a variable when it is currently accessed!" <<endl; exit(1); }
143
+ if(rwlock.isLocked()) { cout << "can't destroy a variable when it is currently accessed!" <<endl; exit(1); }
144
144
  }
145
145
  };
146
146
 
@@ -227,7 +227,7 @@ template<class T> std::ostream& operator<<(std::ostream& os, Var<T>& x) { x.writ
227
227
  /// a basic condition variable
228
228
  struct Signaler {
229
229
  int status;
230
- Mutex statusMutex;
230
+ rai::Mutex statusMutex;
231
231
  std::condition_variable cond;
232
232
 
233
233
  Signaler(int initialStatus=0);
@@ -240,13 +240,13 @@ struct Signaler {
240
240
  void statusLock(); //the user can manually lock/unlock, if he needs locked state access for longer -> use userHasLocked=true below!
241
241
  void statusUnlock();
242
242
 
243
- int getStatus(Mutex::Token* userHasLocked=0) const;
244
- bool waitForSignal(Mutex::Token* userHasLocked=0, double timeout=-1.);
245
- bool waitForEvent(std::function<bool()> f, Mutex::Token* userHasLocked=0);
246
- bool waitForStatusEq(int i, Mutex::Token* userHasLocked=0, double timeout=-1.); ///< return value is the state after the waiting
247
- int waitForStatusNotEq(int i, Mutex::Token* userHasLocked=0, double timeout=-1.); ///< return value is the state after the waiting
248
- int waitForStatusGreaterThan(int i, Mutex::Token* userHasLocked=0, double timeout=-1.); ///< return value is the state after the waiting
249
- int waitForStatusSmallerThan(int i, Mutex::Token* userHasLocked=0, double timeout=-1.); ///< return value is the state after the waiting
243
+ int getStatus(rai::Mutex::Token* userHasLocked=0) const;
244
+ bool waitForSignal(rai::Mutex::Token* userHasLocked=0, double timeout=-1.);
245
+ bool waitForEvent(std::function<bool()> f, rai::Mutex::Token* userHasLocked=0);
246
+ bool waitForStatusEq(int i, rai::Mutex::Token* userHasLocked=0, double timeout=-1.); ///< return value is the state after the waiting
247
+ int waitForStatusNotEq(int i, rai::Mutex::Token* userHasLocked=0, double timeout=-1.); ///< return value is the state after the waiting
248
+ int waitForStatusGreaterThan(int i, rai::Mutex::Token* userHasLocked=0, double timeout=-1.); ///< return value is the state after the waiting
249
+ int waitForStatusSmallerThan(int i, rai::Mutex::Token* userHasLocked=0, double timeout=-1.); ///< return value is the state after the waiting
250
250
  };
251
251
 
252
252
  //===========================================================================
@@ -331,7 +331,7 @@ struct Thread {
331
331
  rai::String name;
332
332
  std::unique_ptr<std::thread> thread; ///< the underlying pthread; nullptr iff not opened
333
333
  int tid; ///< system thread id
334
- Mutex stepMutex; ///< This is set whenever the 'main' is in step (or open, or close) --- use this in all service methods callable from outside!!
334
+ rai::Mutex stepMutex; ///< This is set whenever the 'main' is in step (or open, or close) --- use this in all service methods callable from outside!!
335
335
  uint step_count; ///< how often the step was called
336
336
  Metronome metronome; ///< used for beat-looping
337
337
  CycleTimer timer; ///< measure how the time spend per cycle, within step, idle