mink 0.0.4__py3-none-any.whl → 0.0.5__py3-none-any.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.
@@ -4,7 +4,7 @@ import mujoco
4
4
  import numpy as np
5
5
 
6
6
  from ..configuration import Configuration
7
- from ..constants import qpos_width
7
+ from ..constants import dof_width, qpos_width
8
8
  from .exceptions import LimitDefinitionError
9
9
  from .limit import Constraint, Limit
10
10
 
@@ -39,18 +39,21 @@ class ConfigurationLimit(Limit):
39
39
  )
40
40
 
41
41
  index_list: list[int] = [] # DoF indices that are limited.
42
- lower = np.full(model.nq, -np.inf)
43
- upper = np.full(model.nq, np.inf)
42
+ lower = np.full(model.nq, -mujoco.mjMAXVAL)
43
+ upper = np.full(model.nq, mujoco.mjMAXVAL)
44
44
  for jnt in range(model.njnt):
45
45
  jnt_type = model.jnt_type[jnt]
46
46
  qpos_dim = qpos_width(jnt_type)
47
47
  jnt_range = model.jnt_range[jnt]
48
48
  padr = model.jnt_qposadr[jnt]
49
+ # Skip free joints and joints without limits.
49
50
  if jnt_type == mujoco.mjtJoint.mjJNT_FREE or not model.jnt_limited[jnt]:
50
51
  continue
51
52
  lower[padr : padr + qpos_dim] = jnt_range[0] + min_distance_from_limits
52
53
  upper[padr : padr + qpos_dim] = jnt_range[1] - min_distance_from_limits
53
- index_list.append(model.jnt_dofadr[jnt])
54
+ jnt_dim = dof_width(jnt_type)
55
+ jnt_id = model.jnt_dofadr[jnt]
56
+ index_list.extend(range(jnt_id, jnt_id + jnt_dim))
54
57
 
55
58
  self.indices = np.array(index_list)
56
59
  self.indices.setflags(write=False)
@@ -89,9 +92,11 @@ class ConfigurationLimit(Limit):
89
92
  :math:`G \Delta q \leq h`, or ``None`` if there is no limit.
90
93
  """
91
94
  del dt # Unused.
95
+ if self.projection_matrix is None:
96
+ return Constraint()
92
97
 
93
98
  # Upper.
94
- delta_q_max = np.zeros(self.model.nv)
99
+ delta_q_max = np.zeros((self.model.nv,))
95
100
  mujoco.mj_differentiatePos(
96
101
  m=self.model,
97
102
  qvel=delta_q_max,
@@ -101,7 +106,7 @@ class ConfigurationLimit(Limit):
101
106
  )
102
107
 
103
108
  # Lower.
104
- delta_q_min = np.zeros(self.model.nv)
109
+ delta_q_min = np.zeros((self.model.nv,))
105
110
  mujoco.mj_differentiatePos(
106
111
  m=self.model,
107
112
  qvel=delta_q_min,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mink
3
- Version: 0.0.4
3
+ Version: 0.0.5
4
4
  Summary: mink: MuJoCo inverse kinematics.
5
5
  Keywords: inverse,kinematics,mujoco
6
6
  Author-email: Kevin Zakka <zakka@berkeley.edu>
@@ -33,6 +33,8 @@ Requires-Dist: coveralls ; extra == "test"
33
33
  Requires-Dist: pytest ; extra == "test"
34
34
  Requires-Dist: robot_descriptions >= 1.9.0 ; extra == "test"
35
35
  Project-URL: Changelog, https://github.com/kevinzakka/mink/blob/main/CHANGELOG.md
36
+ Project-URL: Documentation, https://kevinzakka.github.io/mink/
37
+ Project-URL: Homepage, https://kevinzakka.github.io/mink/
36
38
  Project-URL: Source, https://github.com/kevinzakka/mink
37
39
  Project-URL: Tracker, https://github.com/kevinzakka/mink/issues
38
40
  Provides-Extra: all
@@ -58,6 +60,20 @@ Features include:
58
60
 
59
61
  For usage and API reference, see the [documentation](https://kevinzakka.github.io/mink/).
60
62
 
63
+ If you use mink in your research, please cite it as follows:
64
+
65
+ ```bibtex
66
+ @software{Zakka_Mink_Python_inverse_2024,
67
+ author = {Zakka, Kevin},
68
+ license = {Apache-2.0},
69
+ month = jul,
70
+ title = {{Mink: Python inverse kinematics based on MuJoCo}},
71
+ url = {https://github.com/kevinzakka/mink},
72
+ version = {0.0.4},
73
+ year = {2024}
74
+ }
75
+ ```
76
+
61
77
  ## Installation
62
78
 
63
79
  You can install `mink` using `pip`:
@@ -333,7 +333,7 @@ mink/lie/so3.py,sha256=LkjciJHcVTWYzpDzAo1KuUI7xy0HPnSGAYxQS_q-Kx4,7302
333
333
  mink/lie/utils.py,sha256=DuEl3pj84daLvMKN84-YBvkXnJfqvc5vpvJ9J-pJ11U,403
334
334
  mink/limits/__init__.py,sha256=hX5Dgpri9AE6YtUCkW79AXMBuNAuBhniR9kQ6Rxwv3Y,416
335
335
  mink/limits/collision_avoidance_limit.py,sha256=pVLpkruWAqrOcAW4yulHc_hIuczMR4EbrXF1x-0Bb80,10973
336
- mink/limits/configuration_limit.py,sha256=80fZ3uZX14OYeQVwpNlL7ayRC25p8ofRguCjF_6ehok,4088
336
+ mink/limits/configuration_limit.py,sha256=areR-8NuuD15wWzPhyQIRtttIdfXPlT3hP81MuDbIN0,4351
337
337
  mink/limits/exceptions.py,sha256=EnVKgFhUJFM6rNVCtdngb-XMu66PWKMFSDy-XkdKzr8,178
338
338
  mink/limits/limit.py,sha256=feF9yjgLHWShnuSrJNOH-PfMWtEMRGQi2mDiRia9tFg,1578
339
339
  mink/limits/velocity_limit.py,sha256=2zPOAb69V9RusKk-U4cJ0lK3-Ek9g4nvr3c8QHbixzw,3506
@@ -345,6 +345,6 @@ mink/tasks/frame_task.py,sha256=DeNg-bEJxqnrRI0FaJK4UHyb8CyF4A7uPF9G-CdN0sg,5307
345
345
  mink/tasks/posture_task.py,sha256=sVDZyalCh5DP8zmCuX5kYuZxiMxRut_mTZUjv5y3b5M,3998
346
346
  mink/tasks/relative_frame_task.py,sha256=9rIiYocI1eEESt0bLZZpQR7K6ggVRZH8iEhdhzkfZa0,5119
347
347
  mink/tasks/task.py,sha256=F16YZT1L9ueNOcKoOhbCyEnZw0DOgrmjqADl0jahVQI,4838
348
- mink-0.0.4.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
349
- mink-0.0.4.dist-info/METADATA,sha256=XveK_-Kgek1t-psZdeJ4vSRThf3pg7uuKvO1CYW9394,5045
350
- mink-0.0.4.dist-info/RECORD,,
348
+ mink-0.0.5.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
349
+ mink-0.0.5.dist-info/METADATA,sha256=IWndykbTUh_K9MyGE_cAojds8tqJJFOJLBma1nXF-Fo,5501
350
+ mink-0.0.5.dist-info/RECORD,,
File without changes