Skip to content
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

Merged
merged 5 commits into from
Aug 29, 2019

Conversation

bresch
Copy link
Member

@bresch bresch commented Aug 22, 2019

First quick implementation of some tests for for the jerk-limited trajectory generator implemented in the VelocitySmoothing class.

@bresch bresch requested review from jkflying and MaEtUgR August 22, 2019 12:17
@bresch bresch self-assigned this Aug 22, 2019
Copy link
Contributor

@jkflying jkflying left a 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;
Copy link
Contributor

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);
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

float?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oups

@bresch
Copy link
Member Author

bresch commented Aug 28, 2019

@jkflying , @julianoes Thanks for the review. I improved the PR, can you review again please?

jkflying
jkflying previously approved these changes Aug 28, 2019
@bresch bresch force-pushed the dev-velocitysmoothing-test branch from 0f4d60c to 7e5c5fe Compare August 29, 2019 07:38
@bresch bresch merged commit fe73cef into master Aug 29, 2019
@bresch bresch deleted the dev-velocitysmoothing-test branch August 29, 2019 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants