RIT VEXU Core API
Loading...
Searching...
No Matches
DriveForwardCommand Class Reference

#include <drive_commands.h>

Inherits AutoCommand.

Public Member Functions

 DriveForwardCommand (TankDrive &drive_sys, Feedback &feedback, double inches, directionType dir, double max_speed=1, double end_speed=0)
 
bool run () override
 
void on_timeout () override
 

Detailed Description

AutoCommand wrapper class for the drive_forward function in the TankDrive class

Constructor & Destructor Documentation

◆ DriveForwardCommand()

DriveForwardCommand::DriveForwardCommand ( TankDrive & drive_sys,
Feedback & feedback,
double inches,
directionType dir,
double max_speed = 1,
double end_speed = 0 )

File: drive_commands.h Desc: Holds all the AutoCommand subclasses that wrap (currently) TankDrive functions

Currently includes:

  • drive_forward
  • turn_degrees
  • drive_to_point
  • turn_to_heading
  • stop

Also holds AutoCommand subclasses that wrap OdometryBase functions

Currently includes:

  • set_position Construct a DriveForward Command
    Parameters
    drive_systhe drive system we are commanding
    feedbackthe feedback controller we are using to execute the drive
    incheshow far forward to drive
    dirthe direction to drive
    max_speed0 -> 1 percentage of the drive systems speed to drive at

Member Function Documentation

◆ on_timeout()

void DriveForwardCommand::on_timeout ( )
override

Cleans up drive system if we time out before finishing

reset the drive system if we timeout

◆ run()

bool DriveForwardCommand::run ( )
override

Run drive_forward Overrides run from AutoCommand

Returns
true when execution is complete, false otherwise

The documentation for this class was generated from the following files: