![]() |
Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
|
This class handles communication with the drive board on the rover by sending RoveComm packets over the network. More...
#include <DriveBoard.h>
Public Member Functions | |
DriveBoard () | |
Construct a new Drive Board::DriveBoard object. | |
~DriveBoard () | |
Destroy the Drive Board::DriveBoard object. | |
diffdrive::DrivePowers | CalculateMove (const double dGoalSpeed, const double dGoalHeading, const double dActualHeading, const diffdrive::DifferentialControlMethod eKinematicsMethod=diffdrive::DifferentialControlMethod::eArcadeDrive, const bool bAlwaysProgressForward=false) |
This method determines drive powers to make the Rover drive towards a given heading at a given speed. | |
void | SendDrive (const diffdrive::DrivePowers &stDrivePowers) |
Sets the left and right drive powers of the drive board. | |
void | SendStop () |
Stop the drivetrain of the Rover. | |
void | SetMaxDriveEffort (const float fMaxDriveEffortMultiplier) |
Set the max power limits of the drive. | |
diffdrive::DrivePowers | GetDrivePowers () const |
Accessor for the current drive powers of the robot. | |
Private Attributes | |
diffdrive::DrivePowers | m_stDrivePowers |
std::unique_ptr< controllers::PIDController > | m_pPID |
float | m_fMinDriveEffort |
float | m_fMaxDriveEffort |
std::shared_mutex | m_muDriveEffortMutex |
const std::function< void(const rovecomm::RoveCommPacket< float > &, const sockaddr_in &)> | SetMaxSpeedCallback |
Callback function that is called whenever RoveComm receives a new SETMAXSPEED packet. | |
This class handles communication with the drive board on the rover by sending RoveComm packets over the network.
DriveBoard::DriveBoard | ( | ) |
Construct a new Drive Board::DriveBoard object.
DriveBoard::~DriveBoard | ( | ) |
Destroy the Drive Board::DriveBoard object.
diffdrive::DrivePowers DriveBoard::CalculateMove | ( | const double | dGoalSpeed, |
const double | dGoalHeading, | ||
const double | dActualHeading, | ||
const diffdrive::DifferentialControlMethod | eKinematicsMethod = diffdrive::DifferentialControlMethod::eArcadeDrive , |
||
const bool | bAlwaysProgressForward = false |
||
) |
This method determines drive powers to make the Rover drive towards a given heading at a given speed.
dGoalSpeed | - The speed to drive at (-1 to 1) |
dGoalHeading | - The angle to drive towards. (0 - 360) 0 is North. |
dActualHeading | - The real angle that the Rover is current facing. |
eKinematicsMethod | - The kinematics model to use for differential drive control. Enum within DifferentialDrive.hpp |
bAlwaysProgressForward | - If true, the rover will always move forward or backward. Point turns will not be allowed. |
void DriveBoard::SendDrive | ( | const diffdrive::DrivePowers & | stDrivePowers | ) |
Sets the left and right drive powers of the drive board.
stDrivePowers | - A struct containing info about the desired drive powers. Drive powers are always in between -1.0 and 1.0 no matter what constants or RoveComm say. the -1.0 to 1.0 range is automatically mapped to the correct DriveBoard range in this method. |
void DriveBoard::SendStop | ( | ) |
Stop the drivetrain of the Rover.
void DriveBoard::SetMaxDriveEffort | ( | const float | fMaxDriveEffortMultiplier | ) |
Set the max power limits of the drive.
fMinDriveEffort | - A multiplier from 0-1 for the max power output of the drive. Multiplier will be applied to constants::DRIVE_MIN_POWER and constants::DRIVE_MAX_POWER. |
diffdrive::DrivePowers DriveBoard::GetDrivePowers | ( | ) | const |
Accessor for the current drive powers of the robot.
|
private |
Callback function that is called whenever RoveComm receives a new SETMAXSPEED packet.