Skip to content

Mohamed's submission#1

Open
elmashadmo wants to merge 11 commits intojishnusen:masterfrom
elmashadmo:master
Open

Mohamed's submission#1
elmashadmo wants to merge 11 commits intojishnusen:masterfrom
elmashadmo:master

Conversation

@elmashadmo
Copy link

@elmashadmo elmashadmo commented May 16, 2019

I think I'm done

@elmashadmo elmashadmo changed the title part 1 Mohamed's submission May 16, 2019
profile.cc Outdated
return full_send_time;
} else {
// first part of trapezoid
double accel_time = (constraints_.kMaxAcceleration - current_.velocity) / constraints_.kMaxAcceleration;
Copy link
Owner

Choose a reason for hiding this comment

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

constraints_.kMaxAcceleration - current_.velocity doesn't make any sense

Copy link
Author

Choose a reason for hiding this comment

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

ah, my bad. It should have been goal_velocity - current_velocity

profile.cc Outdated

double vel_time = delta_x - (2 * accel_dist);

double full_time = (2 * accel_time) + (vel_time / constraints_.kMaxVelocity);
Copy link
Owner

Choose a reason for hiding this comment

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

what if it doesn't get to full?

Copy link
Author

Choose a reason for hiding this comment

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

Bad naming, it should be total_time

profile.h Outdated
constexpr kMaxAcceleration = 1.0;
#include <math.h>

struct Constraints {
Copy link
Owner

Choose a reason for hiding this comment

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

Why did you break this out

Copy link
Owner

Choose a reason for hiding this comment

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

Should be inside the class, since that's all thats gonna use it.

Copy link
Author

Choose a reason for hiding this comment

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

👍

*Remove struct
*Rename variables
*Fix logic from typo
profile.cc Outdated

double vel_time = delta_x - (2 * accel_dist);

double total_time = (2 * accel_time) + (vel_time / kMaxVelocity);
Copy link
Owner

Choose a reason for hiding this comment

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

What if the profile is triangular?

profile.cc Outdated
return full_send_time;
} else {
// first part of trapezoid
double accel_time = (goal_.velocity - current_.velocity) / kMaxAcceleration;
Copy link
Owner

Choose a reason for hiding this comment

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

This should be able to go faster than the goal velocity as long as it slows down in time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants