-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BDCMC motion profiling #684
base: integration
Are you sure you want to change the base?
Conversation
Firmware-only (bypassing CAN messages) testing being done in bdcmc-mopro-testing |
👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)