-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Unit test for jerk-limited trajectory generator #12775
Conversation
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.
Looks great, some small changes.
Also as a style thing, to me it isn't always exactly obvious (in the first 3 seconds) where the setup ends, where the code you want tested is, and where you are verifying results. It might be a bit easier to read if you can make them a bit more separated eg. with GIVEN, WHEN, THEN comments, or just leave whitespace in between. Not critical though.
public: | ||
void SetUp() override | ||
{ | ||
return; |
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.
if you don't need any setup you can just delete this function
float dt = 0.01f; | ||
|
||
// Run a few times the algorithm | ||
updateTrajectories(velocity_setpoints, dt); |
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.
You're doing it in the loop, so I don't think you need another one here?
// bit more time than the predicted one, this is why we have to add 14 steps | ||
// to the theoretical value | ||
float t123 = _trajectories[0].getTotalTime(); | ||
float nb_steps = ceilf(t123 / dt) + 14; |
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.
float
?
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.
Oups
8ea4168
to
62a755f
Compare
@jkflying , @julianoes Thanks for the review. I improved the PR, can you review again please? |
…stead of ceilf and remove line duplicate
…ecks into two different test functions Also improve the comments
0f4d60c
to
7e5c5fe
Compare
First quick implementation of some tests for for the jerk-limited trajectory generator implemented in the VelocitySmoothing class.