cookie_description 1.2.1__tar.gz → 1.3.0__tar.gz

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 (39) hide show
  1. {cookie_description-1.2.1 → cookie_description-1.3.0}/CHANGELOG.md +17 -5
  2. {cookie_description-1.2.1 → cookie_description-1.3.0}/PKG-INFO +5 -5
  3. {cookie_description-1.2.1 → cookie_description-1.3.0}/README.md +1 -1
  4. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/__init__.py +1 -4
  5. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/__main__.py +0 -3
  6. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/collision_viser_visualizer.py +7 -10
  7. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/paths.py +0 -3
  8. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/pybullet_simulation.py +0 -3
  9. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/urdf/cookie.urdf +1 -1
  10. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/visualizer.py +55 -51
  11. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/xacro/torso.xacro +1 -1
  12. {cookie_description-1.2.1 → cookie_description-1.3.0}/pyproject.toml +27 -17
  13. {cookie_description-1.2.1 → cookie_description-1.3.0}/BUILD +0 -0
  14. {cookie_description-1.2.1 → cookie_description-1.3.0}/LICENSE +0 -0
  15. {cookie_description-1.2.1 → cookie_description-1.3.0}/NOTICE +0 -0
  16. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/meshes/ankle_stator.stl +0 -0
  17. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/meshes/knee_bumper.stl +0 -0
  18. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/meshes/knee_stator.stl +0 -0
  19. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/meshes/mj5208_rotor.stl +0 -0
  20. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/meshes/mj5208_stator.stl +0 -0
  21. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/meshes/oak_d_lite.stl +0 -0
  22. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/meshes/power_connector.stl +0 -0
  23. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/meshes/qdd100_rotor.stl +0 -0
  24. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/meshes/qdd100_stator.stl +0 -0
  25. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/meshes/rotor_connector.stl +0 -0
  26. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/meshes/torso.stl +0 -0
  27. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/meshes/wheel_hub.stl +0 -0
  28. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/meshes/wheel_tire.stl +0 -0
  29. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/xacro/cookie.xacro +0 -0
  30. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/xacro/leg.xacro +0 -0
  31. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/xacro/materials.xacro +0 -0
  32. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/xacro/utils/box_collision_inertial.xacro +0 -0
  33. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/xacro/utils/box_inertial.xacro +0 -0
  34. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/xacro/utils/bumper_segment.xacro +0 -0
  35. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/xacro/utils/cylinder_collision_inertial.xacro +0 -0
  36. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/xacro/utils/cylinder_inertial.xacro +0 -0
  37. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/xacro/utils/mj5208_joint.xacro +0 -0
  38. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/xacro/utils/qdd100_joint.xacro +0 -0
  39. {cookie_description-1.2.1 → cookie_description-1.3.0}/cookie_description/xacro/utils/virtual_link.xacro +0 -0
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.3.0] - 2026-06-27
11
+
12
+ ### Changed
13
+
14
+ - pixi: Rename `setup-dev` task to `local-setup`
15
+ - visualizer: Clamp infinite joint limits to [-pi, pi] for each bound separately
16
+ - visualizer: Use the Viser visualizer from Pinker
17
+
18
+ ### Fixed
19
+
20
+ - Fix IMU frame orientation to match the physical mounting on Cookie
21
+
10
22
  ## [1.2.1] - 2026-06-27
11
23
 
12
24
  ### Added
@@ -54,8 +66,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
54
66
 
55
67
  Start this changelog.
56
68
 
57
- [unreleased]: https://codeberg.org/stephane-caron/cookie_description/compare/v1.2.1...main
58
- [1.2.1]: https://codeberg.org/stephane-caron/cookie_description/releases/tag/v1.2.1
59
- [1.2.0]: https://codeberg.org/stephane-caron/cookie_description/releases/tag/v1.2.0
60
- [1.1.0]: https://codeberg.org/stephane-caron/cookie_description/releases/tag/v1.1.0
61
- [1.0.0]: https://codeberg.org/stephane-caron/cookie_description/releases/tag/v1.0.0
69
+ [unreleased]: https://codeberg.org/upkie/cookie_description/compare/v1.2.1...main
70
+ [1.2.1]: https://codeberg.org/upkie/cookie_description/releases/tag/v1.2.1
71
+ [1.2.0]: https://codeberg.org/upkie/cookie_description/releases/tag/v1.2.0
72
+ [1.1.0]: https://codeberg.org/upkie/cookie_description/releases/tag/v1.1.0
73
+ [1.0.0]: https://codeberg.org/upkie/cookie_description/releases/tag/v1.0.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cookie_description
3
- Version: 1.2.1
3
+ Version: 1.3.0
4
4
  Summary: Robot description for Cookie.
5
5
  Author-email: Stéphane Caron <stephane.caron@normalesup.org>
6
6
  Maintainer-email: Stéphane Caron <stephane.caron@normalesup.org>
@@ -18,9 +18,9 @@ Classifier: Programming Language :: Python :: 3.13
18
18
  Classifier: Topic :: Scientific/Engineering :: Mathematics
19
19
  Classifier: Topic :: Scientific/Engineering :: Physics
20
20
  License-File: LICENSE
21
- Project-URL: Changelog, https://codeberg.org/stephane-caron/cookie_description/blob/master/CHANGELOG.md
22
- Project-URL: Source, https://codeberg.org/stephane-caron/cookie_description
23
- Project-URL: Tracker, https://codeberg.org/stephane-caron/cookie_description/issues
21
+ Project-URL: Changelog, https://codeberg.org/upkie/cookie_description/src/branch/main/CHANGELOG.md
22
+ Project-URL: Source, https://codeberg.org/upkie/cookie_description
23
+ Project-URL: Tracker, https://codeberg.org/upkie/cookie_description/issues
24
24
 
25
25
  # Cookie wheeled biped robot
26
26
 
@@ -48,7 +48,7 @@ Or similarly with [uv](https://docs.astral.sh/uv/):
48
48
 
49
49
  ```shell
50
50
  # Display a Cookie in Viser
51
- uvx --with numpy --with pin --with viser --with watchdog --with xacrodoc cookie_description visualize
51
+ uvx --with numpy --with pinker --with viser --with watchdog --with xacrodoc cookie_description visualize
52
52
 
53
53
  # Simulate a Cookie in PyBullet
54
54
  uvx --with loop-rate-limiters --with pybullet cookie_description load-in-pybullet
@@ -24,7 +24,7 @@ Or similarly with [uv](https://docs.astral.sh/uv/):
24
24
 
25
25
  ```shell
26
26
  # Display a Cookie in Viser
27
- uvx --with numpy --with pin --with viser --with watchdog --with xacrodoc cookie_description visualize
27
+ uvx --with numpy --with pinker --with viser --with watchdog --with xacrodoc cookie_description visualize
28
28
 
29
29
  # Simulate a Cookie in PyBullet
30
30
  uvx --with loop-rate-limiters --with pybullet cookie_description load-in-pybullet
@@ -1,13 +1,10 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
- #
4
1
  # SPDX-License-Identifier: Apache-2.0
5
2
 
6
3
  """Robot description for Cookie."""
7
4
 
8
5
  from .paths import MESHES_PATH, PATH, URDF_PATH, XACRO_PATH
9
6
 
10
- __version__ = "1.2.1"
7
+ __version__ = "1.3.0"
11
8
 
12
9
  __all__ = [
13
10
  "MESHES_PATH",
@@ -1,6 +1,3 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
- #
4
1
  # SPDX-License-Identifier: Apache-2.0
5
2
 
6
3
  """Entry point for ``uvx cookie_description <command>``."""
@@ -1,14 +1,11 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
- #
4
1
  # SPDX-License-Identifier: Apache-2.0
5
2
 
6
3
  """ViserVisualizer that renders collision geometries as wireframes."""
7
4
 
8
- from pinocchio import visualize
5
+ from pinker.visualizer import ViserVisualizer
9
6
 
10
7
 
11
- class CollisionViserVisualizer(visualize.ViserVisualizer):
8
+ class CollisionViserVisualizer(ViserVisualizer):
12
9
  """ViserVisualizer that renders collision geometries as wireframes.
13
10
 
14
11
  While making Cookie's URDF, it is useful to overlay collision meshes on top
@@ -22,13 +19,13 @@ class CollisionViserVisualizer(visualize.ViserVisualizer):
22
19
  _visual_handles: list # list of (handle, parent_frame_id) pairs
23
20
  _collision_handles: list # list of (handle, parent_frame_id) pairs
24
21
 
25
- def loadViewerModel(self, *args, **kwargs):
22
+ def load_viewer_model(self, *args, **kwargs):
26
23
  """Reset tracked handles before (re)loading the model."""
27
24
  self._visual_handles = []
28
25
  self._collision_handles = []
29
- super().loadViewerModel(*args, **kwargs)
26
+ super().load_viewer_model(*args, **kwargs)
30
27
 
31
- def loadViewerGeometryObject(self, geometry_object, prefix="", color=None):
28
+ def load_viewer_geometry_object(self, geometry_object, prefix, color=None):
32
29
  """Load geometry object with wireframe rendering for collision meshes.
33
30
 
34
31
  Temporarily patches the Viser scene creation methods to inject
@@ -40,7 +37,7 @@ class CollisionViserVisualizer(visualize.ViserVisualizer):
40
37
  _METHODS = ("add_box", "add_icosphere", "add_mesh_simple")
41
38
 
42
39
  is_collision = "collision" in prefix
43
- parent_frame = int(geometry_object.parentFrame)
40
+ parent_frame = int(geometry_object.parent_frame)
44
41
 
45
42
  for method_name in _METHODS:
46
43
  original = getattr(scene, method_name)
@@ -67,7 +64,7 @@ class CollisionViserVisualizer(visualize.ViserVisualizer):
67
64
  setattr(scene, method_name, patched)
68
65
 
69
66
  try:
70
- super().loadViewerGeometryObject(geometry_object, prefix, color)
67
+ super().load_viewer_geometry_object(geometry_object, prefix, color)
71
68
  finally:
72
69
  for method_name in _METHODS:
73
70
  delattr(scene, method_name)
@@ -1,6 +1,3 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
- #
4
1
  # SPDX-License-Identifier: Apache-2.0
5
2
 
6
3
  """Paths to the URDF package and main description for Cookie."""
@@ -1,6 +1,3 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
- #
4
1
  # SPDX-License-Identifier: Apache-2.0
5
2
 
6
3
  """Load a Cookie robot in PyBullet and make it move its legs."""
@@ -577,7 +577,7 @@
577
577
  <joint name="imu_placement" type="fixed">
578
578
  <parent link="torso"/>
579
579
  <child link="imu"/>
580
- <origin rpy="3.141592653589793 0 3.141592653589793" xyz="0 -0.08 0.02"/>
580
+ <origin rpy="1.5707963267948966 0 3.141592653589793" xyz="0 -0.08 0.02"/>
581
581
  </joint>
582
582
  <!-- OAK-D Lite -->
583
583
  <link name="oak_d_lite">
@@ -1,6 +1,3 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
- #
4
1
  # SPDX-License-Identifier: Apache-2.0
5
2
 
6
3
  """Interactive Viser visualizer for the Cookie robot description."""
@@ -9,8 +6,14 @@ import os
9
6
  import time
10
7
 
11
8
  import numpy as np
12
- import pinocchio as pin
9
+ import viser
13
10
  import xacrodoc
11
+ from pinker import load_robot_urdf
12
+ from pinker.kinematics import (
13
+ FrameType,
14
+ frames_forward_kinematics,
15
+ quaternion_wxyz,
16
+ )
14
17
  from watchdog.events import FileSystemEventHandler
15
18
  from watchdog.observers import Observer
16
19
 
@@ -20,30 +23,35 @@ from .paths import PATH, URDF_PATH, XACRO_PATH
20
23
  _VIRTUAL_LINK_MASS = 0.001 # 1 gram
21
24
 
22
25
 
26
+ def _wxyz(rotation) -> tuple:
27
+ """Quaternion (w, x, y, z) of a rotation matrix, as Viser expects it."""
28
+ return tuple(float(x) for x in quaternion_wxyz(rotation))
29
+
30
+
23
31
  def joint_focus_frames(model):
24
32
  """Return {joint_name: frozenset of parent+child link frame IDs}.
25
33
 
26
- For each non-fixed joint j, pinocchio's JOINT frame stores the parent
27
- link's frame ID in previousFrame (populated by the URDF parser). The
28
- child link's frame is the BODY frame sharing the same parent joint.
34
+ For each non-fixed joint j, the JOINT frame stores the parent link's
35
+ frame ID in parent_frame (populated by the URDF parser). The child link's
36
+ frame is the BODY frame sharing the same parent joint.
29
37
  """
30
38
  joint_frame = {} # joint_id -> index of its JOINT frame
31
39
  child_frame = {} # joint_id -> index of its child BODY frame
32
40
  for i, f in enumerate(model.frames):
33
- if f.parentJoint == 0:
41
+ if f.parent_joint == 0:
34
42
  continue
35
- if f.type == pin.FrameType.JOINT:
36
- joint_frame[f.parentJoint] = i
37
- elif f.type == pin.FrameType.BODY:
38
- if f.parentJoint not in child_frame:
39
- child_frame[f.parentJoint] = i
43
+ if f.type == FrameType.JOINT:
44
+ joint_frame[f.parent_joint] = i
45
+ elif f.type == FrameType.BODY:
46
+ if f.parent_joint not in child_frame:
47
+ child_frame[f.parent_joint] = i
40
48
  result = {}
41
49
  for j in range(1, model.njoints):
42
50
  jf = joint_frame.get(j)
43
51
  cf = child_frame.get(j)
44
52
  if jf is None or cf is None:
45
53
  continue
46
- result[model.names[j]] = frozenset([model.frames[jf].parentFrame, cf])
54
+ result[model.names[j]] = frozenset([model.frames[jf].parent_frame, cf])
47
55
  return result
48
56
 
49
57
 
@@ -55,8 +63,8 @@ def joint_dropdown_options(model):
55
63
  def link_focus_map(model, visual_model):
56
64
  """Return {link_name: frame_id} for links that have visual geometry."""
57
65
  seen = {}
58
- for go in visual_model.geometryObjects:
59
- fid = int(go.parentFrame)
66
+ for go in visual_model.geometry_objects:
67
+ fid = int(go.parent_frame)
60
68
  if fid not in seen:
61
69
  seen[fid] = model.frames[fid].name
62
70
  return {name: fid for fid, name in sorted(seen.items())}
@@ -70,14 +78,13 @@ def link_dropdown_options(lf_map):
70
78
  def virtual_link_frame_ids(model):
71
79
  """Return frame indices of virtual links (mass=1 g, zero inertia tensor).
72
80
 
73
- Uses frame.inertia available in Pinocchio 3.x, which stores the original
74
- per-frame inertia before fixed-joint merging.
81
+ Uses frame.inertia, which stores the original per-frame inertia before
82
+ fixed-joint merging.
75
83
  """
76
84
  return [
77
85
  i
78
86
  for i, frame in enumerate(model.frames)
79
- if hasattr(frame, "inertia")
80
- and abs(frame.inertia.mass - _VIRTUAL_LINK_MASS) < 1e-9
87
+ if abs(frame.inertia.mass - _VIRTUAL_LINK_MASS) < 1e-9
81
88
  and np.linalg.norm(frame.inertia.inertia) < 1e-12
82
89
  ]
83
90
 
@@ -107,9 +114,8 @@ class Visualizer:
107
114
  self._joint_focus_handle = None
108
115
  self._joint_focus_jid = None
109
116
 
110
- self._viz = CollisionViserVisualizer()
111
- self._viz.initViewer(open=False)
112
- self._viewer = self._viz.viewer
117
+ self._viz = None
118
+ self._viewer = viser.ViserServer()
113
119
 
114
120
  self._setup_scene()
115
121
  self._load_model()
@@ -137,20 +143,20 @@ class Visualizer:
137
143
  URDF_PATH,
138
144
  use_protocols=True,
139
145
  )
140
- self._robot = pin.RobotWrapper.BuildFromURDF(
141
- filename=URDF_PATH,
146
+ self._robot = load_robot_urdf(
147
+ URDF_PATH,
142
148
  package_dirs=[PATH, os.path.dirname(PATH)],
143
149
  )
144
- self._viz.model = self._robot.model
145
- self._viz.collision_model = self._robot.collision_model
146
- self._viz.visual_model = self._robot.visual_model
147
- self._viz.data = self._robot.model.createData()
148
- self._viz.collision_data = self._robot.collision_model.createData()
149
- self._viz.visual_data = self._robot.visual_model.createData()
150
- self._viz.loadViewerModel(collision_color=[1.0, 0.0, 0.0, 1.0])
151
- self._viz.displayCollisions(True)
152
- self._viz.displayVisuals(True)
153
- self._viz.displayFrames(False)
150
+ self._viz = CollisionViserVisualizer(
151
+ self._robot.model,
152
+ visual_model=self._robot.visual_model,
153
+ collision_model=self._robot.collision_model,
154
+ )
155
+ self._viz.init_viewer(viewer=self._viewer)
156
+ self._viz.load_viewer_model(collision_color=[1.0, 0.0, 0.0, 1.0])
157
+ self._viz.display_collisions(True)
158
+ self._viz.display_visuals(True)
159
+ self._viz.display_frames(False)
154
160
 
155
161
  def _unload_model(self):
156
162
  for frame in self._viz.frames.values():
@@ -216,7 +222,7 @@ class Visualizer:
216
222
  self._link_dropdown.value = "(none)"
217
223
  self._remove_link_frame()
218
224
  self._current_focus_frames = self._focus_frames[name]
219
- self._joint_focus_jid = int(self._viz.model.getJointId(name))
225
+ self._joint_focus_jid = int(self._viz.model.get_joint_id(name))
220
226
  self._viz.set_joint_focus(self._focus_frames[name])
221
227
 
222
228
  self._link_dropdown = gui.add_dropdown(
@@ -282,14 +288,14 @@ class Visualizer:
282
288
  continue
283
289
  idx = joint.idx_q
284
290
  name = model.names[j]
285
- lower = float(model.lowerPositionLimit[idx])
286
- upper = float(model.upperPositionLimit[idx])
291
+ lower = float(model.lower_position_limit[idx])
292
+ upper = float(model.upper_position_limit[idx])
287
293
  if lower >= upper:
288
294
  lower = -np.pi
289
295
  upper = np.pi
290
- elif lower < -1e10:
296
+ if lower < -1e10:
291
297
  lower = -np.pi
292
- elif upper > 1e10:
298
+ if upper > 1e10:
293
299
  upper = np.pi
294
300
  default = float(
295
301
  np.clip(saved_values.get(name, 0.0), lower, upper)
@@ -369,7 +375,9 @@ class Visualizer:
369
375
  self._joint_dropdown.value = prev_joint
370
376
  self._link_dropdown.value = "(none)"
371
377
  self._current_focus_frames = self._focus_frames[prev_joint]
372
- self._joint_focus_jid = int(self._viz.model.getJointId(prev_joint))
378
+ self._joint_focus_jid = int(
379
+ self._viz.model.get_joint_id(prev_joint)
380
+ )
373
381
  elif prev_link != "(none)" and prev_link in self._lf_map:
374
382
  self._joint_dropdown.value = "(none)"
375
383
  self._link_dropdown.value = prev_link
@@ -393,12 +401,11 @@ class Visualizer:
393
401
 
394
402
  def _update_virtual_frames(self, q):
395
403
  if self._virtual_frames_checkbox.value and self._virt_fids:
396
- pin.framesForwardKinematics(self._viz.model, self._viz.data, q)
404
+ frames_forward_kinematics(self._viz.model, self._viz.data, q)
397
405
  for fid in self._virt_fids:
398
406
  name = self._viz.model.frames[fid].name
399
407
  placement = self._viz.data.oMf[fid]
400
- quat = pin.Quaternion(placement.rotation)
401
- wxyz = (quat.w, quat.x, quat.y, quat.z)
408
+ wxyz = _wxyz(placement.rotation)
402
409
  pos = tuple(placement.translation)
403
410
  if name in self._virt_handles:
404
411
  self._virt_handles[name].wxyz = wxyz
@@ -431,11 +438,10 @@ class Visualizer:
431
438
  def _update_link_frame(self, q):
432
439
  if self._link_frame_fid is None:
433
440
  return
434
- pin.framesForwardKinematics(self._viz.model, self._viz.data, q)
441
+ frames_forward_kinematics(self._viz.model, self._viz.data, q)
435
442
  fid = self._link_frame_fid
436
443
  placement = self._viz.data.oMf[fid]
437
- quat = pin.Quaternion(placement.rotation)
438
- wxyz = (quat.w, quat.x, quat.y, quat.z)
444
+ wxyz = _wxyz(placement.rotation)
439
445
  pos = tuple(placement.translation)
440
446
  if self._link_frame_handle is not None:
441
447
  self._link_frame_handle.wxyz = wxyz
@@ -453,8 +459,7 @@ class Visualizer:
453
459
  if self._joint_focus_jid is None:
454
460
  return
455
461
  placement = self._viz.data.oMi[self._joint_focus_jid]
456
- quat = pin.Quaternion(placement.rotation)
457
- wxyz = (quat.w, quat.x, quat.y, quat.z)
462
+ wxyz = _wxyz(placement.rotation)
458
463
  pos = tuple(placement.translation)
459
464
  if self._joint_focus_handle is not None:
460
465
  self._joint_focus_handle.wxyz = wxyz
@@ -473,8 +478,7 @@ class Visualizer:
473
478
  for j in range(1, self._viz.model.njoints):
474
479
  name = self._viz.model.names[j]
475
480
  placement = self._viz.data.oMi[j]
476
- quat = pin.Quaternion(placement.rotation)
477
- wxyz = (quat.w, quat.x, quat.y, quat.z)
481
+ wxyz = _wxyz(placement.rotation)
478
482
  pos = tuple(placement.translation)
479
483
  if name in self._joint_handles:
480
484
  self._joint_handles[name].wxyz = wxyz
@@ -95,7 +95,7 @@
95
95
  <joint name="imu_placement" type="fixed">
96
96
  <parent link="torso" />
97
97
  <child link="imu" />
98
- <origin rpy="3.141592653589793 0 3.141592653589793" xyz="0 -0.08 0.02" />
98
+ <origin rpy="1.5707963267948966 0 3.141592653589793" xyz="0 -0.08 0.02" />
99
99
  </joint>
100
100
 
101
101
  <!-- OAK-D Lite -->
@@ -32,9 +32,9 @@ dependencies = []
32
32
  cookie_description = "cookie_description.__main__:main"
33
33
 
34
34
  [project.urls]
35
- Source = "https://codeberg.org/stephane-caron/cookie_description"
36
- Tracker = "https://codeberg.org/stephane-caron/cookie_description/issues"
37
- Changelog = "https://codeberg.org/stephane-caron/cookie_description/blob/master/CHANGELOG.md"
35
+ Source = "https://codeberg.org/upkie/cookie_description"
36
+ Tracker = "https://codeberg.org/upkie/cookie_description/issues"
37
+ Changelog = "https://codeberg.org/upkie/cookie_description/src/branch/main/CHANGELOG.md"
38
38
 
39
39
  [tool.flit.sdist]
40
40
  include = [
@@ -97,7 +97,7 @@ platforms = ["linux-64"]
97
97
  [tool.pixi.pypi-dependencies]
98
98
  cookie_description = { path = ".", editable = true }
99
99
 
100
- [tool.pixi.tasks.setup-dev]
100
+ [tool.pixi.tasks.local-setup]
101
101
  cmd = "bash scripts/create_symlinks.sh"
102
102
  description = "Create symlinks to use the Python module locally"
103
103
 
@@ -114,7 +114,14 @@ ruff = ">=0.2.2"
114
114
  _mypy = "mypy cookie_description"
115
115
  _pylint = "pylint cookie_description --exit-zero"
116
116
  _ruff = "ruff check cookie_description && ruff format --check cookie_description"
117
- lint-code = { depends-on = ["_mypy", "_pylint", "_ruff"] }
117
+
118
+ [tool.pixi.feature.lint.tasks.format]
119
+ cmd = "ruff check cookie_description --fix && ruff format cookie_description"
120
+ description = "Format the Python code of the module with ruff"
121
+
122
+ [tool.pixi.feature.lint.tasks.lint]
123
+ depends-on = ["_mypy", "_pylint", "_ruff"]
124
+ description = "Lint the Python module with mypy, pylint and ruff"
118
125
 
119
126
  # ---------------------------------------------------------------------------
120
127
  # Pixi feature: test
@@ -123,8 +130,9 @@ lint-code = { depends-on = ["_mypy", "_pylint", "_ruff"] }
123
130
  [tool.pixi.feature.make-urdf.pypi-dependencies]
124
131
  xacrodoc = ">=2.0.0"
125
132
 
126
- [tool.pixi.feature.make-urdf.tasks]
127
- make-urdf = "cd xacro && python -c \"import xacrodoc; xacrodoc.XacroDoc.from_file('cookie.xacro', resolve_packages=False).to_urdf_file('../urdf/cookie.urdf', use_protocols=True)\""
133
+ [tool.pixi.feature.make-urdf.tasks.make-urdf]
134
+ cmd = "cd xacro && python -c \"import xacrodoc; xacrodoc.XacroDoc.from_file('cookie.xacro', resolve_packages=False).to_urdf_file('../urdf/cookie.urdf', use_protocols=True)\""
135
+ description = "Generate the URDF file from the Xacro description"
128
136
 
129
137
  # ---------------------------------------------------------------------------
130
138
  # Pixi feature: simulation
@@ -135,39 +143,41 @@ numpy = "*"
135
143
  loop-rate-limiters = "*"
136
144
  pybullet = "*"
137
145
 
138
- [tool.pixi.feature.simulation.tasks]
139
- load-in-pybullet = { cmd = "python -m cookie_description.pybullet_simulation" }
146
+ [tool.pixi.feature.simulation.tasks.pybullet]
147
+ cmd = "python -m cookie_description.pybullet_simulation"
148
+ description = "Simulate a Cookie moving its legs in PyBullet"
140
149
 
141
150
  # ---------------------------------------------------------------------------
142
151
  # Pixi feature: test
143
152
  # ---------------------------------------------------------------------------
144
153
 
145
- [tool.pixi.feature.test.dependencies]
146
- pinocchio = ">=3.0.0"
147
-
148
154
  [tool.pixi.feature.test.pypi-dependencies]
149
155
  numpy = "*"
150
156
  pytest = "*"
157
+ upkie = ">=11.0.0"
151
158
 
152
- [tool.pixi.feature.test.tasks.check-description]
159
+ [tool.pixi.feature.test.tasks.test]
153
160
  cmd = "pytest tests/"
154
- depends-on = ["setup-dev", "make-urdf"]
161
+ depends-on = ["local-setup", "make-urdf"]
162
+ description = "Run unit tests on the generated URDF description"
155
163
 
156
164
  # ---------------------------------------------------------------------------
157
165
  # Pixi feature: visualizer
158
166
  # ---------------------------------------------------------------------------
159
167
 
160
168
  [tool.pixi.feature.visualizer.dependencies]
169
+ c-compiler = "*" # build pinker's C extension from source
161
170
  numpy = "*"
162
- pinocchio = ">=3.0.0"
163
171
 
164
172
  [tool.pixi.feature.visualizer.pypi-dependencies]
173
+ pinker = ">=1.3.0"
165
174
  viser = "*"
166
175
  watchdog = "*"
167
176
  xacrodoc = ">=2.0.0"
168
177
 
169
- [tool.pixi.feature.visualizer.tasks]
170
- visualize = { cmd = "python -m cookie_description.visualizer" }
178
+ [tool.pixi.feature.visualizer.tasks.visualize]
179
+ cmd = "python -m cookie_description.visualizer"
180
+ description = "Display a Cookie in Viser, reloading on Xacro changes"
171
181
 
172
182
  # ---------------------------------------------------------------------------
173
183
  # Pixi environments