fakeNavigation
: Documentation to be added
More...
#include <fake/fakeNavigationDevice/FakeNavigation.h>
Public Member Functions | |
virtual bool | open (yarp::os::Searchable &config) override |
Open the DeviceDriver. | |
FakeNavigation () | |
virtual bool | close () override |
Close the DeviceDriver. | |
yarp::dev::ReturnValue | gotoTargetByAbsoluteLocation (yarp::dev::Nav2D::Map2DLocation loc) override |
Ask the robot to reach a position defined in the world reference frame. | |
yarp::dev::ReturnValue | gotoTargetByRelativeLocation (double x, double y, double theta) override |
Ask the robot to reach a position defined in the robot reference frame. | |
yarp::dev::ReturnValue | gotoTargetByRelativeLocation (double x, double y) override |
Ask the robot to reach a position defined in the robot reference frame. | |
yarp::dev::ReturnValue | followPath (const yarp::dev::Nav2D::Map2DPath &path) override |
Ask the robot to navigate through a set of locations defined in the world reference frame. | |
yarp::dev::ReturnValue | getAbsoluteLocationOfCurrentTarget (yarp::dev::Nav2D::Map2DLocation &target) override |
Gets the last navigation target in the world reference frame. | |
yarp::dev::ReturnValue | getRelativeLocationOfCurrentTarget (double &x, double &y, double &theta) override |
Gets the last navigation target in the robot reference frame. | |
yarp::dev::ReturnValue | getNavigationStatus (yarp::dev::Nav2D::NavigationStatusEnum &status) override |
Gets the current status of the navigation task. | |
yarp::dev::ReturnValue | stopNavigation () override |
Terminates the current navigation task. | |
yarp::dev::ReturnValue | suspendNavigation (double time) override |
Ask to the robot to suspend the current navigation task for a defined amount of time. | |
yarp::dev::ReturnValue | resumeNavigation () override |
Resume a previously suspended navigation task. | |
yarp::dev::ReturnValue | getAllNavigationWaypoints (yarp::dev::Nav2D::TrajectoryTypeEnum trajectory_type, yarp::dev::Nav2D::Map2DPath &waypoints) override |
Returns the list of waypoints generated by the navigation algorithm. | |
yarp::dev::ReturnValue | getCurrentNavigationWaypoint (yarp::dev::Nav2D::Map2DLocation &curr_waypoint) override |
Returns the current waypoint pursued by the navigation algorithm. | |
yarp::dev::ReturnValue | getCurrentNavigationMap (yarp::dev::Nav2D::NavigationMapTypeEnum map_type, yarp::dev::Nav2D::MapGrid2D &map) override |
Returns the current navigation map processed by the navigation algorithm. | |
yarp::dev::ReturnValue | recomputeCurrentNavigationPath () override |
Forces the navigation system to recompute the path from the current robot position to the current goal. | |
yarp::dev::ReturnValue | applyVelocityCommand (double x_vel, double y_vel, double theta_vel, double timeout=0.1) override |
Apply a velocity command. | |
yarp::dev::ReturnValue | getLastVelocityCommand (double &x_vel, double &y_vel, double &theta_vel) override |
Returns the last applied velocity command. | |
bool | threadInit () override |
Initialization method. | |
void | threadRelease () override |
Release method. | |
void | run () override |
Loop function. | |
![]() | |
DeviceDriver () | |
DeviceDriver (const DeviceDriver &other)=delete | |
DeviceDriver (DeviceDriver &&other) noexcept=delete | |
DeviceDriver & | operator= (const DeviceDriver &other)=delete |
DeviceDriver & | operator= (DeviceDriver &&other) noexcept=delete |
virtual | ~DeviceDriver () |
virtual std::string | id () const |
Return the id assigned to the PolyDriver. | |
virtual void | setId (const std::string &id) |
Set the id for this device. | |
template<class T > | |
bool | view (T *&x) |
Get an interface to the device driver. | |
virtual DeviceDriver * | getImplementation () |
Some drivers are bureaucrats, pointing at others. | |
![]() | |
virtual | ~INavigation2DTargetActions () |
Destructor. | |
![]() | |
virtual | ~INavigation2DControlActions () |
Destructor. | |
![]() | |
virtual | ~INavigation2DVelocityActions () |
Destructor. | |
![]() | |
PeriodicThread (double period, ShouldUseSystemClock useSystemClock=ShouldUseSystemClock::No, PeriodicThreadClock clockAccuracy=PeriodicThreadClock::Relative) | |
Constructor. | |
PeriodicThread (double period, PeriodicThreadClock clockAccuracy) | |
Constructor. | |
virtual | ~PeriodicThread () |
bool | start () |
Call this to start the thread. | |
void | step () |
Call this to "step" the thread rather than starting it. | |
void | stop () |
Call this to stop the thread, this call blocks until the thread is terminated (and releaseThread() called). | |
void | askToStop () |
Stop the thread. | |
bool | isRunning () const |
Returns true when the thread is started, false otherwise. | |
bool | isSuspended () const |
Returns true when the thread is suspended, false otherwise. | |
bool | setPeriod (double period) |
Set the (new) period of the thread. | |
double | getPeriod () const |
Return the current period of the thread. | |
void | suspend () |
Suspend the thread, the thread keeps running by doLoop is never executed. | |
void | resume () |
Resume the thread if previously suspended. | |
void | resetStat () |
Reset thread statistics. | |
double | getEstimatedPeriod () const |
Return estimated period since last reset. | |
void | getEstimatedPeriod (double &av, double &std) const |
Return estimated period since last reset. | |
unsigned int | getIterations () const |
Return the number of iterations performed since last reset. | |
double | getEstimatedUsed () const |
Return the estimated duration of the run() function since last reset. | |
void | getEstimatedUsed (double &av, double &std) const |
Return estimated duration of the run() function since last reset. | |
int | setPriority (int priority, int policy=-1) |
Set the priority and scheduling policy of the thread, if the OS supports that. | |
int | getPriority () const |
Query the current priority of the thread, if the OS supports that. | |
int | getPolicy () const |
Query the current scheduling policy of the thread, if the OS supports that. | |
![]() | |
FakeNavigation_ParamsParser () | |
~FakeNavigation_ParamsParser () override=default | |
bool | parseParams (const yarp::os::Searchable &config) override |
Parse the DeviceDriver parameters. | |
std::string | getDeviceClassName () const override |
Get the name of the DeviceDriver class. | |
std::string | getDeviceName () const override |
Get the name of the device (i.e. | |
std::string | getDocumentationOfDeviceParams () const override |
Get the documentation of the DeviceDriver's parameters. | |
std::vector< std::string > | getListOfParams () const override |
Return a list of all params used by the device. | |
![]() | |
virtual | ~IDeviceDriverParams () |
Additional Inherited Members | |
![]() | |
const std::string | m_device_classname = {"FakeNavigation"} |
const std::string | m_device_name = {"fakeNavigation"} |
bool | m_parser_is_strict = false |
const parser_version_type | m_parser_version = {} |
const std::string | m_navigation_time_defaultValue = {"500"} |
const std::string | m_reached_time_defaultValue = {"100"} |
int | m_navigation_time = {500} |
int | m_reached_time = {100} |
![]() | |
virtual void | beforeStart () |
Called just before a new thread starts. | |
virtual void | afterStart (bool success) |
Called just after a new thread starts (or fails to start), this is executed by the same thread that calls start(). | |
fakeNavigation
: Documentation to be added
Parameters required by this device are shown in class: FakeNavigation_ParamsParser
Definition at line 25 of file FakeNavigation.h.
FakeNavigation::FakeNavigation | ( | ) |
Definition at line 36 of file FakeNavigation.cpp.
|
overridevirtual |
Apply a velocity command.
Velocities are expressed in the robot reference frame.
x | [m/s] |
y | [m/s] |
theta | [deg/s] |
timeout | The velocity command expires after the specified amount of time (by default 0.1 seconds) |
Implements yarp::dev::Nav2D::INavigation2DVelocityActions.
Definition at line 75 of file FakeNavigation.cpp.
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 41 of file FakeNavigation.cpp.
|
overridevirtual |
Ask the robot to navigate through a set of locations defined in the world reference frame.
path | the locations to be reached |
Implements yarp::dev::Nav2D::INavigation2DTargetActions.
Definition at line 69 of file FakeNavigation.cpp.
|
overridevirtual |
Gets the last navigation target in the world reference frame.
loc | the location of the robot |
Implements yarp::dev::Nav2D::INavigation2DTargetActions.
Definition at line 143 of file FakeNavigation.cpp.
|
overridevirtual |
Returns the list of waypoints generated by the navigation algorithm.
trajectory_type | specifies if we are requesting the waypoints of the global trajectory or the waypoints of the local trajectory |
waypoints | the list of waypoints generated by the navigation algorithm |
Implements yarp::dev::Nav2D::INavigation2DControlActions.
Definition at line 119 of file FakeNavigation.cpp.
|
overridevirtual |
Returns the current navigation map processed by the navigation algorithm.
map_type | the map to be requested (e.g. global, local, etc.) |
map | the map, currently used by the navigation algorithm |
Implements yarp::dev::Nav2D::INavigation2DControlActions.
Definition at line 131 of file FakeNavigation.cpp.
|
overridevirtual |
Returns the current waypoint pursued by the navigation algorithm.
curr_waypoint | the current waypoint pursued by the navigation algorithm |
Implements yarp::dev::Nav2D::INavigation2DControlActions.
Definition at line 125 of file FakeNavigation.cpp.
|
overridevirtual |
Returns the last applied velocity command.
x | [m/s] |
y | [m/s] |
theta | [deg/s] |
Implements yarp::dev::Nav2D::INavigation2DVelocityActions.
Definition at line 85 of file FakeNavigation.cpp.
|
overridevirtual |
Gets the current status of the navigation task.
Implements yarp::dev::Nav2D::INavigation2DControlActions.
Definition at line 137 of file FakeNavigation.cpp.
|
overridevirtual |
Gets the last navigation target in the robot reference frame.
x | |
y | |
theta |
Implements yarp::dev::Nav2D::INavigation2DTargetActions.
Definition at line 158 of file FakeNavigation.cpp.
|
overridevirtual |
Ask the robot to reach a position defined in the world reference frame.
loc | the location to be reached |
Implements yarp::dev::Nav2D::INavigation2DTargetActions.
Definition at line 46 of file FakeNavigation.cpp.
|
overridevirtual |
Ask the robot to reach a position defined in the robot reference frame.
The final orientation of the goal is unspecified.
x | |
y |
Implements yarp::dev::Nav2D::INavigation2DTargetActions.
Definition at line 63 of file FakeNavigation.cpp.
|
overridevirtual |
Ask the robot to reach a position defined in the robot reference frame.
x | |
y | |
theta |
Implements yarp::dev::Nav2D::INavigation2DTargetActions.
Definition at line 57 of file FakeNavigation.cpp.
|
overridevirtual |
Open the DeviceDriver.
config | is a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device). |
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 26 of file FakeNavigation.cpp.
|
overridevirtual |
Forces the navigation system to recompute the path from the current robot position to the current goal.
If no goal has been set, the command has no effect.
Implements yarp::dev::Nav2D::INavigation2DControlActions.
Definition at line 149 of file FakeNavigation.cpp.
|
overridevirtual |
Resume a previously suspended navigation task.
Implements yarp::dev::Nav2D::INavigation2DControlActions.
Definition at line 110 of file FakeNavigation.cpp.
|
overridevirtual |
Loop function.
This is the thread itself. The thread calls the run() function every <period> ms. At the end of each run, the thread will sleep the amounth of time required, taking into account the time spent inside the loop function. Example: requested period is 10ms, the run() function take 3ms to be executed, the thread will sleep for 7ms.
Note: after each run is completed, the thread will call a yield() in order to facilitate other threads to run.
Implements yarp::os::PeriodicThread.
Definition at line 174 of file FakeNavigation.cpp.
|
overridevirtual |
Terminates the current navigation task.
Cannot be resumed.
Implements yarp::dev::Nav2D::INavigation2DControlActions.
Definition at line 94 of file FakeNavigation.cpp.
|
overridevirtual |
Ask to the robot to suspend the current navigation task for a defined amount of time.
Can be resumed by resume().
time_s |
Implements yarp::dev::Nav2D::INavigation2DControlActions.
Definition at line 101 of file FakeNavigation.cpp.
|
overridevirtual |
Initialization method.
The thread executes this function when it starts and before "run". This is a good place to perform initialization tasks that need to be done by the thread itself (device drivers initialization, memory allocation etc). If the function returns false the thread quits and never calls "run". The return value of threadInit() is notified to the class and passed as a parameter to afterStart(). Note that afterStart() is called by the same thread that is executing the "start" method.
Reimplemented from yarp::os::PeriodicThread.
Definition at line 164 of file FakeNavigation.cpp.
|
overridevirtual |
Release method.
The thread executes this function once when it exits, after the last "run". This is a good place to release resources that were initialized in threadInit() (release memory, and device driver resources).
Reimplemented from yarp::os::PeriodicThread.
Definition at line 169 of file FakeNavigation.cpp.