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

#include <drive_commands.h>

Inherits AutoCommand.

Public Member Functions

 TurnToHeadingCommand (TankDrive &drive_sys, Feedback &feedback, double heading_deg, double speed=1, double end_speed=0)
 
bool run () override
 
void on_timeout () override
 

Detailed Description

AutoCommand wrapper class for the turn_to_heading() function in the TankDrive class

Constructor & Destructor Documentation

◆ TurnToHeadingCommand()

TurnToHeadingCommand::TurnToHeadingCommand ( TankDrive & drive_sys,
Feedback & feedback,
double heading_deg,
double max_speed = 1,
double end_speed = 0 )

Construct a TurnToHeadingCommand Command

Parameters
drive_systhe drive system we are commanding
feedbackthe feedback controller we are using to execute the drive
heading_degthe heading to turn to in degrees
max_speed0 -> 1 percentage of the drive systems speed to drive at

Member Function Documentation

◆ on_timeout()

void TurnToHeadingCommand::on_timeout ( )
override

Cleans up drive system if we time out before finishing

reset the drive system if we don't hit our target

◆ run()

bool TurnToHeadingCommand::run ( )
override

Run turn_to_heading Overrides run from AutoCommand

Returns
true when execution is complete, false otherwise

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