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
"""Linearized TOPP3 problem descriptor.
``Topp3Problem`` stores a reference to a ``Constraints`` proxy and an owned
copy of ``a_linearization``. Construction immediately rebuilds the Rust
TOPP3 problem and linearizes third-order jerk constraints into the
constraint buffer's cached affine rows. Calling ``validate()`` later repeats
that linearization against the current constraints.
``num_stationary_max`` accepts either an integer shorthand or an explicit
``(start, end)`` pair. The integer shorthand is the recommended Python
style: ``num_stationary_max=1`` means ``(1, 1)``.
Examples
--------
Construct a TOPP3 problem from ``robot.constraints``::
a_linearization = np.ones(len(robot), dtype=np.float64)
problem = copp.solver.topp3_lp.Problem(
robot.constraints,
a_linearization,
idx_s_start=0,
a_boundary=(0.0, 0.0),
b_boundary=(0.0, 0.0),
num_stationary_max=1,
)
"""
"""Constraint proxy referenced by this immutable descriptor."""
...
"""Copy of the reference profile used to linearize third-order constraints."""
...
"""Start station index of the optimization interval."""
...
"""Final station index implied by ``a_linearization``."""
...
"""Boundary values ``(a_start, a_final)``."""
...
"""Boundary values ``(b_start, b_final)``."""
...
"""Stationary-interval upper bounds as ``(start, end)``."""
...
"""Denominator floor used by third-order linearization."""
...
"""Number of station samples in this TOPP3 interval."""
...
"""Construct and immediately linearize a TOPP3 problem descriptor.
Parameters
----------
constraints:
Usually ``robot.constraints``.
a_linearization:
One-dimensional ArrayLike reference profile convertible to
``float64``. The descriptor stores a copy.
idx_s_start:
Start station index of the optimization interval. The final index
is ``idx_s_start + len(a_linearization) - 1``.
a_boundary:
Boundary values of ``a = (ds/dt)^2`` at the start and final
station.
b_boundary:
Boundary values of ``b = dds/dt`` at the start and final station.
num_stationary_max:
Stationary-boundary upper bound. ``1`` means ``(1, 1)``.
a_linearization_floor:
Positive denominator floor used when linearizing third-order
constraints near ``a = 0``.
Raises
------
ValueError
If ``a_linearization`` cannot be converted to a one-dimensional
``float64`` array, or if ``num_stationary_max`` is not an integer
or integer pair.
CoppError
If Rust validation or third-order constraint linearization fails.
"""
...
"""Rebuild the Rust TOPP3 problem and refresh jerk linearization.
This method may update cached third-order affine rows in the referenced
constraint buffer.
"""
...
"""Solve a TOPP3 problem with the Clarabel LP backend.
``options=None`` uses Rust ``ClarabelOptionsBuilder`` defaults.
The returned ``Profile3rd`` is available only when the Clarabel status is
accepted by ``options``; otherwise this strict API raises ``CoppError``.
"""
...
"""Solve TOPP3-LP and return raw Clarabel diagnostics.
Non-accepted Clarabel statuses do not raise merely because the status is
not accepted by ``options``. Inspect ``result.profile`` and
``result.solver_status`` to decide whether an accepted high-level profile
is available. ``result.profile is None`` means no accepted profile was
extracted. This shares ``Copp3ClarabelResult`` with TOPP3-SOCP and
COPP3-SOCP.
"""
...
"""Solve a TOPP3 problem with the Clarabel SOCP backend.
``options=None`` uses Rust ``ClarabelOptionsBuilder`` defaults.
"""
...
"""Solve TOPP3-SOCP and return raw Clarabel diagnostics.
The result type is shared with ``topp3_lp_expert`` and
``copp3_socp_expert``.
"""
...