Skip to content

Commit 320d480

Browse files
committed
Copy the TrapezoidProfile class name only once
1 parent e52c8ea commit 320d480

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

subprojects/robotpy-wpimath/semiwrap/controls/TrapezoidProfile.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ classes:
4848
{
4949
std::string clsNameCopy = clsName;
5050
51+
cls_Constraints
52+
.def("__repr__", [clsNameCopy](const Constraints &self) {
53+
return clsNameCopy + ".Constraints("
54+
"maxVelocity=" + std::to_string(self.maxVelocity()) + ", "
55+
"maxAcceleration=" + std::to_string(self.maxAcceleration()) + ")";
56+
});
57+
5158
cls_State
5259
.def(
5360
py::init<Distance_t, Velocity_t>(),
@@ -75,18 +82,6 @@ classes:
7582
default: '0'
7683
maxAcceleration:
7784
default: '0'
78-
inline_code: |
79-
;
80-
{
81-
std::string clsNameCopy = clsName;
82-
83-
cls_Constraints
84-
.def("__repr__", [clsNameCopy](const Constraints &self) {
85-
return clsNameCopy + ".Constraints("
86-
"maxVelocity=" + std::to_string(self.maxVelocity()) + ", "
87-
"maxAcceleration=" + std::to_string(self.maxAcceleration()) + ")";
88-
});
89-
}
9085
frc::TrapezoidProfile::State:
9186
force_no_default_constructor: true
9287
attributes:

0 commit comments

Comments
 (0)