placo 0.3.6__0-cp310-cp310-manylinux_2_35_x86_64.whl → 0.3.8__0-cp310-cp310-manylinux_2_35_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 placo might be problematic. Click here for more details.

Binary file
@@ -3615,6 +3615,19 @@ class HumanoidRobot:
3615
3615
  :return: the joint current (inner state) value (e.g rad for revolute or meters for prismatic)"""
3616
3616
  ...
3617
3617
 
3618
+ def get_joint_acceleration(
3619
+ self: HumanoidRobot,
3620
+ name: str, # const std::string &
3621
+
3622
+ ) -> float:
3623
+ """Gets the joint acceleration from state.qd.
3624
+
3625
+
3626
+ :param name: joint name
3627
+
3628
+ :return: joint acceleration"""
3629
+ ...
3630
+
3618
3631
  def get_joint_offset(
3619
3632
  self: HumanoidRobot,
3620
3633
  name: str, # const std::string &
@@ -3797,6 +3810,20 @@ class HumanoidRobot:
3797
3810
  :param value: joint value (e.g rad for revolute or meters for prismatic)"""
3798
3811
  ...
3799
3812
 
3813
+ def set_joint_acceleration(
3814
+ self: HumanoidRobot,
3815
+ name: str, # const std::string &
3816
+ value: float, # double
3817
+
3818
+ ) -> None:
3819
+ """Sets the joint acceleration in state.qd.
3820
+
3821
+
3822
+ :param name: joint name
3823
+
3824
+ :param value: joint acceleration"""
3825
+ ...
3826
+
3800
3827
  def set_joint_limits(
3801
3828
  self: HumanoidRobot,
3802
3829
  name: str, # const std::string &
@@ -3926,7 +3953,7 @@ class HumanoidRobot:
3926
3953
  self: HumanoidRobot,
3927
3954
 
3928
3955
  ) -> None:
3929
- """Update the current kinematics."""
3956
+ """Update internal computation for kinematics (frames, jacobian). This method should be called when the robot state has changed."""
3930
3957
  ...
3931
3958
 
3932
3959
  def update_support_side(
@@ -6007,6 +6034,19 @@ class RobotWrapper:
6007
6034
  :return: the joint current (inner state) value (e.g rad for revolute or meters for prismatic)"""
6008
6035
  ...
6009
6036
 
6037
+ def get_joint_acceleration(
6038
+ self: RobotWrapper,
6039
+ name: str, # const std::string &
6040
+
6041
+ ) -> float:
6042
+ """Gets the joint acceleration from state.qd.
6043
+
6044
+
6045
+ :param name: joint name
6046
+
6047
+ :return: joint acceleration"""
6048
+ ...
6049
+
6010
6050
  def get_joint_offset(
6011
6051
  self: RobotWrapper,
6012
6052
  name: str, # const std::string &
@@ -6176,6 +6216,20 @@ class RobotWrapper:
6176
6216
  :param value: joint value (e.g rad for revolute or meters for prismatic)"""
6177
6217
  ...
6178
6218
 
6219
+ def set_joint_acceleration(
6220
+ self: RobotWrapper,
6221
+ name: str, # const std::string &
6222
+ value: float, # double
6223
+
6224
+ ) -> None:
6225
+ """Sets the joint acceleration in state.qd.
6226
+
6227
+
6228
+ :param name: joint name
6229
+
6230
+ :param value: joint acceleration"""
6231
+ ...
6232
+
6179
6233
  def set_joint_limits(
6180
6234
  self: RobotWrapper,
6181
6235
  name: str, # const std::string &
@@ -6301,7 +6355,7 @@ class RobotWrapper:
6301
6355
  self: RobotWrapper,
6302
6356
 
6303
6357
  ) -> None:
6304
- """Update the current kinematics."""
6358
+ """Update internal computation for kinematics (frames, jacobian). This method should be called when the robot state has changed."""
6305
6359
  ...
6306
6360
 
6307
6361
  visual_model: any # pinocchio::GeometryModel
@@ -7191,19 +7245,6 @@ def flatten_on_floor(
7191
7245
  ...
7192
7246
 
7193
7247
 
7194
- def frame(
7195
- matrix: any, # Eigen::Matrix4d
7196
-
7197
- ) -> numpy.ndarray:
7198
- """Makes an Affine3d from a 4x4 matrix (for python bindings)
7199
-
7200
-
7201
- :param matrix: the 4x4 matrix
7202
-
7203
- :return: The Affine3d"""
7204
- ...
7205
-
7206
-
7207
7248
  def frame_yaw(
7208
7249
  rotation: numpy.ndarray, # Eigen::Matrix3d
7209
7250
 
@@ -18,12 +18,15 @@ def get_viewer() -> meshcat.Visualizer:
18
18
 
19
19
  if viewer is None:
20
20
  viewer = meshcat.Visualizer()
21
+
21
22
  print(f"Viewer URL: {viewer.url()}")
22
23
 
23
24
  return viewer
24
25
 
25
26
 
26
- def robot_viz(robot: placo.RobotWrapper, name: str = "robot") -> pin.visualize.MeshcatVisualizer:
27
+ def robot_viz(
28
+ robot: placo.RobotWrapper, name: str = "robot"
29
+ ) -> pin.visualize.MeshcatVisualizer:
27
30
  """
28
31
  Builds an instance of pinocchio MeshcatVisualizer, which allows to push the model to the meshcat
29
32
  visualizer passed as parameter
@@ -31,14 +34,13 @@ def robot_viz(robot: placo.RobotWrapper, name: str = "robot") -> pin.visualize.M
31
34
  The robot can further be displayed using:
32
35
 
33
36
  > viz.display(q)
34
-
35
- :param robot: robot instance
36
- :param name: name of the robot
37
37
  """
38
38
  global robot_names
39
39
 
40
40
  robot_names[robot] = name
41
- viz = pin.visualize.MeshcatVisualizer(robot.model, robot.collision_model, robot.visual_model)
41
+ viz = pin.visualize.MeshcatVisualizer(
42
+ robot.model, robot.collision_model, robot.visual_model
43
+ )
42
44
  viz.initViewer(viewer=get_viewer())
43
45
  viz.loadViewerModel(name)
44
46
 
@@ -51,10 +53,6 @@ cylinders: dict = {}
51
53
  def frame_viz(name: str, T: np.ndarray, opacity: float = 1.0) -> None:
52
54
  """
53
55
  Visualizes a given frame
54
-
55
- :param name: name of the frame
56
- :param T: transformation of the frame to the world
57
- :param opacity: opacity of the frame
58
56
  """
59
57
  global cylinders
60
58
  vis = get_viewer()
@@ -76,30 +74,60 @@ def frame_viz(name: str, T: np.ndarray, opacity: float = 1.0) -> None:
76
74
  )
77
75
  obj = cylinders[node_name]
78
76
 
79
- obj.set_transform(T @ tf.rotation_matrix(*rotate) @ tf.translation_matrix([0, 0.05, 0]))
77
+ obj.set_transform(
78
+ T @ tf.rotation_matrix(*rotate) @ tf.translation_matrix([0, 0.05, 0])
79
+ )
80
80
 
81
81
 
82
- def point_viz(name: str, point: np.ndarray, radius: float = 0.01, color: float = 0xFF0000, opacity: float = 1.0) -> None:
82
+ def point_viz(
83
+ name: str,
84
+ point: np.ndarray,
85
+ radius: float = 0.01,
86
+ color: float = 0xFF0000,
87
+ opacity: float = 1.0,
88
+ ) -> None:
83
89
  """
84
90
  Prints a point (sphere)
91
+ """
92
+ vis = get_viewer()
93
+ vis["point"][name].set_object(
94
+ g.Sphere(radius), g.MeshPhongMaterial(color=color, opacity=opacity)
95
+ )
96
+ vis["point"][name].set_transform(tf.translation_matrix(point))
97
+
85
98
 
86
- :param name: name of the point
87
- :param point: point to print
88
- :param radius: radius of the point
89
- :param color: color of the point
90
- :param opacity: opacity of the point
99
+ points_sizes = {}
100
+
101
+
102
+ def points_viz(
103
+ name: str,
104
+ points: np.ndarray,
105
+ radius: float = 0.01,
106
+ color: float = 0xFF0000,
107
+ opacity: float = 1.0,
108
+ ) -> None:
109
+ """
110
+ Prints a point (sphere)
91
111
  """
112
+ global points_sizes
92
113
  vis = get_viewer()
93
- vis["points"][name].set_object(g.Sphere(radius), g.MeshPhongMaterial(color=color, opacity=opacity))
94
- vis["points"][name].set_transform(tf.translation_matrix(point))
114
+ k = 0
115
+ for point in points:
116
+ entry = f"{name}_{k}"
117
+ k += 1
118
+ vis["points"][name][entry].set_object(
119
+ g.Sphere(radius), g.MeshPhongMaterial(color=color, opacity=opacity)
120
+ )
121
+ vis["points"][name][entry].set_transform(tf.translation_matrix(point))
122
+ while k < points_sizes.get(name, 0):
123
+ vis["points"][name][f"{name}_{k}"].delete()
124
+ k += 1
125
+ points_sizes[name] = len(points)
95
126
 
96
127
 
97
128
  def robot_frame_viz(robot: placo.RobotWrapper, frame: str) -> None:
98
129
  """
99
- Draw a frame attached to the robot
100
-
101
- :param robot: robot instance
102
- :param frame: frame name
130
+ Draw a frame from the robot
103
131
  """
104
132
  node_name = f"{robot_names[robot]}_{frame}"
105
133
  frame_viz(node_name, robot.get_T_world_frame(frame))
@@ -109,12 +137,6 @@ steps: int = 0
109
137
 
110
138
 
111
139
  def footsteps_viz(footsteps: placo.Footsteps, T: np.ndarray = np.eye(4)) -> None:
112
- """
113
- Visualizes humanoid footsteps
114
-
115
- :param footsteps: footsteps to visualize
116
- :param T: left transformation to apply to the footsteps
117
- """
118
140
  global steps
119
141
  vis = get_viewer()
120
142
 
@@ -132,23 +154,25 @@ def footsteps_viz(footsteps: placo.Footsteps, T: np.ndarray = np.eye(4)) -> None
132
154
  if len(footstep.footsteps) >= 2:
133
155
  color = 0x1111AA
134
156
  else:
135
- color = 0xFF3333 if str(footstep.footsteps[0].side) == "left" else 0x33FF33
157
+ color = (
158
+ 0xFF3333 if str(footstep.footsteps[0].side) == "left" else 0x33FF33
159
+ )
136
160
  else:
137
161
  color = 0xFF3333 if str(footstep.side) == "left" else 0x33FF33
138
162
 
139
- vis["footsteps"][str(k)].set_object(g.LineLoop(g.PointsGeometry(polygon.T), g.MeshBasicMaterial(color=color)))
163
+ vis["footsteps"][str(k)].set_object(
164
+ g.LineLoop(g.PointsGeometry(polygon.T), g.MeshBasicMaterial(color=color))
165
+ )
140
166
 
141
167
 
142
168
  def line_viz(name: str, points: np.ndarray, color: float = 0xFF0000) -> None:
143
169
  """
144
170
  Prints a line
145
-
146
- :param name: name of the line
147
- :param points: points of the line
148
- :param color: color of the line
149
171
  """
150
172
  vis = get_viewer()
151
- vis["lines"][name].set_object(g.LineSegments(g.PointsGeometry(points.T), g.LineBasicMaterial(color=color)))
173
+ vis["lines"][name].set_object(
174
+ g.LineSegments(g.PointsGeometry(points.T), g.LineBasicMaterial(color=color))
175
+ )
152
176
 
153
177
 
154
178
  def arrow_viz(
@@ -160,14 +184,8 @@ def arrow_viz(
160
184
  ) -> None:
161
185
  """
162
186
  Prints an arrow
163
-
164
- :param name: name of the arrow
165
- :param point_from: origin of the arrow
166
- :param point_to: end of the arrow
167
- :param color: color of the arrow
168
- :param radius: radius of the arrow
169
187
  """
170
- head_length = radius*3
188
+ head_length = radius * 3
171
189
  vis = get_viewer()
172
190
  length = np.linalg.norm(point_to - point_from)
173
191
  length = max(1e-3, length - head_length)
@@ -189,43 +207,58 @@ def arrow_viz(
189
207
  T_cylinder = T @ tf.translation_matrix(np.array([0, length / 2.0, 0.0]))
190
208
  T_head = T @ tf.translation_matrix(np.array([0, length + head_length / 2.0, 0.0]))
191
209
 
192
- vis["arrows"][name]["cylinder"].set_object(cylinder, g.MeshBasicMaterial(color=color))
210
+ vis["arrows"][name]["cylinder"].set_object(
211
+ cylinder, g.MeshBasicMaterial(color=color)
212
+ )
193
213
  vis["arrows"][name]["cylinder"].set_transform(T_cylinder)
194
214
  vis["arrows"][name]["head"].set_object(head, g.MeshBasicMaterial(color=color))
195
215
  vis["arrows"][name]["head"].set_transform(T_head)
196
216
 
217
+
197
218
  previous_contacts: int = 0
198
219
 
199
- def contacts_viz(solver: placo.DynamicsSolver, ratio=0.1, radius=0.005):
200
- """
201
- Draws the contacts produced by a dynamics solver
202
220
 
203
- :param solver: solver instance
204
- :param ratio: ratio of the wrench to display
205
- :param radius: radius of the arrows
206
- """
221
+ def contacts_viz(solver: placo.DynamicsSolver, ratio=0.1, radius=0.005):
207
222
  global previous_contacts
208
223
  robot = solver.robot
209
224
  frames = robot.frame_names()
210
-
225
+
211
226
  for k in range(solver.count_contacts()):
212
227
  contact = solver.get_contact(k)
213
228
 
214
229
  if isinstance(contact, placo.PointContact):
215
230
  frame_name = frames[contact.position_task().frame_index]
216
231
  T_world_frame = robot.get_T_world_frame(frame_name)
217
- arrow_viz(f"contact_{k}", T_world_frame[:3, 3], T_world_frame[:3, 3] + contact.wrench * ratio, color=0x00FF00, radius=radius)
232
+ arrow_viz(
233
+ f"contact_{k}",
234
+ T_world_frame[:3, 3],
235
+ T_world_frame[:3, 3] + contact.wrench * ratio,
236
+ color=0x00FF00,
237
+ radius=radius,
238
+ )
218
239
  elif isinstance(contact, placo.Contact6D):
219
240
  frame_name = frames[contact.position_task().frame_index]
220
241
  T_world_frame = robot.get_T_world_frame(frame_name)
221
242
  wrench = T_world_frame[:3, :3] @ contact.wrench[:3]
222
243
  origin = T_world_frame[:3, 3] + T_world_frame[:3, :3] @ contact.zmp()
223
- arrow_viz(f"contact_{k}", origin, origin + wrench * ratio, color=0x00FFAA, radius=radius)
244
+ arrow_viz(
245
+ f"contact_{k}",
246
+ origin,
247
+ origin + wrench * ratio,
248
+ color=0x00FFAA,
249
+ radius=radius,
250
+ )
224
251
  elif isinstance(contact, placo.ExternalWrenchContact):
225
252
  frame_name = frames[contact.frame_index]
226
253
  T_world_frame = robot.get_T_world_frame(frame_name)
227
- arrow_viz(f"contact_{k}", T_world_frame[:3, 3], T_world_frame[:3, 3] + contact.w_ext[:3] * ratio, color=0xFF2222, radius=radius)
228
-
254
+ arrow_viz(
255
+ f"contact_{k}",
256
+ T_world_frame[:3, 3],
257
+ T_world_frame[:3, 3] + contact.w_ext[:3] * ratio,
258
+ color=0xFF2222,
259
+ radius=radius,
260
+ )
261
+
229
262
  vis = get_viewer()
230
263
  while k < previous_contacts:
231
264
  k += 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: placo
3
- Version: 0.3.6
3
+ Version: 0.3.8
4
4
  Summary: PlaCo: Rhoban Planning and Control
5
5
  Requires-Python: >= 3.8
6
6
  License-Expression: MIT
@@ -15,6 +15,7 @@ Requires-Dist: pin >= 2.6.18, < 3
15
15
  Requires-Dist: rhoban-cmeel-jsoncpp
16
16
  Requires-Dist: meshcat
17
17
  Requires-Dist: numpy
18
+ Requires-Dist: ischedule
18
19
  Provides-Extra: build
19
20
  Requires-Dist: pin[build] >= 2.6.18, < 3 ; extra == "build"
20
21
  Requires-Dist: cmeel-urdfdom[build] ; extra == "build"
@@ -0,0 +1,14 @@
1
+ cmeel.prefix/lib/liblibplaco.so,sha256=LA0wX_wjE4-eUV1gVQfvvKU5G6HzWc6-zuDYipFuMmI,2377288
2
+ cmeel.prefix/lib/python3.10/site-packages/placo.pyi,sha256=6e0UoGP1Q5mbOZtjTu2fErtGNF4Cay4yiNHmbBceEsY,152828
3
+ cmeel.prefix/lib/python3.10/site-packages/placo.so,sha256=AKUO5w1YL7C4_DjHeCfxPma2-I94-8sV232cGzYzSTA,9113176
4
+ cmeel.prefix/lib/python3.10/site-packages/placo_utils/__init__.py,sha256=UN-fc5KfBWQ-_qkm0Ajouh-T9tBGm5aUtuzBiH1tRtk,80
5
+ cmeel.prefix/lib/python3.10/site-packages/placo_utils/tf.py,sha256=fFRXNbeLlXzn5VOqYl7hcSuvOOtTDTiLi_Lpd9_l6wA,36
6
+ cmeel.prefix/lib/python3.10/site-packages/placo_utils/visualization.py,sha256=nsO5-1y0itnIOR79-HrQSvS7YEjJmV5MAROULnfX3x8,7590
7
+ cmeel.prefix/lib/python3.10/site-packages/placo_utils/__pycache__/__init__.cpython-310.pyc,sha256=tJrTajdA7hNO9tZkE1oN49rU-61lCNUED-mQXdAvzAs,261
8
+ cmeel.prefix/lib/python3.10/site-packages/placo_utils/__pycache__/tf.cpython-310.pyc,sha256=APWQ5-zKgbEcMnkv6Hxgj_Q46jpnuOyL9YbSrj6Z5Vw,204
9
+ cmeel.prefix/lib/python3.10/site-packages/placo_utils/__pycache__/visualization.cpython-310.pyc,sha256=Yu4t9oM-MHJCjF11e8G6LjCQJFIpqYmoAcA5_yY66y0,6560
10
+ placo-0.3.8.dist-info/license/LICENSE,sha256=q2bBXvk4Eh7TmP11LoIOIGSUuJbR30JBI6ZZ37g52T4,1061
11
+ placo-0.3.8.dist-info/METADATA,sha256=Gs02_iU-AAYYcGfvXydxHjAVhaa41o71W6ivl4GuOik,1643
12
+ placo-0.3.8.dist-info/WHEEL,sha256=GG3aWrINZ6-EfOf2jaRO1SBQfOwv0eJwKe893X49tgU,115
13
+ placo-0.3.8.dist-info/top_level.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ placo-0.3.8.dist-info/RECORD,,
@@ -1,14 +0,0 @@
1
- cmeel.prefix/lib/liblibplaco.so,sha256=urzydnb6NnMOLjsqLhEXVzxTvC-SPzr3bjVxR7gfHKc,2377112
2
- cmeel.prefix/lib/python3.10/site-packages/placo.pyi,sha256=HhW9bu7PlK_eo86uT8hkMIRCCeKmap1X7qZdYthSUGo,151822
3
- cmeel.prefix/lib/python3.10/site-packages/placo.so,sha256=vK-g0qk1bC1pTm2JlkbUwo8yeHYW8Hp-UQbtAiK5HyA,9123808
4
- cmeel.prefix/lib/python3.10/site-packages/placo_utils/__init__.py,sha256=UN-fc5KfBWQ-_qkm0Ajouh-T9tBGm5aUtuzBiH1tRtk,80
5
- cmeel.prefix/lib/python3.10/site-packages/placo_utils/tf.py,sha256=fFRXNbeLlXzn5VOqYl7hcSuvOOtTDTiLi_Lpd9_l6wA,36
6
- cmeel.prefix/lib/python3.10/site-packages/placo_utils/visualization.py,sha256=rY-8ARc8aeOVX9KNAWNX3H9VK3v28TAISRabflxZ00I,7565
7
- cmeel.prefix/lib/python3.10/site-packages/placo_utils/__pycache__/__init__.cpython-310.pyc,sha256=tJrTajdA7hNO9tZkE1oN49rU-61lCNUED-mQXdAvzAs,261
8
- cmeel.prefix/lib/python3.10/site-packages/placo_utils/__pycache__/tf.cpython-310.pyc,sha256=APWQ5-zKgbEcMnkv6Hxgj_Q46jpnuOyL9YbSrj6Z5Vw,204
9
- cmeel.prefix/lib/python3.10/site-packages/placo_utils/__pycache__/visualization.cpython-310.pyc,sha256=dTICIIwrtr6m-s4GOALeJxKg2T9mZThg6cxmNjKbr98,7000
10
- placo-0.3.6.dist-info/license/LICENSE,sha256=q2bBXvk4Eh7TmP11LoIOIGSUuJbR30JBI6ZZ37g52T4,1061
11
- placo-0.3.6.dist-info/METADATA,sha256=MpTFWIVVogDly0Ma5BhsQmmYn-l-tB6dGGA1Bi-RYtk,1618
12
- placo-0.3.6.dist-info/WHEEL,sha256=GG3aWrINZ6-EfOf2jaRO1SBQfOwv0eJwKe893X49tgU,115
13
- placo-0.3.6.dist-info/top_level.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- placo-0.3.6.dist-info/RECORD,,
File without changes