Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
Loading...
Searching...
No Matches
commands::DriveToWaypointCommand Class Reference

Provides robot drive velocity commands to navigate the robot to a given waypoint given the velocity parameters to drive the robot at, the proportional factor to steer the robot with and the 2D Cartesian position of the target in the world reference frame. More...

#include <DriveToWaypointCommand.h>

Inheritance diagram for commands::DriveToWaypointCommand:
Collaboration diagram for commands::DriveToWaypointCommand:

Public Member Functions

 DriveToWaypointCommand (const navtypes::point_t &target, double thetaKP, double driveVel, double slowDriveThresh, double doneThresh, util::dseconds closeToTargetDur)
 Creates a new DriveToWaypointCommand with the specified targeting information.
 
void setState (const navtypes::pose_t &pose, robot::types::datatime_t time)
 Must be called before getOutput() for each iteration.
 
command_t getOutput () override
 Gets the angular velocity and forward speed to run the robot at in order to navigate robot to target.
 
bool isDone () override
 Returns whether the DriveToWaypointCommand has finished its navigation task.
 

Detailed Description

Provides robot drive velocity commands to navigate the robot to a given waypoint given the velocity parameters to drive the robot at, the proportional factor to steer the robot with and the 2D Cartesian position of the target in the world reference frame.

Constructor & Destructor Documentation

◆ DriveToWaypointCommand()

commands::DriveToWaypointCommand::DriveToWaypointCommand ( const navtypes::point_t & target,
double thetaKP,
double driveVel,
double slowDriveThresh,
double doneThresh,
util::dseconds closeToTargetDur )

Creates a new DriveToWaypointCommand with the specified targeting information.

Parameters
targetthe position of the target in world coordinates.
thetaKPthe scaling factor to use for robot steering proportional control.
driveVelthe speed to drive the robot at.
slowDriveThreshthe distance at which the robot will start slowing down.
doneThreshthe threshold for minimum robot-target distance to complete command.
closeToTargetDurValthe duration within doneThresh after which robot navigation is considered done, seconds.

Member Function Documentation

◆ getOutput()

command_t commands::DriveToWaypointCommand::getOutput ( )
overridevirtual

Gets the angular velocity and forward speed to run the robot at in order to navigate robot to target.

Returns
the angular velocity and forward speed to run the robot at in order to navigate robot to target.

Implements commands::CommandBase.

◆ isDone()

bool commands::DriveToWaypointCommand::isDone ( )
overridevirtual

Returns whether the DriveToWaypointCommand has finished its navigation task.

Returns
whether the DriveToWaypointCommand has finished its navigation task.

Implements commands::CommandBase.

◆ setState()

void commands::DriveToWaypointCommand::setState ( const navtypes::pose_t & pose,
robot::types::datatime_t time )

Must be called before getOutput() for each iteration.

Updates the current pose of the robot in the global reference frame used by DriveToWaypointCommand.

Parameters
pose,thecurrent pose of the robot in the global reference frame.
time,thecurrent time from robot::types::dataclock.

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