robotic 0.2.9.dev2__cp310-cp310-manylinux2014_x86_64.whl → 0.3.0__cp310-cp310-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 (69) hide show
  1. robotic/__init__.py +1 -1
  2. robotic/_robotic.pyi +9 -9
  3. robotic/_robotic.so +0 -0
  4. robotic/include/rai/Algo/rungeKutta.h +1 -1
  5. robotic/include/rai/Control/TimingMPC.h +2 -2
  6. robotic/include/rai/Core/array.h +64 -40
  7. robotic/include/rai/Core/array.ipp +244 -80
  8. robotic/include/rai/Core/arrayDouble.h +10 -13
  9. robotic/include/rai/Core/graph.h +22 -2
  10. robotic/include/rai/Core/h5.h +3 -1
  11. robotic/include/rai/Geo/fclInterface.h +3 -1
  12. robotic/include/rai/Geo/geo.h +4 -1
  13. robotic/include/rai/Geo/mesh.h +11 -5
  14. robotic/include/rai/Geo/pairCollision.h +4 -4
  15. robotic/include/rai/Gui/RenderData.h +4 -3
  16. robotic/include/rai/Gui/opengl.h +1 -1
  17. robotic/include/rai/KOMO/komo.h +1 -0
  18. robotic/include/rai/KOMO/manipTools.h +1 -1
  19. robotic/include/rai/Kin/F_forces.h +1 -1
  20. robotic/include/rai/Kin/dof_forceExchange.h +4 -4
  21. robotic/include/rai/Kin/frame.h +4 -3
  22. robotic/include/rai/Kin/kin.h +24 -15
  23. robotic/include/rai/Kin/kin_physx.h +2 -2
  24. robotic/include/rai/Logic/folWorld.h +1 -1
  25. robotic/include/rai/Optim/testProblems_Opt.h +2 -2
  26. robotic/include/rai/Optim/utils.h +2 -2
  27. robotic/include/rai/PathAlgos/ConfigurationProblem.h +3 -2
  28. robotic/include/rai/PathAlgos/RRT_PathFinder.h +1 -1
  29. robotic/librai.so +0 -0
  30. robotic/meshTool +0 -0
  31. robotic/rai-robotModels/g1/g1.g +11 -2
  32. robotic/rai-robotModels/objects/shelf.g +1 -1
  33. robotic/rai-robotModels/panda/panda.g +1 -1
  34. robotic/rai-robotModels/panda/panda_arm_hand_conv.g +22 -22
  35. robotic/rai-robotModels/panda/panda_arm_hand_conv.yml +24 -0
  36. robotic/rai-robotModels/pr2/pr2.g +6 -6
  37. robotic/rai-robotModels/pr2/pr2_clean.g +114 -114
  38. robotic/rai-robotModels/pr2/pr2_modifications.g +2 -2
  39. robotic/rai-robotModels/ranger/ranger.g +3 -3
  40. robotic/rai-robotModels/robotiq/robotiq.g +1 -1
  41. robotic/rai-robotModels/scenarios/panda_fixRobotiq.g +3 -3
  42. robotic/rai-robotModels/tests/arm.g +11 -11
  43. robotic/rai-robotModels/ur10/ur10.g +1 -1
  44. robotic/rai-robotModels/ur10/ur10_clean.g +8 -8
  45. robotic/ry-h5info +2 -2
  46. robotic/ry-urdfConvert.py +3 -2
  47. robotic/{cleanMeshes.py → src/cleanMeshes.py} +0 -0
  48. robotic/src/meshlabFilters.mlx +20 -0
  49. robotic/src/{config_mujoco.py → mujoco_io.py} +18 -13
  50. robotic/test.py +15 -0
  51. robotic/version.py +1 -1
  52. {robotic-0.2.9.dev2.data → robotic-0.3.0.data}/scripts/ry-h5info +2 -2
  53. robotic-0.3.0.data/scripts/ry-urdfConvert.py +74 -0
  54. {robotic-0.2.9.dev2.dist-info → robotic-0.3.0.dist-info}/METADATA +3 -7
  55. {robotic-0.2.9.dev2.dist-info → robotic-0.3.0.dist-info}/RECORD +63 -65
  56. {robotic-0.2.9.dev2.dist-info → robotic-0.3.0.dist-info}/WHEEL +1 -1
  57. robotic/rai-robotModels/g1/g1_29dof_conv.g +0 -77
  58. robotic/rai-robotModels/robotiq/robotiq_arg2f_85_model_conv.g +0 -21
  59. robotic/ry-urdf2rai +0 -222
  60. robotic/ry-urdf2yaml +0 -250
  61. robotic-0.2.9.dev2.data/scripts/ry-urdf2rai +0 -222
  62. robotic-0.2.9.dev2.data/scripts/ry-urdf2yaml +0 -250
  63. {robotic-0.2.9.dev2.data → robotic-0.3.0.data}/scripts/ry-bot +0 -0
  64. {robotic-0.2.9.dev2.data → robotic-0.3.0.data}/scripts/ry-info +0 -0
  65. {robotic-0.2.9.dev2.data → robotic-0.3.0.data}/scripts/ry-meshTool +0 -0
  66. {robotic-0.2.9.dev2.data → robotic-0.3.0.data}/scripts/ry-test +0 -0
  67. {robotic-0.2.9.dev2.data → robotic-0.3.0.data}/scripts/ry-view +0 -0
  68. {robotic-0.2.9.dev2.dist-info → robotic-0.3.0.dist-info}/licenses/LICENSE +0 -0
  69. {robotic-0.2.9.dev2.dist-info → robotic-0.3.0.dist-info}/top_level.txt +0 -0
robotic/__init__.py CHANGED
@@ -9,7 +9,7 @@ from .version import __version__
9
9
 
10
10
  from .manipulation import KOMO_ManipulationHelper
11
11
 
12
- from .src.config_mujoco import MujocoLoader
12
+ from .src.mujoco_io import MujocoLoader
13
13
  from .src.config_urdf import URDFLoader
14
14
  from .src.mesh_helper import MeshHelper
15
15
 
robotic/_robotic.pyi CHANGED
@@ -291,6 +291,10 @@ class Config:
291
291
  """
292
292
  clear all frames and additional data; becomes the empty configuration, with no frames
293
293
  """
294
+ def coll_totalViolation(self) -> float:
295
+ """
296
+ returns the sum of all penetrations (using FCL for broadphase; and low-level GJK/MRP for fine pair-wise distance/penetration computation)
297
+ """
294
298
  def computeCollisions(self) -> None:
295
299
  """
296
300
  [should be obsolete; getCollision* methods auto ensure proxies] call the broadphase collision engine (SWIFT++ or FCL) to generate the list of collisions (or near proximities) between all frame shapes that have the collision tag set non-zero
@@ -311,18 +315,10 @@ class Config:
311
315
  """
312
316
  returns the list of collisable pairs -- this should help debugging the 'contact' flag settings in a configuration
313
317
  """
314
- def getCollisionFree(self) -> bool:
315
- """
316
- returns if the configuration is collision free (binary collision check, using FCL only; collidable objects need to have contact flag)
317
- """
318
318
  def getCollisions(self, belowMargin: float = 1.0) -> list:
319
319
  """
320
320
  return the results of collision computations: a list of 3 tuples with (frame1, frame2, distance). Optionally report only on distances below a margin To get really precise distances and penetrations use the FS.distance feature with the two frame names
321
321
  """
322
- def getCollisionsTotalPenetration(self) -> float:
323
- """
324
- returns the sum of all penetrations (using FCL for broadphase; and low-level GJK/MRP for fine pair-wise distance/penetration computation)
325
- """
326
322
  def getFrame(self, frameName: str, warnIfNotExist: bool = True) -> Frame:
327
323
  """
328
324
  get access to a frame by name; use the Frame methods to set/get frame properties
@@ -411,6 +407,10 @@ class Config:
411
407
  """
412
408
  return the focal length of the view camera (only intrinsic parameter)
413
409
  """
410
+ def view_focus(self, frameName: str, absHeight: float = 2.0) -> None:
411
+ """
412
+ focus on a particular frame, given via name; second argument distances camara so that view window has roughly given absHeight around object
413
+ """
414
414
  def view_fxycxy(self) -> arr:
415
415
  """
416
416
  return (fx, fy, cx, cy): the focal length and image center in PIXEL UNITS
@@ -453,7 +453,7 @@ class Config:
453
453
  """
454
454
  write the full configuration in a ply mesh file
455
455
  """
456
- def writeMeshes(self, pathPrefix: ..., copyTextures: bool = True, enumerateTextures: bool = False) -> None:
456
+ def writeMeshes(self, pathPrefix: ..., copyTextures: bool = True, enumerateAssets: bool = False) -> None:
457
457
  """
458
458
  write all object meshes in a directory
459
459
  """
robotic/_robotic.so CHANGED
Binary file
@@ -19,7 +19,7 @@ void rk4(arr& x, const arr& x0, const fct& f, double dt);
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
- void rk4_2ndOrder(arr& x, const arr& x0, const fct& f, double dt);
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
@@ -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, -1}).copy(); }
48
- arr getTimes() const { if(done()) return {.1}; return integral(tau({phase, -1})); }
47
+ arr getWaypoints() const { if(done()) return waypoints[-1].copy().reshape(1, -1); return waypoints({phase, -1+1}).copy(); }
48
+ arr getTimes() const { if(done()) return {.1}; return integral(tau({phase, -1+1})); }
49
49
  arr getVels() const;
50
50
 
51
51
  bool set_progressedTime(double gap, double tauCutoff=0.);
@@ -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
@@ -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
@@ -132,7 +141,6 @@ template<class T> struct Array {
132
141
  Array<T>& resizeAs(const Array<T>& a);
133
142
  Array<T>& reshapeAs(const Array<T>& a);
134
143
  Array<T>& resizeCopyAs(const Array<T>& a);
135
- Array<T>& reshapeFlat();
136
144
  Array<T>& dereference();
137
145
 
138
146
  /// @name dimensionality access
@@ -142,7 +150,7 @@ template<class T> struct Array {
142
150
  /// @name initializing/assigning entries
143
151
  Array<T>& clear();
144
152
  Array<T>& setZero(byte zero=0);
145
- void setUni(const T& scalar, int d=-1);
153
+ void setConst(const T& scalar, int d=-1);
146
154
  void setId(int d=-1);
147
155
  void setDiag(const T& scalar, int d=-1);
148
156
  void setDiag(const Array<T>& vector);
@@ -159,14 +167,13 @@ template<class T> struct Array {
159
167
  Array<T>& setCarray(const T** buffer, uint D0, uint D1);
160
168
  Array<T>& referTo(const T* buffer, uint n);
161
169
  void referTo(const Array<T>& a);
162
- void referToRange(const Array<T>& a, int i_lo, int i_up);
163
- void referToRange(const Array<T>& a, int i, int j_lo, int j_up);
164
- void referToRange(const Array<T>& a, int i, int j, int k_lo, int k_up);
170
+ void referToRange(const Array<T>& a, std::pair<int, int> I);
171
+ void referToRange(const Array<T>& a, int i, std::pair<int, int> J);
172
+ void referToRange(const Array<T>& a, int i, int j, std::pair<int, int> K);
165
173
  void referToDim(const Array<T>& a, int i);
166
174
  void referToDim(const Array<T>& a, uint i, uint j);
167
175
  void referToDim(const Array<T>& a, uint i, uint j, uint k);
168
176
  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
177
 
171
178
  /// @name access by reference (direct memory access)
172
179
  Array<T> ref() const; //a reference on this
@@ -191,11 +198,11 @@ template<class T> struct Array {
191
198
 
192
199
  /// @name access by copy
193
200
  Array<T> copy() const;
194
- Array<T> sub(int i, int I) const;
195
- Array<T> sub(int i, int I, int j, int J) const;
196
- Array<T> sub(int i, int I, int j, int J, int k, int K) const;
197
- Array<T> sub(int i, int I, Array<uint> cols) const;
198
- Array<T> sub(Array<uint> elems) const;
201
+ Array<T> sub(std::pair<int, int> I) const;
202
+ Array<T> sub(std::pair<int, int> I, std::pair<int, int> J) const;
203
+ Array<T> sub(std::pair<int, int> I, std::pair<int, int> J, std::pair<int, int> K) const;
204
+ Array<T> pick(std::pair<int, int> I, Array<uint> cols) const;
205
+ Array<T> pick(Array<uint> elems) const;
199
206
  Array<T> row(uint row_index) const;
200
207
  Array<T> rows(uint start_row, uint end_row) const;
201
208
  Array<T> col(uint col_index) const;
@@ -225,7 +232,7 @@ template<class T> struct Array {
225
232
  void delRows(int i, uint k=1);
226
233
  void delColumns(int i, uint k=1);
227
234
  void insRows(int i, uint k=1);
228
- void insColumns(int i, uint k=1);
235
+ Array<T>& insColumns(int i, uint k=1);
229
236
  void resizeDim(uint k, uint dk);
230
237
  void setAppend(const T& x); //? same as if(findValue(x)==-1) append(x)
231
238
  void setAppend(const Array<T>& x);
@@ -256,6 +263,22 @@ template<class T> struct Array {
256
263
  void permuteRandomly();
257
264
  void shift(int offset, bool wrapAround=true);
258
265
 
266
+ /// @name special matrices -- only for double
267
+ double sparsity();
268
+ SparseMatrix& sparse();
269
+ const SparseMatrix& sparse() const;
270
+ SparseVector& sparseVec();
271
+ const SparseVector& sparseVec() const;
272
+ RowShifted& rowShifted();
273
+ const RowShifted& rowShifted() const;
274
+
275
+ /// @name attached Jacobian -- only for double
276
+ std::unique_ptr<Array<double>> jac=0; ///< optional pointer to Jacobian, to enable autodiff
277
+ void J_setId();
278
+ Array<double>& J();
279
+ Array<double> noJ() const;
280
+ Array<double> J_reset();
281
+
259
282
  /// @name I/O
260
283
  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
284
  Array<T>& read(std::istream& is);
@@ -299,33 +322,14 @@ template<class T> bool operator==(const Array<T>& v, const Array<T>& w); //equal
299
322
  template<class T> Array<byte> operator==(const Array<T>& v, const T& w); //element-wise equal
300
323
  template<class T> bool operator!=(const Array<T>& v, const Array<T>& w);
301
324
  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
325
  template<class T> std::ostream& operator<<(std::ostream& os, const Array<T>& x);
304
326
 
305
- template<class T> void operator+=(Array<T>& x, const Array<T>& y) {
306
- CHECK_EQ(x.N, y.N, "update operator on different array dimensions (" <<x.N <<", " <<y.N <<")");
307
- T* xp=x.p, *xstop=xp+x.N;
308
- const T* yp=y.p;
309
- for(; xp!=xstop; xp++, yp++) *xp += *yp;
310
- }
311
- template<class T> void operator+=(Array<T>& x, const T& y) {
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
- }
327
+ template<class T> void operator+=(Array<T>& x, const Array<T>& y);
328
+ template<class T> void operator+=(Array<T>& x, const T& y);
329
+ template<class T> void operator-=(Array<T>& x, const Array<T>& y);
330
+ template<class T> void operator-=(Array<T>& x, const T& y);
331
+ template<class T> void operator*=(Array<T>& x, const T& y);
332
+
329
333
  template<class T> Array<T> operator+(const Array<T>& y, const Array<T>& z) { Array<T> x(y); x+=z; return x; }
330
334
  template<class T> Array<T> operator+(const Array<T>& y, T z) { Array<T> x(y); x+=z; return x; }
331
335
  template<class T> Array<T> operator-(const Array<T>& y, const Array<T>& z) { Array<T> x(y); x-=z; return x; }
@@ -360,6 +364,7 @@ template <class T> std::ostream& operator<<(std::ostream& os, const ArrayModList
360
364
  /// @name standard types
361
365
  /// @{
362
366
 
367
+ typedef rai::Array<double> arr;
363
368
  typedef rai::Array<uint> uintA;
364
369
  typedef rai::Array<int> intA;
365
370
  typedef rai::Array<char> charA;
@@ -373,6 +378,8 @@ typedef rai::Array<intA> intAA;
373
378
  typedef rai::Array<uintA> uintAA;
374
379
 
375
380
  namespace rai { struct String; }
381
+ typedef rai::Array<rai::String> strA;
382
+ typedef rai::Array<rai::String> strAA;
376
383
  typedef rai::Array<rai::String> StringA;
377
384
  typedef rai::Array<StringA> StringAA;
378
385
  typedef rai::Array<rai::String*> StringL;
@@ -385,7 +392,7 @@ typedef rai::Array<rai::String*> StringL;
385
392
  namespace rai {
386
393
 
387
394
  /// 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.setUni(c); return z; }
395
+ template<class T> Array<T> consts(const T& c, const uintA& d) { Array<T> z; z.resize(d); z.setConst(c); return z; }
389
396
  /// return VECTOR of c's
390
397
  template<class T> Array<T> consts(const T& c, uint n) { return consts(c, uintA{n}); }
391
398
  /// return matrix of c's
@@ -410,6 +417,11 @@ template<class T> Array<Array<T>> getArrayArray(const Array<T>& data) {
410
417
  return xx;
411
418
  }
412
419
 
420
+ /** @brief return a `dim'-dimensional grid with `steps' intervals
421
+ filling the range [lo, hi] in each dimension. Note: returned array is
422
+ `flat', rather than grid-shaped. */
423
+ template<class T> Array<T> grid(uint dim, T lo, T hi, uint steps);
424
+
413
425
  }
414
426
 
415
427
  //===========================================================================
@@ -526,8 +538,7 @@ template<class T> Array<T> setSectionSorted(const Array<T>& x, const Array<T>& y
526
538
  return R;
527
539
  }
528
540
 
529
- template<class T>
530
- void setMinusSorted(Array<T>& x, const Array<T>& y, bool (*comp)(const T& a, const T& b)) {
541
+ template<class T> void setMinusSorted(Array<T>& x, const Array<T>& y, bool (*comp)(const T& a, const T& b)) {
531
542
  #if 1
532
543
  int i=x.N-1, j=y.N-1;
533
544
  if(j<0) return;
@@ -687,6 +698,19 @@ void b64_encode(char* code, int code_len, const char* data, int data_len);
687
698
  void b64_decode(char* data, int data_len, const char* code, int code_len);
688
699
  }
689
700
 
701
+ //===========================================================================
702
+ //
703
+ // conversions
704
+ //
705
+
706
+ template<class T> rai::Array<T> as_arr(const std::vector<T>& a, bool byReference) {
707
+ return rai::Array<T>(&a.front(), a.size(), byReference);
708
+ }
709
+
710
+ template<class T> std::vector<T> as_vector(const rai::Array<T>& a) {
711
+ return std::vector<T>(a.p, a.p+a.N);
712
+ }
713
+
690
714
  //===========================================================================
691
715
  //
692
716
  // implementations