YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches

fakeNavigation: Documentation to be added More...

#include <fake/fakeNavigationDevice/FakeNavigation.h>

+ Inheritance diagram for FakeNavigation:

Public Member Functions

virtual bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver.
 
 FakeNavigation ()
 
virtual bool close () override
 Close the DeviceDriver.
 
bool gotoTargetByAbsoluteLocation (yarp::dev::Nav2D::Map2DLocation loc) override
 Ask the robot to reach a position defined in the world reference frame.
 
bool gotoTargetByRelativeLocation (double x, double y, double theta) override
 Ask the robot to reach a position defined in the robot reference frame.
 
bool gotoTargetByRelativeLocation (double x, double y) override
 Ask the robot to reach a position defined in the robot reference frame.
 
bool getAbsoluteLocationOfCurrentTarget (yarp::dev::Nav2D::Map2DLocation &target) override
 Gets the last navigation target in the world reference frame.
 
bool getRelativeLocationOfCurrentTarget (double &x, double &y, double &theta) override
 Gets the last navigation target in the robot reference frame.
 
bool getNavigationStatus (yarp::dev::Nav2D::NavigationStatusEnum &status) override
 Gets the current status of the navigation task.
 
bool stopNavigation () override
 Terminates the current navigation task.
 
bool suspendNavigation (double time) override
 Ask to the robot to suspend the current navigation task for a defined amount of time.
 
bool resumeNavigation () override
 Resume a previously suspended navigation task.
 
bool getAllNavigationWaypoints (yarp::dev::Nav2D::TrajectoryTypeEnum trajectory_type, yarp::dev::Nav2D::Map2DPath &waypoints) override
 Returns the list of waypoints generated by the navigation algorithm.
 
bool getCurrentNavigationWaypoint (yarp::dev::Nav2D::Map2DLocation &curr_waypoint) override
 Returns the current waypoint pursued by the navigation algorithm.
 
bool getCurrentNavigationMap (yarp::dev::Nav2D::NavigationMapTypeEnum map_type, yarp::dev::Nav2D::MapGrid2D &map) override
 Returns the current navigation map processed by the navigation algorithm.
 
bool recomputeCurrentNavigationPath () override
 Forces the navigation system to recompute the path from the current robot position to the current goal.
 
bool applyVelocityCommand (double x_vel, double y_vel, double theta_vel, double timeout=0.1) override
 Apply a velocity command.
 
bool 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.
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
 DeviceDriver ()
 
 DeviceDriver (const DeviceDriver &other)=delete
 
 DeviceDriver (DeviceDriver &&other) noexcept=delete
 
DeviceDriveroperator= (const DeviceDriver &other)=delete
 
DeviceDriveroperator= (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 DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others.
 
- Public Member Functions inherited from yarp::dev::Nav2D::INavigation2DTargetActions
virtual ~INavigation2DTargetActions ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::Nav2D::INavigation2DControlActions
virtual ~INavigation2DControlActions ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::Nav2D::INavigation2DVelocityActions
virtual ~INavigation2DVelocityActions ()
 Destructor.
 
- Public Member Functions inherited from yarp::os::PeriodicThread
 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.
 
- Public Member Functions inherited from FakeNavigation_ParamsParser
 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.
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Additional Inherited Members

- Public Attributes inherited from FakeNavigation_ParamsParser
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}
 
- Protected Member Functions inherited from yarp::os::PeriodicThread
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().
 

Detailed Description

fakeNavigation: Documentation to be added

Parameters required by this device are shown in class: FakeNavigation_ParamsParser

Definition at line 24 of file FakeNavigation.h.

Constructor & Destructor Documentation

◆ FakeNavigation()

FakeNavigation::FakeNavigation ( )

Definition at line 35 of file FakeNavigation.cpp.

Member Function Documentation

◆ applyVelocityCommand()

bool FakeNavigation::applyVelocityCommand ( double  x_vel,
double  y_vel,
double  theta_vel,
double  timeout = 0.1 
)
overridevirtual

Apply a velocity command.

Velocities are expressed in the robot reference frame.

Parameters
x[m/s]
y[m/s]
theta[deg/s]
timeoutThe velocity command expires after the specified amount of time (by default 0.1 seconds)
Returns
true/false

Implements yarp::dev::Nav2D::INavigation2DVelocityActions.

Definition at line 68 of file FakeNavigation.cpp.

◆ close()

bool FakeNavigation::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 40 of file FakeNavigation.cpp.

◆ getAbsoluteLocationOfCurrentTarget()

bool FakeNavigation::getAbsoluteLocationOfCurrentTarget ( yarp::dev::Nav2D::Map2DLocation loc)
overridevirtual

Gets the last navigation target in the world reference frame.

Parameters
locthe location of the robot
Returns
true/false

Implements yarp::dev::Nav2D::INavigation2DTargetActions.

Definition at line 136 of file FakeNavigation.cpp.

◆ getAllNavigationWaypoints()

bool FakeNavigation::getAllNavigationWaypoints ( yarp::dev::Nav2D::TrajectoryTypeEnum  trajectory_type,
yarp::dev::Nav2D::Map2DPath waypoints 
)
overridevirtual

Returns the list of waypoints generated by the navigation algorithm.

Parameters
trajectory_typespecifies if we are requesting the waypoints of the global trajectory or the waypoints of the local trajectory
waypointsthe list of waypoints generated by the navigation algorithm
Returns
true/false

Implements yarp::dev::Nav2D::INavigation2DControlActions.

Definition at line 112 of file FakeNavigation.cpp.

◆ getCurrentNavigationMap()

bool FakeNavigation::getCurrentNavigationMap ( yarp::dev::Nav2D::NavigationMapTypeEnum  map_type,
yarp::dev::Nav2D::MapGrid2D map 
)
overridevirtual

Returns the current navigation map processed by the navigation algorithm.

Parameters
map_typethe map to be requested (e.g. global, local, etc.)
mapthe map, currently used by the navigation algorithm
Returns
true/false

Implements yarp::dev::Nav2D::INavigation2DControlActions.

Definition at line 124 of file FakeNavigation.cpp.

◆ getCurrentNavigationWaypoint()

bool FakeNavigation::getCurrentNavigationWaypoint ( yarp::dev::Nav2D::Map2DLocation curr_waypoint)
overridevirtual

Returns the current waypoint pursued by the navigation algorithm.

Parameters
curr_waypointthe current waypoint pursued by the navigation algorithm
Returns
true/false

Implements yarp::dev::Nav2D::INavigation2DControlActions.

Definition at line 118 of file FakeNavigation.cpp.

◆ getLastVelocityCommand()

bool FakeNavigation::getLastVelocityCommand ( double &  x_vel,
double &  y_vel,
double &  theta_vel 
)
overridevirtual

Returns the last applied velocity command.

Parameters
x[m/s]
y[m/s]
theta[deg/s]
Returns
true/false

Implements yarp::dev::Nav2D::INavigation2DVelocityActions.

Definition at line 78 of file FakeNavigation.cpp.

◆ getNavigationStatus()

bool FakeNavigation::getNavigationStatus ( yarp::dev::Nav2D::NavigationStatusEnum status)
overridevirtual

Gets the current status of the navigation task.

Returns
true/false

Implements yarp::dev::Nav2D::INavigation2DControlActions.

Definition at line 130 of file FakeNavigation.cpp.

◆ getRelativeLocationOfCurrentTarget()

bool FakeNavigation::getRelativeLocationOfCurrentTarget ( double &  x,
double &  y,
double &  theta 
)
overridevirtual

Gets the last navigation target in the robot reference frame.

Parameters
x
y
theta
Returns
true/false

Implements yarp::dev::Nav2D::INavigation2DTargetActions.

Definition at line 151 of file FakeNavigation.cpp.

◆ gotoTargetByAbsoluteLocation()

bool FakeNavigation::gotoTargetByAbsoluteLocation ( yarp::dev::Nav2D::Map2DLocation  loc)
overridevirtual

Ask the robot to reach a position defined in the world reference frame.

Parameters
locthe location to be reached
Returns
true/false

Implements yarp::dev::Nav2D::INavigation2DTargetActions.

Definition at line 45 of file FakeNavigation.cpp.

◆ gotoTargetByRelativeLocation() [1/2]

bool FakeNavigation::gotoTargetByRelativeLocation ( double  x,
double  y 
)
overridevirtual

Ask the robot to reach a position defined in the robot reference frame.

The final orientation of the goal is unspecified.

Parameters
x
y
Returns
true/false

Implements yarp::dev::Nav2D::INavigation2DTargetActions.

Definition at line 62 of file FakeNavigation.cpp.

◆ gotoTargetByRelativeLocation() [2/2]

bool FakeNavigation::gotoTargetByRelativeLocation ( double  x,
double  y,
double  theta 
)
overridevirtual

Ask the robot to reach a position defined in the robot reference frame.

Parameters
x
y
theta
Returns
true/false

Implements yarp::dev::Nav2D::INavigation2DTargetActions.

Definition at line 56 of file FakeNavigation.cpp.

◆ open()

bool FakeNavigation::open ( yarp::os::Searchable config)
overridevirtual

Open the DeviceDriver.

Parameters
configis 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).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 25 of file FakeNavigation.cpp.

◆ recomputeCurrentNavigationPath()

bool FakeNavigation::recomputeCurrentNavigationPath ( )
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.

Returns
true/false

Implements yarp::dev::Nav2D::INavigation2DControlActions.

Definition at line 142 of file FakeNavigation.cpp.

◆ resumeNavigation()

bool FakeNavigation::resumeNavigation ( )
overridevirtual

Resume a previously suspended navigation task.

Returns
true/false

Implements yarp::dev::Nav2D::INavigation2DControlActions.

Definition at line 103 of file FakeNavigation.cpp.

◆ run()

void FakeNavigation::run ( )
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 167 of file FakeNavigation.cpp.

◆ stopNavigation()

bool FakeNavigation::stopNavigation ( )
overridevirtual

Terminates the current navigation task.

Cannot be resumed.

Returns
true/false

Implements yarp::dev::Nav2D::INavigation2DControlActions.

Definition at line 87 of file FakeNavigation.cpp.

◆ suspendNavigation()

bool FakeNavigation::suspendNavigation ( double  time_s)
overridevirtual

Ask to the robot to suspend the current navigation task for a defined amount of time.

Can be resumed by resume().

Parameters
time_s
Returns
true/false

Implements yarp::dev::Nav2D::INavigation2DControlActions.

Definition at line 94 of file FakeNavigation.cpp.

◆ threadInit()

bool FakeNavigation::threadInit ( )
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 157 of file FakeNavigation.cpp.

◆ threadRelease()

void FakeNavigation::threadRelease ( )
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 162 of file FakeNavigation.cpp.


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