48 if (m_status == NavigationStatusEnum::navigation_status_idle)
50 m_status = NavigationStatusEnum::navigation_status_moving;
59 yCInfo(FAKENAVIGATION) <<
"gotoTargetByRelativeLocation not yet implemented";
65 yCInfo(FAKENAVIGATION) <<
"gotoTargetByRelativeLocation not yet implemented";
71 yCInfo(FAKENAVIGATION) <<
"followPath not yet implemented";
77 m_control_out.linear_xvel = x_vel;
78 m_control_out.linear_yvel = y_vel;
79 m_control_out.angular_vel = theta_vel;
80 m_control_out.timeout = timeout;
88 x_vel = m_control_out.linear_xvel;
89 y_vel = m_control_out.linear_yvel;
90 theta_vel = m_control_out.angular_vel;
96 m_status=NavigationStatusEnum::navigation_status_idle;
103 if (m_status == NavigationStatusEnum::navigation_status_moving)
105 m_status=NavigationStatusEnum::navigation_status_paused;
112 if (m_status == NavigationStatusEnum::navigation_status_paused)
114 m_status = NavigationStatusEnum::navigation_status_moving;
121 yCInfo(FAKENAVIGATION) <<
"getAllNavigationWaypoints not yet implemented";
127 yCInfo(FAKENAVIGATION) <<
"getCurrentNavigationWaypoint not yet implemented";
133 yCInfo(FAKENAVIGATION) <<
"getCurrentNavigationMap not yet implemented";
145 target = m_absgoal_loc;
151 if (m_status == NavigationStatusEnum::navigation_status_moving)
160 yCInfo(FAKENAVIGATION) <<
"getRelativeLocationOfCurrentTarget not yet implemented";
176 if (m_status == NavigationStatusEnum::navigation_status_moving)
178 if (m_time_counter>0)
184 m_status = NavigationStatusEnum::navigation_status_goal_reached;
188 if (m_status == NavigationStatusEnum::navigation_status_goal_reached)
190 if (m_time_counter > 0)
196 m_status = NavigationStatusEnum::navigation_status_idle;
define control board standard interfaces
contains the definition of a Map2DPath type
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
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.
bool start()
Call this to start the thread.
A base class for nested structures that can be searched.
std::string current_time()
#define yCInfo(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
double now()
Return the current time in seconds, relative to an arbitrary starting point.
The main, catch-all namespace for YARP.