Package trclib.archive
Class TrcTankMotionProfile
java.lang.Object
trclib.archive.TrcTankMotionProfile
This class implements a motion profile for tank drive that consists of paths for the left and right wheels.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionTrcTankMotionProfile(TrcWaypoint[] leftPoints, TrcWaypoint[] rightPoints) Constructor: Create an instance of the object.
- 
Method SummaryModifier and TypeMethodDescriptioncopy()This method returns a copy of this motion profile.This method returns the an array of waypoints for the left wheel path.doubleThis method returns the minimum time step in the motion profile.intThis method determines the number of waypoints in the motion profile.This method returns the an array of waypoints for the right wheel path.static TrcTankMotionProfileloadProfileFromCsv(String leftPath, String rightPath) This method loads the left and right path waypoints from CSV files on external file system.static TrcTankMotionProfileloadProfileFromCsv(String leftPath, String rightPath, boolean loadFromResources) This method loads the left and right path waypoints from CSV files either on external file system or embedded in resources.voidscale(double worldUnitsPerEncoderTick, double timeStep) This method scales the motion profile by distance and time.
- 
Field Details- 
leftPath
- 
rightPath
 
- 
- 
Constructor Details- 
TrcTankMotionProfileConstructor: Create an instance of the object.- Parameters:
- leftPoints- specifies an array of waypoints for the left wheels.
- rightPoints- specifies an array of waypoints for the right wheels.
 
 
- 
- 
Method Details- 
loadProfileFromCsvpublic static TrcTankMotionProfile loadProfileFromCsv(String leftPath, String rightPath, boolean loadFromResources) This method loads the left and right path waypoints from CSV files either on external file system or embedded in resources.- Parameters:
- leftPath- specifies the left CSV path on the external file system or CSV name embedded in resources.
- rightPath- specifies the right CSV path on the external file system or CSV name embedded in resources.
- loadFromResources- specifies true if the CSV file is embedded in resources, false if on file system.
- Returns:
- created motion profile.
 
- 
loadProfileFromCsvThis method loads the left and right path waypoints from CSV files on external file system.- Parameters:
- leftPath- specifies the left CSV path on the external file system.
- rightPath- specifies the right CSV path on the external file system.
- Returns:
- created motion profile.
 
- 
getLeftPointsThis method returns the an array of waypoints for the left wheel path.- Returns:
- array of waypoints.
 
- 
getRightPointsThis method returns the an array of waypoints for the right wheel path.- Returns:
- array of waypoints.
 
- 
getNumPointspublic int getNumPoints()This method determines the number of waypoints in the motion profile.- Returns:
- number of waypoints in the motion profile.
 
- 
getMinTimeSteppublic double getMinTimeStep()This method returns the minimum time step in the motion profile.- Returns:
- minimum time step.
 
- 
scalepublic void scale(double worldUnitsPerEncoderTick, double timeStep) This method scales the motion profile by distance and time.- Parameters:
- worldUnitsPerEncoderTick- specifies the number of world units in a single encoder tick.
- timeStep- specifies the speed denomination in seconds.
 
- 
copyThis method returns a copy of this motion profile.- Returns:
- a copy of this motion profile.
 
 
-