1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
"""Object protocol accepted by ``Robot`` for inverse dynamics."""
"""Return torque values for one robot state."""
...
=
"""Robot model and station-indexed constraint buffer.
``Robot`` owns a Rust robot wrapper and its constraint storage. When
``inverse_dynamics`` is omitted, torque-related methods use the point-mass
convention ``tau = ddq``. Passing a Python callable or an object with an
``inverse_dynamics(q, dq, ddq)`` method enables user-defined dynamics.
The public API uses Python-style method names such as ``append_s`` and
``add_velocity_limits`` while preserving Rust semantics. Matrices default
to ``MatrixLayout.SAMPLE_MAJOR``: rows are station samples and columns are
robot dimensions or constraint rows.
"""
:
"""Robot/path dimension."""
:
"""Number of stored station samples."""
:
"""Allocated station-buffer capacity."""
:
"""Whether no station samples are stored."""
:
"""Active global station-id range ``(idx_s_start, idx_s_end)``."""
:
"""Whether a Python inverse-dynamics callback is installed."""
:
"""Reference proxy for raw constraint-buffer operations.
Each access returns a fresh proxy object that mutates the same robot-owned
constraint buffer.
"""
"""Construct a robot.
Parameters
----------
dim:
Positive robot/path dimension.
capacity:
Optional initial station-buffer capacity.
inverse_dynamics:
Optional callable ``f(q, dq, ddq)`` or object with an
``inverse_dynamics(q, dq, ddq)`` method. The callback receives
contiguous one-dimensional ``float64`` arrays with shape
``(dim,)`` and must return values convertible to a ``float64``
vector of shape ``(dim,)``.
Raises
------
ValueError
If ``dim``, ``capacity``, or the callback protocol is invalid.
"""
...
"""Construct an explicit point-mass robot with ``tau = ddq``.
This is a convenience alias for ``Robot(dim, capacity=capacity)``.
"""
...
"""Return the number of stored station samples."""
...
"""Replace the inverse-dynamics callback.
Existing station and constraint data are preserved. Future torque-limit
construction uses the new callback.
"""
...
"""Restore point-mass torque evaluation ``tau = ddq``."""
...
"""Append a strictly increasing station grid segment.
``s`` may be any one-dimensional ArrayLike value convertible to
``float64``. If the robot already contains stations, ``s[0]`` must be
greater than the current last stored station.
Raises
------
ValueError
If ``s`` cannot be converted to a one-dimensional ``float64`` array.
CoppError
If the Rust constraint buffer rejects the grid.
"""
...
"""Store discrete path derivatives over an existing station interval.
With ``SAMPLE_MAJOR`` layout, each matrix has shape
``(n_samples, dim)``. With ``DIM_MAJOR`` layout, each matrix has shape
``(dim, n_samples)``. ``idx_s`` is the global start station id; it has
no default to avoid accidental writes to the wrong station window.
"""
...
"""Sample ``path`` up to second order and store ``q``, ``dq``, ``ddq``.
The half-open interval ``[idx_s_from, idx_s_to)`` must already exist in
the robot station buffer. Third-order derivative data is cleared over
the written interval.
"""
...
"""Sample ``path`` up to third order and store all derivative matrices."""
...
"""Add axial velocity limits over an existing station interval.
``upper`` values must be positive and ``lower`` values must be
negative. One-dimensional arrays must have length ``dim`` and are
broadcast over the station interval; two-dimensional arrays must match
the selected layout and explicit station length. Dimension broadcasting
is intentionally not supported in the first Python version.
"""
...
"""Add axial acceleration limits over an existing station interval."""
...
"""Add axial jerk limits over an existing station interval."""
...
"""Add axial torque limits using point or Python inverse dynamics.
Any exception raised by the Python inverse-dynamics callback is
propagated unchanged. Wrapper-level callback return-format errors are
reported as ``ValueError``; Rust core errors are reported as
``CoppError``.
"""
...