Skip to content

trapezoidal_motion_profile.cpp has dimension mismatch between length and time in calculations #3

@calcmogul

Description

@calcmogul

https://github.com/frc1678/robot-code-public/blob/master/muan/control/trapezoidal_motion_profile.cpp#L133-L134 has the following:

  } else if (accel_dist + end_full_speed > dist_to_target) {
    full_speed_dist = dist_to_target - accel_dist;

accel_dist and dist_to_target have units of length while end_full_speed has units of time. This units library (https://github.com/nholthaus/units) caught this at compile time. Perhaps this was intended instead?

  } else if (accel_dist + full_speed_dist > dist_to_target) {
    full_speed_dist = dist_to_target - accel_dist;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions