Class RobotProfile
public class RobotProfile
extends java.lang.Object
Motion profiles are still a work-in-progress here. With that being said, motion profiles SHOULD (hopefully, that is) allow the robot to accurately follow pre-defined paths and routes.
- Since:
- 0.1.0
- Author:
- Colin Robertson
-
Field Summary
Fields Modifier and Type Field Description private double
accelerationDistance
How much distance the robot takes to accelerate.private double
accelerationTime
How long, in seconds, the robot takes to accelerate.private double
decelerationDistance
How much distance the robot takes to decelerate.private double
decelerationTime
How long, in seconds, the robot takes to decelerate.private double
jerk
The robot's jerk value.private double
maxSpeed
The maximum speed of the robot, measured as feet per second. -
Constructor Summary
Constructors Constructor Description RobotProfile(double accelerationTime, double decelerationTime, double accelerationDistance, double decelerationDistance, double maxSpeed, double jerk)
Create a robot profile. -
Method Summary
Modifier and Type Method Description double
getAccelerationDistance()
Get the robot's acceleration distance.double
getAccelerationTime()
Get the robot's acceleration time.double
getDecelerationDistance()
Get the robot's deceleration distance.double
getDecelerationTime()
Get the robot's deceleration time.double
getJerk()
Get the robot's jerk value.double
getMaxSpeed()
Get the robot's maximum speed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
accelerationTime
private final double accelerationTimeHow long, in seconds, the robot takes to accelerate.Acceleration time is defined as the interval of time that passes between when acceleration begins and when the robot reaches its maximum speed. This maximum speed is up to you to decide - however, in order for certain follower profiles to work, this value must be as close to accurate as possible.
-
decelerationTime
private final double decelerationTimeHow long, in seconds, the robot takes to decelerate.Deceleration time, like acceleration time, is defined as the interval of time between two of the robot's states of motions. In the case of deceleration, the amount of time between when the robot, at full speed, stops accelerating, and when the robot actually reaches a complete stop.
-
accelerationDistance
private final double accelerationDistanceHow much distance the robot takes to accelerate.Acceleration distance is defined as the amount of space, in inches, that the robot requires to drive in a straight line and accelerate to its maximum speed.
Although I can't force you to, these measurements should be in inches. Doing them in any other measurement of distance might break something.
-
decelerationDistance
private final double decelerationDistanceHow much distance the robot takes to decelerate.Deceleration distance is defined as the amount of distance the robot requires to go from its maximum speed to a full and complete stop.
Although I can't force you to, these measurements should be in inches. Doing them in any other measurement of distance might break something.
-
maxSpeed
private final double maxSpeedThe maximum speed of the robot, measured as feet per second.Max speed should be the most accurate possible estimate of the robot's maximum speed.
-
jerk
private final double jerkThe robot's jerk value.In all honesty, I have absolutely no idea what the hell jerk is. I'll update this documentation when I eventually do figure out what that means.
-
-
Constructor Details
-
RobotProfile
public RobotProfile(double accelerationTime, double decelerationTime, double accelerationDistance, double decelerationDistance, double maxSpeed, double jerk)Create a robot profile.If you're confused about what any of this means, you should go read the JavaDoc in this file - it contains everything you need to know.
- Parameters:
accelerationTime
- acceleration time (stop to max speed), measured in seconds.decelerationTime
- deceleration time (max speed to stop), measured in seconds.accelerationDistance
- how far the robot travels while its accelerating.decelerationDistance
- how far the robot travels while its decelerating.maxSpeed
- the maximum speed of the robot, measured in terms of feet per second.
-
-
Method Details
-
getAccelerationTime
public double getAccelerationTime()Get the robot's acceleration time. (seconds)- Returns:
- the robot's acceleration time. (in second)
-
getDecelerationTime
public double getDecelerationTime()Get the robot's deceleration time. (seconds)- Returns:
- the robot's deceleration time. (in seconds)
-
getAccelerationDistance
public double getAccelerationDistance()Get the robot's acceleration distance. (feet)- Returns:
- the amount of distance the robot needs to cover to accelerate.
-
getDecelerationDistance
public double getDecelerationDistance()Get the robot's deceleration distance. (feet)- Returns:
- the amount of distance the robot needs to cover to decelerate.
-
getMaxSpeed
public double getMaxSpeed()Get the robot's maximum speed. (feet per second)- Returns:
- the robot's maximum speed. (feet per second)
-
getJerk
public double getJerk()Get the robot's jerk value.- Returns:
- the robot's maximum jerk.
-