generateTrajectory: default reversed param to false (#1953)

This commit is contained in:
Prateek Machiraju
2019-10-21 19:21:46 -04:00
committed by Peter Johnson
parent acf960f729
commit 4f034e6c14
2 changed files with 126 additions and 4 deletions

View File

@@ -80,6 +80,31 @@ public final class TrajectoryGenerator {
maxAccelerationMetersPerSecondSq, reversed);
}
/**
* Generates a trajectory with the given waypoints and constraints.
*
* @param waypoints A vector of points that the trajectory must go through.
* @param constraints A vector of various velocity and acceleration
* constraints.
* @param startVelocityMetersPerSecond The start velocity for the trajectory.
* @param endVelocityMetersPerSecond The end velocity for the trajectory.
* @param maxVelocityMetersPerSecond The max velocity for the trajectory.
* @param maxAccelerationMetersPerSecondSq The max acceleration for the trajectory.
* @return The trajectory.
*/
public static Trajectory generateTrajectory(
List<Pose2d> waypoints,
List<TrajectoryConstraint> constraints,
double startVelocityMetersPerSecond,
double endVelocityMetersPerSecond,
double maxVelocityMetersPerSecond,
double maxAccelerationMetersPerSecondSq
) {
return generateTrajectory(waypoints, constraints, startVelocityMetersPerSecond,
endVelocityMetersPerSecond, maxVelocityMetersPerSecond, maxAccelerationMetersPerSecondSq,
false);
}
/**
* Generates a trajectory with the given waypoints and constraints.
*
@@ -133,6 +158,37 @@ public final class TrajectoryGenerator {
maxAccelerationMetersPerSecondSq, reversed);
}
/**
* Generates a trajectory with the given waypoints and constraints.
*
* @param start The starting pose for the trajectory.
* @param waypoints The interior waypoints for the trajectory. The headings
* will be determined automatically to ensure continuous
* curvature.
* @param end The ending pose for the trajectory.
* @param constraints A vector of various velocity and acceleration
* constraints.
* @param startVelocityMetersPerSecond The start velocity for the trajectory.
* @param endVelocityMetersPerSecond The end velocity for the trajectory.
* @param maxVelocityMetersPerSecond The max velocity for the trajectory.
* @param maxAccelerationMetersPerSecondSq The max acceleration for the trajectory.
* @return The trajectory.
*/
public static Trajectory generateTrajectory(
Pose2d start,
List<Translation2d> waypoints,
Pose2d end,
List<TrajectoryConstraint> constraints,
double startVelocityMetersPerSecond,
double endVelocityMetersPerSecond,
double maxVelocityMetersPerSecond,
double maxAccelerationMetersPerSecondSq
) {
return generateTrajectory(start, waypoints, end, constraints,
startVelocityMetersPerSecond, endVelocityMetersPerSecond, maxVelocityMetersPerSecond,
maxAccelerationMetersPerSecondSq, false);
}
/**
* Generates a trajectory with the given waypoints and differential drive constraints. Use
* this method if you just want a constraint such that none of the wheels on your differential
@@ -172,6 +228,34 @@ public final class TrajectoryGenerator {
);
}
/**
* Generates a trajectory with the given waypoints and differential drive constraints. Use
* this method if you just want a constraint such that none of the wheels on your differential
* drive exceed the specified max velocity. If you desire to impose more constraints, please
* use the other overloads.
*
* @param waypoints A vector of points that the trajectory must go through.
* @param differentialDriveKinematics The DifferentialDriveKinematics object that represents
* your drivetrain.
* @param startVelocityMetersPerSecond The start velocity for the trajectory.
* @param endVelocityMetersPerSecond The end velocity for the trajectory.
* @param maxVelocityMetersPerSecond The max velocity for the trajectory.
* @param maxAccelerationMetersPerSecondSq The max acceleration for the trajectory.
* @return The trajectory.
*/
public static Trajectory generateTrajectory(
List<Pose2d> waypoints,
DifferentialDriveKinematics differentialDriveKinematics,
double startVelocityMetersPerSecond,
double endVelocityMetersPerSecond,
double maxVelocityMetersPerSecond,
double maxAccelerationMetersPerSecondSq
) {
return generateTrajectory(waypoints, differentialDriveKinematics, startVelocityMetersPerSecond,
endVelocityMetersPerSecond, maxVelocityMetersPerSecond,
maxAccelerationMetersPerSecondSq, false);
}
/**
* Generates a trajectory with the given waypoints and differential drive constraints. Use
* this method if you just want a constraint such that none of the wheels on your differential
@@ -217,6 +301,40 @@ public final class TrajectoryGenerator {
);
}
/**
* Generates a trajectory with the given waypoints and differential drive constraints. Use
* this method if you just want a constraint such that none of the wheels on your differential
* drive exceed the specified max velocity. If you desire to impose more constraints, please
* use the other overloads.
*
* @param start The starting pose for the trajectory.
* @param waypoints The interior waypoints for the trajectory. The headings
* will be determined automatically to ensure continuous
* curvature.
* @param end The ending pose for the trajectory.
* @param differentialDriveKinematics The DifferentialDriveKinematics object that represents
* your drivetrain.
* @param startVelocityMetersPerSecond The start velocity for the trajectory.
* @param endVelocityMetersPerSecond The end velocity for the trajectory.
* @param maxVelocityMetersPerSecond The max velocity for the trajectory.
* @param maxAccelerationMetersPerSecondSq The max acceleration for the trajectory.
* @return The trajectory.
*/
public static Trajectory generateTrajectory(
Pose2d start,
List<Translation2d> waypoints,
Pose2d end,
DifferentialDriveKinematics differentialDriveKinematics,
double startVelocityMetersPerSecond,
double endVelocityMetersPerSecond,
double maxVelocityMetersPerSecond,
double maxAccelerationMetersPerSecondSq
) {
return generateTrajectory(start, waypoints, end, differentialDriveKinematics,
startVelocityMetersPerSecond, endVelocityMetersPerSecond,
maxVelocityMetersPerSecond, maxAccelerationMetersPerSecondSq, false);
}
/**
* Generate spline points from a vector of splines by parameterizing the
* splines.