22#define CHECK_POINTER(xxx) {if (xxx==nullptr) {yCError(NAVIGATION2DSERVER, "Invalid interface"); return false;}}
26 m_iNav_target = iNav_target;
27 m_iNav_ctrl = iNav_ctrl;
28 m_iNav_vel = iNav_vel;
34 std::lock_guard <std::mutex>
lg(m_mutex);
42 m_current_goal_name.
clear();
48 std::lock_guard <std::mutex>
lg(m_mutex);
61 std::lock_guard <std::mutex>
lg(m_mutex);
74 std::lock_guard <std::mutex>
lg(m_mutex);
87 std::lock_guard <std::mutex>
lg(m_mutex);
109 std::lock_guard <std::mutex>
lg(m_mutex);
131 std::lock_guard <std::mutex>
lg(m_mutex);
146 ret.waypoints = path;
153 std::lock_guard <std::mutex>
lg(m_mutex);
168 ret.mapgrid = themap;
178 std::lock_guard <std::mutex>
lg(m_mutex);
186 m_current_goal_name.
clear();
192 std::lock_guard <std::mutex>
lg(m_mutex);
200 m_current_goal_name.
clear();
206 std::lock_guard <std::mutex>
lg(m_mutex);
214 m_current_goal_name.
clear();
220 std::lock_guard <std::mutex>
lg(m_mutex);
235 std::lock_guard <std::mutex>
lg(m_mutex);
243 m_current_goal_name.
clear();
249 std::lock_guard <std::mutex>
lg(m_mutex);
271 std::lock_guard <std::mutex>
lg(m_mutex);
296 std::lock_guard <std::mutex>
lg(m_mutex);
309 std::lock_guard <std::mutex>
lg(m_mutex);
334 std::lock_guard <std::mutex>
lg(m_mutex);
355 m_current_goal_name = name;
361 if (m_current_goal_name ==
"")
365 name = m_current_goal_name;
371 m_current_goal_name =
"";
contains the definition of a Map2DPath type
return_get_current_nav_waypoint get_current_nav_waypoint_RPC() override
return_get_all_nav_waypoints get_all_navigation_waypoints_RPC(yarp::dev::Nav2D::TrajectoryTypeEnum trajectory_type) override
bool goto_target_by_relative_location2_RPC(double x, double y, double theta) override
return_get_abs_loc_of_curr_target get_absolute_location_of_current_target_RPC() override
bool suspend_navigation_RPC(double time_s) override
return_get_name_of_current_target get_name_of_current_target_RPC() override
void setInterfaces(yarp::dev::Nav2D::INavigation2DTargetActions *iNav_target, yarp::dev::Nav2D::INavigation2DControlActions *iNav_ctrl, yarp::dev::Nav2D::INavigation2DVelocityActions *iNav_vel)
return_get_current_nav_map get_current_navigation_map_RPC(yarp::dev::Nav2D::NavigationMapTypeEnum map_type) override
bool follow_path_RPC(const yarp::dev::Nav2D::Map2DPath &path) override
return_get_rel_loc_of_curr_target get_relative_location_of_current_target_RPC() override
bool apply_velocity_command_RPC(double x_vel, double y_vel, double theta_vel, double timeout) override
return_get_last_velocity_command get_last_velocity_command_RPC() override
bool goto_target_by_absolute_location_RPC(const yarp::dev::Nav2D::Map2DLocation &loc) override
bool goto_target_by_absolute_location_and_set_name_RPC(const yarp::dev::Nav2D::Map2DLocation &loc, const std::string &name) override
return_get_navigation_status get_navigation_status_RPC() override
bool recompute_current_navigation_path_RPC() override
bool resume_navigation_RPC() override
bool goto_target_by_relative_location1_RPC(double x, double y) override
bool stop_navigation_RPC() override
bool set_current_goal_name(const std::string &name)
bool get_current_goal_name(std::string &name)
virtual bool recomputeCurrentNavigationPath()=0
Forces the navigation system to recompute the path from the current robot position to the current goa...
virtual bool getAllNavigationWaypoints(yarp::dev::Nav2D::TrajectoryTypeEnum trajectory_type, yarp::dev::Nav2D::Map2DPath &waypoints)=0
Returns the list of waypoints generated by the navigation algorithm.
virtual bool getCurrentNavigationWaypoint(yarp::dev::Nav2D::Map2DLocation &curr_waypoint)=0
Returns the current waypoint pursued by the navigation algorithm.
virtual bool resumeNavigation()=0
Resume a previously suspended navigation task.
virtual bool getNavigationStatus(NavigationStatusEnum &status)=0
Gets the current status of the navigation task.
virtual bool stopNavigation()=0
Terminates the current navigation task.
virtual bool suspendNavigation(const double time_s=std::numeric_limits< double >::infinity())=0
Ask to the robot to suspend the current navigation task for a defined amount of time.
virtual bool getCurrentNavigationMap(yarp::dev::Nav2D::NavigationMapTypeEnum map_type, yarp::dev::Nav2D::MapGrid2D &map)=0
Returns the current navigation map processed by the navigation algorithm.
virtual bool gotoTargetByRelativeLocation(double x, double y)=0
Ask the robot to reach a position defined in the robot reference frame.
virtual bool gotoTargetByAbsoluteLocation(yarp::dev::Nav2D::Map2DLocation loc)=0
Ask the robot to reach a position defined in the world reference frame.
virtual bool getAbsoluteLocationOfCurrentTarget(yarp::dev::Nav2D::Map2DLocation &loc)=0
Gets the last navigation target in the world reference frame.
virtual bool followPath(const yarp::dev::Nav2D::Map2DPath &path)=0
Ask the robot to navigate through a set of locations defined in the world reference frame.
virtual bool getRelativeLocationOfCurrentTarget(double &x, double &y, double &theta)=0
Gets the last navigation target in the robot reference frame.
virtual bool applyVelocityCommand(double x_vel, double y_vel, double theta_vel, double timeout=0.1)=0
Apply a velocity command.
virtual bool getLastVelocityCommand(double &x_vel, double &y_vel, double &theta_vel)=0
Returns the last applied velocity command.
A mini-server for performing network communication in the background.
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.