robotic 0.2.6__cp312-cp312-manylinux2014_x86_64.whl → 0.2.8.dev0__cp312-cp312-manylinux2014_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of robotic might be problematic. Click here for more details.

Files changed (57) hide show
  1. robotic/DataGen.pyi +5 -1
  2. robotic/_robotic.pyi +76 -25
  3. robotic/_robotic.so +0 -0
  4. robotic/include/rai/Control/CtrlTargets.h +3 -3
  5. robotic/include/rai/Core/array.h +3 -3
  6. robotic/include/rai/Core/arrayDouble.h +0 -3
  7. robotic/include/rai/DataGen/rndStableConfigs.h +0 -1
  8. robotic/include/rai/DataGen/shapenetGrasps.h +2 -0
  9. robotic/include/rai/Geo/mesh.h +1 -1
  10. robotic/include/rai/Geo/signedDistanceFunctions.h +1 -1
  11. robotic/include/rai/Gui/RenderData.h +2 -1
  12. robotic/include/rai/KOMO/komo.h +1 -0
  13. robotic/include/rai/KOMO/manipTools.h +12 -10
  14. robotic/include/rai/KOMO/{opt-benchmarks.h → testProblems_KOMO.h} +36 -0
  15. robotic/include/rai/Kin/F_geometrics.h +9 -0
  16. robotic/include/rai/Kin/featureSymbols.h +6 -1
  17. robotic/include/rai/Kin/frame.h +1 -1
  18. robotic/include/rai/Kin/kin.h +1 -0
  19. robotic/include/rai/Kin/simulation.h +1 -0
  20. robotic/include/rai/Kin/viewer.h +1 -1
  21. robotic/include/rai/LGP/LGP_Tool.h +6 -6
  22. robotic/include/rai/Optim/NLP_Sampler.h +4 -4
  23. robotic/include/rai/Optim/NLP_Solver.h +1 -0
  24. robotic/include/rai/Optim/SlackGaussNewton.h +54 -0
  25. robotic/include/rai/Optim/gradient.h +2 -2
  26. robotic/include/rai/Optim/opt-ipopt.h +1 -1
  27. robotic/include/rai/Optim/options.h +8 -7
  28. robotic/include/rai/Optim/{benchmarks.h → testProblems_Opt.h} +33 -16
  29. robotic/librai.so +0 -0
  30. robotic/manipulation.py +141 -145
  31. robotic/meshTool +0 -0
  32. robotic/rai-robotModels/panda/panda.g +3 -2
  33. robotic/rai-robotModels/scenarios/ballFinger.g +3 -3
  34. robotic/rai-robotModels/scenarios/mobilePanda.g +3 -0
  35. robotic/rai-robotModels/scenarios/pendulum.g +3 -2
  36. robotic/rai-robotModels/tests/arm.g +7 -7
  37. robotic/ry-h5info.py +28 -0
  38. robotic/version.py +1 -1
  39. {robotic-0.2.6.dist-info → robotic-0.2.8.dev0.dist-info}/METADATA +1 -1
  40. {robotic-0.2.6.dist-info → robotic-0.2.8.dev0.dist-info}/RECORD +51 -55
  41. robotic/include/rai/MCTS/env_robert.h +0 -106
  42. robotic/include/rai/MCTS/problem_BlindBranch.h +0 -47
  43. robotic/include/rai/MCTS/solver_AStar.h +0 -90
  44. robotic/include/rai/MCTS/solver_MBTS.h +0 -109
  45. robotic/include/rai/MCTS/solver_PlainMC.h +0 -58
  46. robotic/include/rai/MCTS/solver_marc.h +0 -63
  47. /robotic/include/rai/Geo/{geoOptim.h → testProblems_Geo.h} +0 -0
  48. {robotic-0.2.6.data → robotic-0.2.8.dev0.data}/scripts/ry-bot +0 -0
  49. {robotic-0.2.6.data → robotic-0.2.8.dev0.data}/scripts/ry-info +0 -0
  50. {robotic-0.2.6.data → robotic-0.2.8.dev0.data}/scripts/ry-meshTool +0 -0
  51. {robotic-0.2.6.data → robotic-0.2.8.dev0.data}/scripts/ry-test +0 -0
  52. {robotic-0.2.6.data → robotic-0.2.8.dev0.data}/scripts/ry-urdf2rai +0 -0
  53. {robotic-0.2.6.data → robotic-0.2.8.dev0.data}/scripts/ry-urdf2yaml +0 -0
  54. {robotic-0.2.6.data → robotic-0.2.8.dev0.data}/scripts/ry-view +0 -0
  55. {robotic-0.2.6.dist-info → robotic-0.2.8.dev0.dist-info}/LICENSE +0 -0
  56. {robotic-0.2.6.dist-info → robotic-0.2.8.dev0.dist-info}/WHEEL +0 -0
  57. {robotic-0.2.6.dist-info → robotic-0.2.8.dev0.dist-info}/top_level.txt +0 -0
robotic/DataGen.pyi CHANGED
@@ -3,7 +3,7 @@ rai data generators
3
3
  """
4
4
  from __future__ import annotations
5
5
  import _robotic
6
- __all__ = ['RndStableConfigs', 'ShapenetGrasps']
6
+ __all__ = ['RndStableConfigs', 'ShapenetGrasps', 'sampleGraspCandidate']
7
7
  class RndStableConfigs:
8
8
  """
9
9
  A generator of random stable configurations
@@ -76,3 +76,7 @@ class ShapenetGrasps:
76
76
  """
77
77
  set options
78
78
  """
79
+ def sampleGraspCandidate(C: _robotic.Config, ptsFrame: str, refFrame: str, pregraspNormalSdv: float = 0.2, verbose: int = 1) -> arr:
80
+ """
81
+ sample random grasp candidates on an object represented as points
82
+ """
robotic/_robotic.pyi CHANGED
@@ -6,7 +6,14 @@ import numpy
6
6
  import typing
7
7
  from . import DataGen
8
8
  from . import test
9
- __all__ = ['ArgWord', 'BSpline', 'BotOp', 'CameraView', 'CameraViewSensor', 'Config', 'ConfigurationViewer', 'ControlMode', 'DataGen', 'FS', 'Frame', 'JT', 'KOMO', 'KOMO_Objective', 'LGP_Tool', 'Logic2KOMO_Translator', 'NLP', 'NLP_Factory', 'NLP_Sampler', 'NLP_Solver', 'NLP_SolverID', 'NLP_SolverOptions', 'OT', 'OptBench_Skeleton_Handover', 'OptBench_Skeleton_Pick', 'OptBench_Skeleton_StackAndBalance', 'OptBenchmark_InvKin_Endeff', 'RRT_PathFinder', 'ST', 'SY', 'Simulation', 'SimulationEngine', 'Skeleton', 'SolverReturn', 'TAMP_Provider', 'compiled', 'default_Logic2KOMO_Translator', 'default_TAMP_Provider', 'depthImage2PointCloud', 'params_add', 'params_clear', 'params_file', 'params_print', 'raiPath', 'setRaiPath', 'test']
9
+ __all__ = ['Actions2KOMO_Translator', 'ArgWord', 'BSpline', 'BotOp', 'CameraView', 'CameraViewSensor', 'Config', 'ConfigurationViewer', 'ControlMode', 'DataGen', 'FS', 'Frame', 'JT', 'KOMO', 'KOMO_Objective', 'LGP_Tool', 'NLP', 'NLP_Factory', 'NLP_Sampler', 'NLP_Solver', 'NLP_SolverID', 'NLP_SolverOptions', 'OT', 'OptBench_Skeleton_Handover', 'OptBench_Skeleton_Pick', 'OptBench_Skeleton_StackAndBalance', 'OptBenchmark_InvKin_Endeff', 'RRT_PathFinder', 'ST', 'SY', 'Simulation', 'SimulationEngine', 'Skeleton', 'SolverReturn', 'TAMP_Provider', 'compiled', 'default_Actions2KOMO_Translator', 'default_TAMP_Provider', 'depthImage2PointCloud', 'params_add', 'params_clear', 'params_file', 'params_print', 'raiPath', 'setRaiPath', 'test']
10
+ class Actions2KOMO_Translator:
11
+ """
12
+ Actions2KOMO_Translator
13
+ """
14
+ @staticmethod
15
+ def _pybind11_conduit_v1_(*args, **kwargs):
16
+ ...
10
17
  class ArgWord:
11
18
  """
12
19
  [todo: replace by str]
@@ -256,6 +263,10 @@ class Config:
256
263
  """
257
264
  add a new frame to C; optionally make this a child to the given parent; use the Frame methods to set properties of the new frame
258
265
  """
266
+ def addH5Object(self, framename: str, filename: str, verbose: int = 0) -> Frame:
267
+ """
268
+ add the contents of the file to C
269
+ """
259
270
  def animate(self) -> None:
260
271
  """
261
272
  displays while articulating all dofs in a row
@@ -330,6 +341,10 @@ class Config:
330
341
  """
331
342
  get the total number of degrees of freedom
332
343
  """
344
+ def getJointIDs(self) -> uintA:
345
+ """
346
+ get indeces (which are the indices of their frames) of all joints
347
+ """
333
348
  def getJointLimits(self) -> arr:
334
349
  """
335
350
  get the joint limits as a n-by-2 matrix; for dofs that do not have limits defined, the entries are [0,-1] (i.e. upper limit < lower limit)
@@ -441,6 +456,14 @@ class ConfigurationViewer:
441
456
  @staticmethod
442
457
  def _pybind11_conduit_v1_(*args, **kwargs):
443
458
  ...
459
+ def savePng(self, saveVideoPath: str = 'z.vid/', count: int = -1) -> None:
460
+ """
461
+ save enumerated pngs in a path - for video making
462
+ """
463
+ def visualsOnly(self, _visualsOnly: bool = True) -> None:
464
+ """
465
+ display only visuals (no markers/transparent/text)
466
+ """
444
467
  class ControlMode:
445
468
  """
446
469
  Members:
@@ -587,8 +610,20 @@ class FS:
587
610
  transAccelerations
588
611
 
589
612
  transVelocities
613
+
614
+ qQuaternionNorms
615
+
616
+ opposeCentral
617
+
618
+ linangVel
619
+
620
+ AlignXWithDiff
621
+
622
+ AlignYWithDiff
590
623
  """
591
- __members__: typing.ClassVar[dict[str, FS]] # value = {'position': <FS.position: 0>, 'positionDiff': <FS.positionDiff: 1>, 'positionRel': <FS.positionRel: 2>, 'quaternion': <FS.quaternion: 3>, 'quaternionDiff': <FS.quaternionDiff: 4>, 'quaternionRel': <FS.quaternionRel: 5>, 'pose': <FS.pose: 6>, 'poseDiff': <FS.poseDiff: 7>, 'poseRel': <FS.poseRel: 8>, 'vectorX': <FS.vectorX: 9>, 'vectorXDiff': <FS.vectorXDiff: 10>, 'vectorXRel': <FS.vectorXRel: 11>, 'vectorY': <FS.vectorY: 12>, 'vectorYDiff': <FS.vectorYDiff: 13>, 'vectorYRel': <FS.vectorYRel: 14>, 'vectorZ': <FS.vectorZ: 15>, 'vectorZDiff': <FS.vectorZDiff: 16>, 'vectorZRel': <FS.vectorZRel: 17>, 'scalarProductXX': <FS.scalarProductXX: 18>, 'scalarProductXY': <FS.scalarProductXY: 19>, 'scalarProductXZ': <FS.scalarProductXZ: 20>, 'scalarProductYX': <FS.scalarProductYX: 21>, 'scalarProductYY': <FS.scalarProductYY: 22>, 'scalarProductYZ': <FS.scalarProductYZ: 23>, 'scalarProductZZ': <FS.scalarProductZZ: 24>, 'gazeAt': <FS.gazeAt: 25>, 'angularVel': <FS.angularVel: 26>, 'accumulatedCollisions': <FS.accumulatedCollisions: 27>, 'jointLimits': <FS.jointLimits: 28>, 'distance': <FS.distance: 29>, 'negDistance': <FS.distance: 29>, 'oppose': <FS.oppose: 30>, 'qItself': <FS.qItself: 31>, 'jointState': <FS.qItself: 31>, 'aboveBox': <FS.aboveBox: 33>, 'insideBox': <FS.insideBox: 34>, 'pairCollision_negScalar': <FS.pairCollision_negScalar: 35>, 'pairCollision_vector': <FS.pairCollision_vector: 36>, 'pairCollision_normal': <FS.pairCollision_normal: 37>, 'pairCollision_p1': <FS.pairCollision_p1: 38>, 'pairCollision_p2': <FS.pairCollision_p2: 39>, 'standingAbove': <FS.standingAbove: 40>, 'physics': <FS.physics: 41>, 'contactConstraints': <FS.contactConstraints: 42>, 'energy': <FS.energy: 43>, 'transAccelerations': <FS.transAccelerations: 44>, 'transVelocities': <FS.transVelocities: 45>}
624
+ AlignXWithDiff: typing.ClassVar[FS] # value = <FS.AlignXWithDiff: 49>
625
+ AlignYWithDiff: typing.ClassVar[FS] # value = <FS.AlignYWithDiff: 50>
626
+ __members__: typing.ClassVar[dict[str, FS]] # value = {'position': <FS.position: 0>, 'positionDiff': <FS.positionDiff: 1>, 'positionRel': <FS.positionRel: 2>, 'quaternion': <FS.quaternion: 3>, 'quaternionDiff': <FS.quaternionDiff: 4>, 'quaternionRel': <FS.quaternionRel: 5>, 'pose': <FS.pose: 6>, 'poseDiff': <FS.poseDiff: 7>, 'poseRel': <FS.poseRel: 8>, 'vectorX': <FS.vectorX: 9>, 'vectorXDiff': <FS.vectorXDiff: 10>, 'vectorXRel': <FS.vectorXRel: 11>, 'vectorY': <FS.vectorY: 12>, 'vectorYDiff': <FS.vectorYDiff: 13>, 'vectorYRel': <FS.vectorYRel: 14>, 'vectorZ': <FS.vectorZ: 15>, 'vectorZDiff': <FS.vectorZDiff: 16>, 'vectorZRel': <FS.vectorZRel: 17>, 'scalarProductXX': <FS.scalarProductXX: 18>, 'scalarProductXY': <FS.scalarProductXY: 19>, 'scalarProductXZ': <FS.scalarProductXZ: 20>, 'scalarProductYX': <FS.scalarProductYX: 21>, 'scalarProductYY': <FS.scalarProductYY: 22>, 'scalarProductYZ': <FS.scalarProductYZ: 23>, 'scalarProductZZ': <FS.scalarProductZZ: 24>, 'gazeAt': <FS.gazeAt: 25>, 'angularVel': <FS.angularVel: 26>, 'accumulatedCollisions': <FS.accumulatedCollisions: 27>, 'jointLimits': <FS.jointLimits: 28>, 'distance': <FS.distance: 29>, 'negDistance': <FS.distance: 29>, 'oppose': <FS.oppose: 30>, 'qItself': <FS.qItself: 31>, 'jointState': <FS.qItself: 31>, 'aboveBox': <FS.aboveBox: 33>, 'insideBox': <FS.insideBox: 34>, 'pairCollision_negScalar': <FS.pairCollision_negScalar: 35>, 'pairCollision_vector': <FS.pairCollision_vector: 36>, 'pairCollision_normal': <FS.pairCollision_normal: 37>, 'pairCollision_p1': <FS.pairCollision_p1: 38>, 'pairCollision_p2': <FS.pairCollision_p2: 39>, 'standingAbove': <FS.standingAbove: 40>, 'physics': <FS.physics: 41>, 'contactConstraints': <FS.contactConstraints: 42>, 'energy': <FS.energy: 43>, 'transAccelerations': <FS.transAccelerations: 44>, 'transVelocities': <FS.transVelocities: 45>, 'qQuaternionNorms': <FS.qQuaternionNorms: 46>, 'opposeCentral': <FS.opposeCentral: 47>, 'linangVel': <FS.linangVel: 48>, 'AlignXWithDiff': <FS.AlignXWithDiff: 49>, 'AlignYWithDiff': <FS.AlignYWithDiff: 50>}
592
627
  aboveBox: typing.ClassVar[FS] # value = <FS.aboveBox: 33>
593
628
  accumulatedCollisions: typing.ClassVar[FS] # value = <FS.accumulatedCollisions: 27>
594
629
  angularVel: typing.ClassVar[FS] # value = <FS.angularVel: 26>
@@ -599,8 +634,10 @@ class FS:
599
634
  insideBox: typing.ClassVar[FS] # value = <FS.insideBox: 34>
600
635
  jointLimits: typing.ClassVar[FS] # value = <FS.jointLimits: 28>
601
636
  jointState: typing.ClassVar[FS] # value = <FS.qItself: 31>
637
+ linangVel: typing.ClassVar[FS] # value = <FS.linangVel: 48>
602
638
  negDistance: typing.ClassVar[FS] # value = <FS.distance: 29>
603
639
  oppose: typing.ClassVar[FS] # value = <FS.oppose: 30>
640
+ opposeCentral: typing.ClassVar[FS] # value = <FS.opposeCentral: 47>
604
641
  pairCollision_negScalar: typing.ClassVar[FS] # value = <FS.pairCollision_negScalar: 35>
605
642
  pairCollision_normal: typing.ClassVar[FS] # value = <FS.pairCollision_normal: 37>
606
643
  pairCollision_p1: typing.ClassVar[FS] # value = <FS.pairCollision_p1: 38>
@@ -614,6 +651,7 @@ class FS:
614
651
  positionDiff: typing.ClassVar[FS] # value = <FS.positionDiff: 1>
615
652
  positionRel: typing.ClassVar[FS] # value = <FS.positionRel: 2>
616
653
  qItself: typing.ClassVar[FS] # value = <FS.qItself: 31>
654
+ qQuaternionNorms: typing.ClassVar[FS] # value = <FS.qQuaternionNorms: 46>
617
655
  quaternion: typing.ClassVar[FS] # value = <FS.quaternion: 3>
618
656
  quaternionDiff: typing.ClassVar[FS] # value = <FS.quaternionDiff: 4>
619
657
  quaternionRel: typing.ClassVar[FS] # value = <FS.quaternionRel: 5>
@@ -669,7 +707,6 @@ class Frame:
669
707
  """
670
708
  A (coordinate) frame of a configuration, which can have a parent, and associated shape, joint, and/or inertia
671
709
  """
672
- name: ...
673
710
  @staticmethod
674
711
  def _pybind11_conduit_v1_(*args, **kwargs):
675
712
  ...
@@ -753,13 +790,17 @@ class Frame:
753
790
  """
754
791
  attach a point cloud shape
755
792
  """
756
- def setPose(self, arg0: str) -> None:
793
+ def setPose(self, arg0: arr) -> None:
794
+ ...
795
+ def setPoseByText(self, arg0: str) -> None:
757
796
  ...
758
797
  def setPosition(self, arg0: arr) -> Frame:
759
798
  ...
760
799
  def setQuaternion(self, arg0: arr) -> Frame:
761
800
  ...
762
- def setRelativePose(self, arg0: str) -> None:
801
+ def setRelativePose(self, arg0: arr) -> None:
802
+ ...
803
+ def setRelativePoseByText(self, arg0: str) -> None:
763
804
  ...
764
805
  def setRelativePosition(self, arg0: arr) -> Frame:
765
806
  ...
@@ -773,10 +814,23 @@ class Frame:
773
814
  ...
774
815
  def setTensorShape(self, data: ..., size: arr) -> Frame:
775
816
  ...
776
- def transformToDiagInertia(self) -> Frame:
817
+ def transformToDiagInertia(self) -> ...:
777
818
  ...
778
819
  def unLink(self) -> Frame:
779
820
  ...
821
+ @property
822
+ def ID(self) -> int:
823
+ """
824
+ the unique ID of the frame, which is also its index in lists/arrays (e.g. when the frameState is returned as matrix) (readonly)
825
+ """
826
+ @property
827
+ def name(self) -> ...:
828
+ """
829
+ the name of the frame (editable)
830
+ """
831
+ @name.setter
832
+ def name(self, arg0: ...) -> None:
833
+ ...
780
834
  class JT:
781
835
  """
782
836
  Members:
@@ -932,8 +986,10 @@ class KOMO:
932
986
  ...
933
987
  def getFrameState(self, arg0: int) -> arr:
934
988
  ...
935
- def getPath(self) -> arr:
936
- ...
989
+ def getPath(self, dofIndices: uintA = ...) -> arr:
990
+ """
991
+ get path for selected dofs (default: all original config dofs)
992
+ """
937
993
  def getPathFrames(self) -> arr:
938
994
  ...
939
995
  def getPathTau(self) -> arr:
@@ -1017,7 +1073,7 @@ class LGP_Tool:
1017
1073
  @staticmethod
1018
1074
  def _pybind11_conduit_v1_(*args, **kwargs):
1019
1075
  ...
1020
- def __init__(self, arg0: Config, arg1: TAMP_Provider, arg2: Logic2KOMO_Translator) -> None:
1076
+ def __init__(self, arg0: Config, arg1: TAMP_Provider, arg2: Actions2KOMO_Translator) -> None:
1021
1077
  """
1022
1078
  initialization
1023
1079
  """
@@ -1055,13 +1111,6 @@ class LGP_Tool:
1055
1111
  """
1056
1112
  view last computed solution
1057
1113
  """
1058
- class Logic2KOMO_Translator:
1059
- """
1060
- Logic2KOMO_Translator
1061
- """
1062
- @staticmethod
1063
- def _pybind11_conduit_v1_(*args, **kwargs):
1064
- ...
1065
1114
  class NLP:
1066
1115
  """
1067
1116
  A Nonlinear Mathematical Program (bindings to the c++ object - distinct from the python template nlp.NLP
@@ -1171,7 +1220,7 @@ class NLP_Solver:
1171
1220
  """
1172
1221
  def setInitialization(self, arg0: arr) -> NLP_Solver:
1173
1222
  ...
1174
- def setOptions(self, verbose: int = 1, stopTolerance: float = 0.01, stopFTolerance: float = -1.0, stopGTolerance: float = -1.0, stopEvals: int = 1000, stopInners: int = 1000, stopOuters: int = 1000, maxStep: float = 0.2, damping: float = 1.0, stepInc: float = 1.5, stepDec: float = 0.5, wolfe: float = 0.01, muInit: float = 1.0, muInc: float = 5.0, muMax: float = 10000.0, muLBInit: float = 0.1, muLBDec: float = 0.2, maxLambda: float = -1.0) -> NLP_Solver:
1223
+ def setOptions(self, verbose: int = 1, stopTolerance: float = 0.01, stopFTolerance: float = -1.0, stopGTolerance: float = -1.0, stopEvals: int = 1000, stopInners: int = 1000, stopOuters: int = 1000, stepMax: float = 0.2, damping: float = 1.0, stepInc: float = 1.5, stepDec: float = 0.5, wolfe: float = 0.01, muInit: float = 1.0, muInc: float = 5.0, muMax: float = 10000.0, muLBInit: float = 0.1, muLBDec: float = 0.2, lambdaMax: float = -1.0) -> NLP_Solver:
1175
1224
  """
1176
1225
  set solver options
1177
1226
  """
@@ -1213,11 +1262,11 @@ class NLP_SolverID:
1213
1262
 
1214
1263
  Ceres
1215
1264
  """
1216
- Ceres: typing.ClassVar[NLP_SolverID] # value = <NLP_SolverID.Ceres: 10>
1217
- Ipopt: typing.ClassVar[NLP_SolverID] # value = <NLP_SolverID.Ipopt: 9>
1265
+ Ceres: typing.ClassVar[NLP_SolverID] # value = <NLP_SolverID.Ceres: 11>
1266
+ Ipopt: typing.ClassVar[NLP_SolverID] # value = <NLP_SolverID.Ipopt: 10>
1218
1267
  LBFGS: typing.ClassVar[NLP_SolverID] # value = <NLP_SolverID.LBFGS: 2>
1219
- NLopt: typing.ClassVar[NLP_SolverID] # value = <NLP_SolverID.NLopt: 8>
1220
- __members__: typing.ClassVar[dict[str, NLP_SolverID]] # value = {'gradientDescent': <NLP_SolverID.gradientDescent: 0>, 'rprop': <NLP_SolverID.rprop: 1>, 'LBFGS': <NLP_SolverID.LBFGS: 2>, 'newton': <NLP_SolverID.newton: 3>, 'augmentedLag': <NLP_SolverID.augmentedLag: 4>, 'squaredPenalty': <NLP_SolverID.squaredPenalty: 5>, 'logBarrier': <NLP_SolverID.logBarrier: 6>, 'singleSquaredPenalty': <NLP_SolverID.singleSquaredPenalty: 7>, 'NLopt': <NLP_SolverID.NLopt: 8>, 'Ipopt': <NLP_SolverID.Ipopt: 9>, 'Ceres': <NLP_SolverID.Ceres: 10>}
1268
+ NLopt: typing.ClassVar[NLP_SolverID] # value = <NLP_SolverID.NLopt: 9>
1269
+ __members__: typing.ClassVar[dict[str, NLP_SolverID]] # value = {'gradientDescent': <NLP_SolverID.gradientDescent: 0>, 'rprop': <NLP_SolverID.rprop: 1>, 'LBFGS': <NLP_SolverID.LBFGS: 2>, 'newton': <NLP_SolverID.newton: 3>, 'augmentedLag': <NLP_SolverID.augmentedLag: 4>, 'squaredPenalty': <NLP_SolverID.squaredPenalty: 5>, 'logBarrier': <NLP_SolverID.logBarrier: 6>, 'singleSquaredPenalty': <NLP_SolverID.singleSquaredPenalty: 7>, 'NLopt': <NLP_SolverID.NLopt: 9>, 'Ipopt': <NLP_SolverID.Ipopt: 10>, 'Ceres': <NLP_SolverID.Ceres: 11>}
1221
1270
  augmentedLag: typing.ClassVar[NLP_SolverID] # value = <NLP_SolverID.augmentedLag: 4>
1222
1271
  gradientDescent: typing.ClassVar[NLP_SolverID] # value = <NLP_SolverID.gradientDescent: 0>
1223
1272
  logBarrier: typing.ClassVar[NLP_SolverID] # value = <NLP_SolverID.logBarrier: 6>
@@ -1267,9 +1316,7 @@ class NLP_SolverOptions:
1267
1316
  ...
1268
1317
  def set_damping(self, arg0: float) -> NLP_SolverOptions:
1269
1318
  ...
1270
- def set_maxLambda(self, arg0: float) -> NLP_SolverOptions:
1271
- ...
1272
- def set_maxStep(self, arg0: float) -> NLP_SolverOptions:
1319
+ def set_lambdaMax(self, arg0: float) -> NLP_SolverOptions:
1273
1320
  ...
1274
1321
  def set_muInc(self, arg0: float) -> NLP_SolverOptions:
1275
1322
  ...
@@ -1285,6 +1332,8 @@ class NLP_SolverOptions:
1285
1332
  ...
1286
1333
  def set_stepInc(self, arg0: float) -> NLP_SolverOptions:
1287
1334
  ...
1335
+ def set_stepMax(self, arg0: float) -> NLP_SolverOptions:
1336
+ ...
1288
1337
  def set_stopEvals(self, arg0: int) -> NLP_SolverOptions:
1289
1338
  ...
1290
1339
  def set_stopFTolerance(self, arg0: float) -> NLP_SolverOptions:
@@ -1692,6 +1741,8 @@ class Simulation:
1692
1741
  """
1693
1742
  def getTimeToSplineEnd(self) -> float:
1694
1743
  ...
1744
+ def get_frameVelocities(self) -> arr:
1745
+ ...
1695
1746
  def get_q(self) -> arr:
1696
1747
  ...
1697
1748
  def get_qDot(self) -> arr:
@@ -1821,7 +1872,7 @@ def compiled() -> str:
1821
1872
  """
1822
1873
  return a compile date+time version string
1823
1874
  """
1824
- def default_Logic2KOMO_Translator() -> Logic2KOMO_Translator:
1875
+ def default_Actions2KOMO_Translator() -> Actions2KOMO_Translator:
1825
1876
  ...
1826
1877
  def default_TAMP_Provider(C: Config, lgp_config_file: str) -> TAMP_Provider:
1827
1878
  ...
robotic/_robotic.so CHANGED
Binary file
@@ -58,14 +58,14 @@ struct CtrlTarget_MaxCarrot : CtrlMovingTarget {
58
58
  //===========================================================================
59
59
 
60
60
  struct CtrlTarget_PathCarrot: CtrlMovingTarget {
61
- double maxStep;
61
+ double stepMax;
62
62
  rai::BSpline spline;
63
63
  double endTime;
64
64
  double time=0.;
65
65
  uint countInRange=0;
66
66
  uint countBlocked=0;
67
- CtrlTarget_PathCarrot(const arr& path, double maxStep, double _endTime=1.);
68
- CtrlTarget_PathCarrot(const arr& path, double maxStep, const arr& times);
67
+ CtrlTarget_PathCarrot(const arr& path, double stepMax, double _endTime=1.);
68
+ CtrlTarget_PathCarrot(const arr& path, double stepMax, const arr& times);
69
69
  virtual ActStatus step(double tau, CtrlObjective* o, const arr& y_real);
70
70
  virtual void setTimeScale(double d) { endTime = d; }
71
71
  virtual void resetState() { time=0.; countInRange=0.; }
@@ -291,7 +291,7 @@ template<class T> struct Array {
291
291
 
292
292
  //===========================================================================
293
293
  /// @}
294
- /// @name basic Array operators
294
+ /// @name Array operators
295
295
  /// @{
296
296
 
297
297
  template<class T> Array<T> operator, (const Array<T>& y, const Array<T>& z); //concat
@@ -668,8 +668,8 @@ uint product(const uintA& x);
668
668
  uint max(const uintA& x);
669
669
  uint sum(const uintA& x);
670
670
  float sum(const floatA& x);
671
- uintA integral(const uintA& x);
672
- uintA differencing(const uintA& x, uint width=1);
671
+ template<class T> Array<T> integral(const Array<T>& x);
672
+ template<class T> Array<T> differencing(const Array<T>& x, uint width=1);
673
673
 
674
674
  template<class T>
675
675
  void tensorPermutation(Array<T>& Y, const Array<T>& X, const uintA& Yid);
@@ -188,7 +188,6 @@ arr operator*(double y, const arr& z);
188
188
  arr operator/(int mustBeOne, const arr& z_tobeinverted);
189
189
  arr operator/(const arr& y, double z);
190
190
  arr operator/(const arr& y, const arr& z); //element-wise devision
191
- arr operator, (const arr& y, const arr& z); //concat
192
191
 
193
192
  arr& operator<<(arr& x, const double& y); //append
194
193
  arr& operator<<(arr& x, const arr& y); //append
@@ -469,8 +468,6 @@ inline arr diag(const arr& x) { arr y; y.setDiag(x); return y; }
469
468
  arr skew(const arr& x);
470
469
  arr inverse2d(const arr& A);
471
470
  arr replicate(const arr& A, uint d0);
472
- arr integral(const arr& x);
473
- arr differencing(const arr& x, uint width=1);
474
471
 
475
472
  void checkNan(const arr& x);
476
473
 
@@ -5,7 +5,6 @@
5
5
  struct RndStableConfigs_Options {
6
6
  RAI_PARAM("RndStableConfigs/", int, verbose, 1)
7
7
  RAI_PARAM("RndStableConfigs/", double, frictionCone_mu, .8)
8
-
9
8
  };
10
9
 
11
10
  struct RndStableConfigs {
@@ -43,3 +43,5 @@ private:
43
43
  void addSceneGripper();
44
44
  bool addSceneObject(const char* file, int idx, bool rndPose=true, bool visual=false);
45
45
  };
46
+
47
+ arr sampleGraspCandidate(rai::Configuration& C, const char *ptsFrame, const char* refFrame, double pregraspNormalSdv=.2, int verbose=1);
@@ -139,7 +139,7 @@ struct Mesh {
139
139
  /// @name IO
140
140
  void write(std::ostream&) const; ///< only writes generic info
141
141
  void read(std::istream&, const char* fileExtension, const char* filename=nullptr);
142
- void readFile(const char* filename);
142
+ Mesh& readFile(const char* filename);
143
143
  void readTriFile(std::istream& is);
144
144
  void readOffFile(std::istream& is);
145
145
  void readPlyFile(std::istream& is);
@@ -34,7 +34,7 @@ struct SDF : ScalarFunction {
34
34
  void animateSlices(const arr& lo, const arr& hi, double wait=0.);
35
35
  void view(double wait=0.);
36
36
 
37
- arr projectNewton(const arr& x0, double maxStep=.1, double regularization=1e-1);
37
+ arr projectNewton(const arr& x0, double stepMax=.1, double regularization=1e-1);
38
38
 
39
39
  virtual void write(std::ostream& os) const { NIY; }
40
40
  virtual void read(std::istream& is) { NIY; }
@@ -21,7 +21,7 @@ struct Render_Options {
21
21
  RAI_PARAM("Render/", arr, lights, {})
22
22
  };
23
23
 
24
- enum RenderType { _solid, _shadow, _tensor, _marker, _transparent, _text, _all };
24
+ enum RenderType { _solid, _shadow, _tensor, _text, _marker, _transparent, _all };
25
25
 
26
26
  struct RenderAsset{
27
27
  floatA vertices, colors, normals, texture;
@@ -142,6 +142,7 @@ struct RenderData {
142
142
  void ensureInitialized(OpenGL &gl);
143
143
  virtual void glDraw(OpenGL &gl);
144
144
  void glDeinitialize(OpenGL &gl);
145
+ void visualsOnly(bool _visualsOnly=true){ if(_visualsOnly) renderUntil=_tensor; else renderUntil=_all; }
145
146
 
146
147
  //private:
147
148
  void renderObjects(GLuint idT_WM, const uintA& sortedObjIDs, RenderType type, GLint idFlatColor=-1, GLint idScale=-1);
@@ -177,6 +177,7 @@ struct KOMO : NonCopyable {
177
177
 
178
178
  arrA getPath_qAll(); ///< get the DOFs (of potentially varying dimensionality) for each configuration
179
179
  arr getPath_qOrg(); ///< get joint path, optionally for selected joints
180
+ arr getPath(uintA dofIndices={});
180
181
  arr getPath_X(); ///< get frame path, optionally for selected frames
181
182
 
182
183
  arr getPath_tau();
@@ -14,17 +14,18 @@
14
14
  //===========================================================================
15
15
 
16
16
  struct ManipulationModelling {
17
- str info;
18
- //created on setup (or given):
19
17
  std::shared_ptr<KOMO> komo;
18
+ str info;
20
19
 
21
20
  //solver buffers:
22
- std::shared_ptr<rai::RRT_PathFinder> rrt;
23
21
  std::shared_ptr<SolverReturn> ret;
22
+ arr qTarget;
24
23
  arr path;
25
24
 
26
25
  ManipulationModelling(const str& _info={});
27
- ManipulationModelling(const std::shared_ptr<KOMO>& _komo);
26
+ ManipulationModelling(const std::shared_ptr<KOMO>& _komo, const str& _info = str{});
27
+
28
+ KOMO& k() { return *komo; }
28
29
 
29
30
  void setup_inverse_kinematics(rai::Configuration& C, double homing_scale=1e-1, bool accumulated_collisions=true, bool joint_limits=true, bool quaternion_norms=true);
30
31
  void setup_sequence(rai::Configuration& C, uint K, double homing_scale=1e-2, double velocity_scale=1e-1, bool accumulated_collisions=true, bool joint_limits=true, bool quaternion_norms=true);
@@ -33,7 +34,7 @@ struct ManipulationModelling {
33
34
  void setup_point_to_point_motion(rai::Configuration& C, const arr& q1, double homing_scale=1e-2, double acceleration_scale=1e-1, bool accumulated_collisions=true, bool joint_limits=true, bool quaternion_norms=true);
34
35
  void setup_point_to_point_rrt(rai::Configuration& C, const arr& q0, const arr& q1, const StringA& explicitCollisionPairs);
35
36
 
36
- void add_helper_frame(rai::JointType type, const char* parent, const char* name, const char* initName=0, rai::Frame* initFrame=0, double markerSize=-1.);
37
+ void add_stable_frame(rai::JointType type, const char* parent, const char* name, const char* initName=0, rai::Frame* initFrame=0, double markerSize=-1.);
37
38
 
38
39
  void grasp_top_box(double time, const char* gripper, const char* obj, str grasp_direction="xz");
39
40
  void grasp_box(double time, const char* gripper, const char* obj, const char* palm, str grasp_direction="x", double margin=.02);
@@ -42,10 +43,11 @@ struct ManipulationModelling {
42
43
 
43
44
  void straight_push(arr times, str obj, str gripper, str table);
44
45
 
45
- void no_collision(const arr& time_interval, const StringA& pairs, double margin=.001);
46
+ void no_collisions(const arr& time_interval, const StringA& pairs, double margin=.001, double scale=1e1);
47
+ void freeze_joint(const arr& time_interval, const StringA& joints);
48
+ void freeze_relativePose(const arr& time_interval, str to, str from);
46
49
 
47
- void switch_pick();
48
- void switch_place();
50
+ void snap_switch(double time, str parent, str obj);
49
51
 
50
52
  void target_position();
51
53
  void target_relative_xy_position(double time, const char* obj, const char* relativeTo, arr pos);
@@ -61,8 +63,8 @@ struct ManipulationModelling {
61
63
  arr sample(const char* sampleMethod=0, int verbose=1);
62
64
  void debug(bool listObjectives=true, bool plotOverTime=false);
63
65
 
64
- std::shared_ptr<ManipulationModelling> sub_motion(uint phase, bool fixEnd=true, double homing_scale=1e-2, double acceleration_scale=1e-1, bool accumulated_collisions=true, bool joint_limits=true, bool quaternion_norms=false);
65
- std::shared_ptr<ManipulationModelling> sub_rrt(uint phase, const StringA& explicitCollisionPairs= {}, const StringA& activeDofs={});
66
+ std::shared_ptr<ManipulationModelling> sub_motion(uint phase, bool fixEnd=true, double homing_scale=1e-2, double acceleration_scale=1e-1, bool accumulated_collisions=true, bool joint_limits=true, bool quaternion_norms=false, const StringA& activeDofs={});
67
+ std::shared_ptr<rai::RRT_PathFinder> sub_rrt(uint phase, const StringA& explicitCollisionPairs= {}, const StringA& activeDofs={});
66
68
 
67
69
  void play(rai::Configuration& C, double duration=1.);
68
70
 
@@ -10,9 +10,45 @@
10
10
 
11
11
  #include "komo.h"
12
12
  #include "skeleton.h"
13
+ #include "manipTools.h"
13
14
 
14
15
  #include "../Optim/NLP.h"
15
16
 
17
+ shared_ptr<KOMO> problem_IK();
18
+ shared_ptr<KOMO> problem_IKobstacle();
19
+ shared_ptr<KOMO> problem_IKtorus();
20
+ shared_ptr<KOMO> problem_PushToReach();
21
+ shared_ptr<KOMO> problem_StableSphere();
22
+
23
+ //===========================================================================
24
+
25
+ struct Problem{
26
+ std::shared_ptr<KOMO> komo;
27
+ std::shared_ptr<NLP> nlp;
28
+
29
+ void load(str problem);
30
+ };
31
+
32
+ //===========================================================================
33
+
34
+ //a set of spheres, confined in a box, and no collision, minimizing their height..
35
+ struct SpherePacking : NLP{
36
+ arr x; //position of spheres
37
+ uint n;
38
+ double rad;
39
+ bool ineqAccum;
40
+
41
+ rai::Configuration disp; //for reporting/display only
42
+
43
+ SpherePacking(uint _n, double _rad, bool _ineqAccum=false);
44
+
45
+ void ineqAccumulation(uint phiIdx, arr& phi, arr& J, arr& g, const arr& Jg);
46
+ void evaluate(arr& phi, arr& J, const arr &_x);
47
+ void report(ostream &os, int verbose, const char *msg=0);
48
+ };
49
+
50
+ //===========================================================================
51
+
16
52
  struct OptBench_InvKin_Simple {
17
53
  OptBench_InvKin_Simple();
18
54
  shared_ptr<KOMO> komo;
@@ -20,6 +20,15 @@ struct F_AboveBox : Feature {
20
20
 
21
21
  //===========================================================================
22
22
 
23
+ struct F_AlignWithDiff : Feature {
24
+ rai::Vector ref;
25
+ F_AlignWithDiff(const rai::Vector& _ref) : ref(_ref) { setOrder(1); }
26
+ virtual arr phi(const FrameL& F);
27
+ virtual uint dim_phi(const FrameL& F) { return 3; }
28
+ };
29
+
30
+ //===========================================================================
31
+
23
32
  struct F_InsideBox : Feature {
24
33
  rai::Vector ivec; ///< additional position or vector
25
34
  double margin;
@@ -69,8 +69,13 @@ enum FeatureSymbol : int {
69
69
 
70
70
  FS_qQuaternionNorms,
71
71
  FS_opposeCentral,
72
+ FS_linangVel,
73
+ FS_AlignXWithDiff,
74
+ FS_AlignYWithDiff,
75
+
72
76
  FS_jointState = FS_qItself,
73
- FS_negDistance = FS_distance
77
+ FS_negDistance = FS_distance,
78
+
74
79
  };
75
80
 
76
81
  namespace rai {
@@ -145,7 +145,7 @@ struct Frame : NonCopyable {
145
145
  void prefixSubtree(const char* prefix);
146
146
 
147
147
  //composed object manipulation
148
- Frame& transformToDiagInertia();
148
+ Transformation transformToDiagInertia();
149
149
  Frame& computeCompoundInertia(bool clearChildInertias=true);
150
150
  Frame& convertDecomposedShapeToChildFrames();
151
151
 
@@ -96,6 +96,7 @@ struct Configuration {
96
96
  Frame* addFrame(const char* name, const char* parent=nullptr, const char* args=nullptr, bool warnDuplicateName=true);
97
97
  Frame* addFile(const char* filename, const char* namePrefix=0);
98
98
  Frame* addAssimp(const char* filename);
99
+ Frame* addH5Object(const char* framename, const char* filename, int verbose);
99
100
  Frame* addCopy(const FrameL& F, const DofL& _dofs, const str& prefix= {});
100
101
  Frame* addConfigurationCopy(const Configuration& C, const str& prefix= {}, double tau=1.);
101
102
  void delFrame(const char* name);
@@ -57,6 +57,7 @@ struct Simulation {
57
57
  //-- get state information
58
58
  const arr& get_q() { return C.getJointState(); }
59
59
  const arr& get_qDot();
60
+ const arr& get_frameVelocities();
60
61
  double getTimeToSplineEnd();
61
62
  double getGripperWidth(const char* gripperFrameName);
62
63
  bool getGripperIsGrasping(const char* gripperFrameName);
@@ -32,7 +32,7 @@ struct ConfigurationViewer : RenderData {
32
32
 
33
33
  int view(bool watch=false, const char* _text=0);
34
34
  int view_slice(uint t, bool watch=false);
35
- int playVideo(bool watch=true, double delay=1., const char* saveVideoPath=nullptr); ///< display the trajectory; use "z.vid/" as vid prefix
35
+ int view_play(bool watch=true, double delay=1., str saveVideoPath=nullptr); ///< display the trajectory; use "z.vid/" as vid prefix
36
36
 
37
37
  rai::Camera& displayCamera(); ///< access to the display camera to change the view
38
38
  byteA getRgb();
@@ -9,8 +9,8 @@ namespace rai {
9
9
 
10
10
  //===========================================================================
11
11
 
12
- struct Logic2KOMO_Translator {
13
- virtual ~Logic2KOMO_Translator() {}
12
+ struct Actions2KOMO_Translator {
13
+ virtual ~Actions2KOMO_Translator() {}
14
14
  virtual std::shared_ptr<KOMO> setup_sequence(Configuration& C, uint K) = 0;
15
15
  virtual void add_action_constraints(std::shared_ptr<KOMO>& komo, double time, const StringA& action) = 0;
16
16
  virtual void add_action_constraints_motion(std::shared_ptr<KOMO>& komo, double time, const StringA& prev_action, const StringA& action, uint actionPhase) = 0;
@@ -74,7 +74,7 @@ struct ActionNode{
74
74
  ActionNode(ActionNode* _parent, StringA _action);
75
75
  ~ActionNode();
76
76
 
77
- PTR<KOMO>& get_ways(Configuration& C, Logic2KOMO_Translator& trans, const StringA& explicitCollisions);
77
+ PTR<KOMO>& get_ways(Configuration& C, Actions2KOMO_Translator& trans, const StringA& explicitCollisions);
78
78
  Array<PTR<KOMO_Motif>>& getWayMotifs();
79
79
 
80
80
 
@@ -99,7 +99,7 @@ struct LGP_Tool{
99
99
  //problem interface
100
100
  Configuration& C;
101
101
  TAMP_Provider& tamp;
102
- Logic2KOMO_Translator& trans;
102
+ Actions2KOMO_Translator& trans;
103
103
  int verbose=1;
104
104
 
105
105
  //internal data structures for action search and job management
@@ -113,7 +113,7 @@ struct LGP_Tool{
113
113
  uint step_count=0;
114
114
 
115
115
  LGP_Tool(const char* lgp_configfile);
116
- LGP_Tool(Configuration& _C, TAMP_Provider& _tamp, Logic2KOMO_Translator& _trans);
116
+ LGP_Tool(Configuration& _C, TAMP_Provider& _tamp, Actions2KOMO_Translator& _trans);
117
117
  ~LGP_Tool();
118
118
 
119
119
  void solve_step();
@@ -144,6 +144,6 @@ private:
144
144
 
145
145
  MotifL analyzeMotifs(KOMO& komo, int verbose=0);
146
146
  PTR<TAMP_Provider> default_TAMP_Provider(rai::Configuration &C, const char* lgp_configfile);
147
- PTR<Logic2KOMO_Translator> default_Logic2KOMO_Translator();
147
+ PTR<Actions2KOMO_Translator> default_Actions2KOMO_Translator();
148
148
 
149
149
  } //namespace
@@ -94,8 +94,8 @@ private:
94
94
  void ensure_eval() { ev.eval(x, *this); }
95
95
  void store_eval() { ensure_eval(); ev_stored = ev; }
96
96
 
97
- bool step_GaussNewton(bool slackStep, double penaltyMu=1., double alpha=-1., double maxStep=-1., double lambda=1e-2);
98
- void step_PlainGrad(bool slackMode, double penaltyMu=1., double alpha=-1., double maxStep=-1.);
97
+ bool step_GaussNewton(bool slackStep, double penaltyMu=1., double alpha=-1., double stepMax=-1., double lambda=1e-2);
98
+ void step_PlainGrad(bool slackMode, double penaltyMu=1., double alpha=-1., double stepMax=-1.);
99
99
  bool step_hit_and_run();
100
100
  bool step_noise(double sig);
101
101
  bool step_noise_covariant(double sig, double penaltyMu=1., double lambda=1e0);
@@ -133,9 +133,9 @@ struct LineSampler {
133
133
  double beta_lo=-1e6, beta_up=1e6;
134
134
  double p_beta;
135
135
 
136
- LineSampler(double maxStep=-1.) { if(maxStep>0.) init(maxStep); }
136
+ LineSampler(double stepMax=-1.) { if(stepMax>0.) init(stepMax); }
137
137
 
138
- void init(double maxStep) { beta_lo=-maxStep; beta_up=maxStep; }
138
+ void init(double stepMax) { beta_lo=-stepMax; beta_up=stepMax; }
139
139
 
140
140
  double eval_beta(double beta);
141
141
 
@@ -17,6 +17,7 @@ struct ConstrainedSolver;
17
17
  enum NLP_SolverID { NLPS_none=-1,
18
18
  NLPS_gradientDescent, NLPS_rprop, NLPS_LBFGS, NLPS_newton,
19
19
  NLPS_augmentedLag, NLPS_squaredPenalty, NLPS_logBarrier, NLPS_singleSquaredPenalty,
20
+ NLPS_slackGN,
20
21
  NLPS_NLopt, NLPS_Ipopt, NLPS_Ceres
21
22
  };
22
23