Conversation
|
Firmware-only (bypassing CAN messages) testing being done in bdcmc-mopro-testing |
|
👀 |
There was a problem hiding this comment.
remove these, I think u accidently commited ur cmake-build-debug
| #include "units/units.hpp" | ||
|
|
||
| namespace mrover { | ||
| template<IsUnit PositionUnit = Radians, IsUnit TimeUnit = Seconds> |
There was a problem hiding this comment.
Hey at least someone other than me understands how to use the units library! Cool cool
|
This looks great! Any plans to recompute the trapezoid if there is a big enough delta between current value and setpoint? |
8e721f6 to
65c9dc9
Compare
| mT += dt; | ||
| } | ||
|
|
||
| auto velocity() -> VelocityUnit { |
There was a problem hiding this comment.
Good stuff dude! Not suggesting you make this change but just for your knowledge: you can actually write code that does this without ever explicitly computing a time schedule for the acceleration changes. The main benefit is that the logic is less cumbersome and the output state is only dependent on the current state meaning you can extend it to use sensor measurements in a "feedback" fashion.
if ( v^2 / (2 * maxAccel) >= setpointPos - actualPos ) {
// start slowing down at maxAccel
}
if ( v >= vmax ) {
// stop accelerating
}
// step kinematics
...
Summary
Closes #(Your issue number here)
What features did you add, bugs did you fix, etc?
Did you add documentation to the wiki?
Yes/No (If not explain why not)
How was this code tested?
Summarize how you tested this code. Your objective here is to prove to the reviewers that this code actually works without them having to run it themselves. It is often helpful to include screenshots, tables, graphs, and/or a short write-up of testing procedures. Results can be either from sim, the robot, or both depending on what you think is sufficient for the feature you added.
Did you test this in sim?
Yes/No
Did you test this on the rover?
Yes/No
Did you add unit tests?
Yes/No (If not explain why not)