YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
FakeNavigation.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
6#include <yarp/os/Network.h>
7#include <yarp/os/RFModule.h>
8#include <yarp/os/Time.h>
9#include <yarp/os/Port.h>
13#include <yarp/dev/Map2DPath.h>
14#include <math.h>
15
17
32{
33private:
36 struct control_type
37 {
38 double linear_xvel = 0;
39 double linear_yvel = 0;
40 double angular_vel = 0;
41 double timeout = 0;
42 double reception_time = 0;
43 }
44 m_control_out;
45
46 int m_time_counter= 0;
47
48public:
49 virtual bool open(yarp::os::Searchable& config) override;
50
52
53 //module cleanup
54 virtual bool close() override;
55
56public:
57 //methods inherited from INavigation2Dxxx interfaces
59 yarp::dev::ReturnValue gotoTargetByRelativeLocation(double x, double y, double theta) override;
60 yarp::dev::ReturnValue gotoTargetByRelativeLocation(double x, double y) override;
63 yarp::dev::ReturnValue getRelativeLocationOfCurrentTarget(double& x, double& y, double& theta) override;
66 yarp::dev::ReturnValue suspendNavigation(double time) override;
72 yarp::dev::ReturnValue applyVelocityCommand(double x_vel, double y_vel, double theta_vel, double timeout = 0.1) override;
73 yarp::dev::ReturnValue getLastVelocityCommand(double& x_vel, double& y_vel, double& theta_vel) override;
74
75 bool threadInit() override;
76 void threadRelease() override;
77 void run() override;
78};
define control board standard interfaces
contains the definition of a Map2DPath type
This class is the parameters parser for class FakeNavigation.
fakeNavigation: Documentation to be added
yarp::dev::ReturnValue resumeNavigation() override
Resume a previously suspended navigation task.
virtual bool close() override
Close the DeviceDriver.
yarp::dev::ReturnValue getLastVelocityCommand(double &x_vel, double &y_vel, double &theta_vel) override
Returns the last applied velocity command.
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 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 gotoTargetByRelativeLocation(double x, double y, double theta) override
Ask the robot to reach a position defined in the robot reference frame.
void run() override
Loop function.
yarp::dev::ReturnValue getCurrentNavigationWaypoint(yarp::dev::Nav2D::Map2DLocation &curr_waypoint) override
Returns the current waypoint pursued by the navigation algorithm.
yarp::dev::ReturnValue stopNavigation() override
Terminates the current navigation task.
yarp::dev::ReturnValue getAbsoluteLocationOfCurrentTarget(yarp::dev::Nav2D::Map2DLocation &target) override
Gets the last navigation target in the world reference frame.
bool threadInit() override
Initialization method.
virtual bool open(yarp::os::Searchable &config) override
Open 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 getAllNavigationWaypoints(yarp::dev::Nav2D::TrajectoryTypeEnum trajectory_type, yarp::dev::Nav2D::Map2DPath &waypoints) override
Returns the list of waypoints generated by the navigation algorithm.
void threadRelease() override
Release method.
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 recomputeCurrentNavigationPath() override
Forces the navigation system to recompute the path from the current robot position to the current goa...
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 getNavigationStatus(yarp::dev::Nav2D::NavigationStatusEnum &status) override
Gets the current status of the navigation task.
yarp::dev::ReturnValue getRelativeLocationOfCurrentTarget(double &x, double &y, double &theta) override
Gets the last navigation target in the robot reference frame.
Interface implemented by all device drivers.
An abstraction for a periodic thread.
A base class for nested structures that can be searched.
Definition Searchable.h:31