Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
Toggle main menu visibility
Loading...
Searching...
No Matches
src
commands
DriveToWaypointCommand.h
1
#pragma once
2
3
#include "../navtypes.h"
4
#include "../utils/time.h"
5
#include "../world_interface/data.h"
6
#include "CommandBase.h"
7
8
#include <
chrono
>
9
#include <
optional
>
10
11
namespace
commands {
12
18
class
DriveToWaypointCommand
:
CommandBase
{
19
public
:
31
DriveToWaypointCommand
(
const
navtypes::point_t& target,
double
thetaKP,
double
driveVel,
32
double
slowDriveThresh,
double
doneThresh,
33
util::dseconds closeToTargetDur);
34
42
void
setState
(
const
navtypes::pose_t& pose,
robot::types::datatime_t
time);
43
51
command_t
getOutput
()
override
;
52
58
bool
isDone
()
override
;
59
60
private
:
61
navtypes::point_t target;
62
navtypes::pose_t pose;
63
double
thetaKP;
64
double
driveVel;
65
double
slowDriveThresh;
66
double
doneThresh;
67
bool
setStateCalledBeforeOutput;
68
util::dseconds closeToTargetDur;
69
std::optional<robot::types::datatime_t> lastRecordedTime;
70
std::optional<robot::types::datatime_t> closeToTargetStartTime;
71
};
72
73
}
// namespace commands
chrono
optional
commands::CommandBase
Definition
CommandBase.h:10
commands::DriveToWaypointCommand::setState
void setState(const navtypes::pose_t &pose, robot::types::datatime_t time)
Must be called before getOutput() for each iteration.
Definition
DriveToWaypointCommand.cpp:19
commands::DriveToWaypointCommand::isDone
bool isDone() override
Returns whether the DriveToWaypointCommand has finished its navigation task.
Definition
DriveToWaypointCommand.cpp:47
commands::DriveToWaypointCommand::getOutput
command_t getOutput() override
Gets the angular velocity and forward speed to run the robot at in order to navigate robot to target.
Definition
DriveToWaypointCommand.cpp:26
commands::DriveToWaypointCommand::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.
Definition
DriveToWaypointCommand.cpp:11
robot::types::datatime_t
std::chrono::time_point< dataclock > datatime_t
A point in time as measured by dataclock.
Definition
data.h:31
commands::command_t
Definition
CommandBase.h:5
Generated by
1.17.0