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);
41 m_current_goal_name.
clear();
47 std::lock_guard <std::mutex>
lg(m_mutex);
59 std::lock_guard <std::mutex>
lg(m_mutex);
72 std::lock_guard <std::mutex>
lg(m_mutex);
85 std::lock_guard <std::mutex>
lg(m_mutex);
105 std::lock_guard <std::mutex>
lg(m_mutex);
125 std::lock_guard <std::mutex>
lg(m_mutex);
138 ret.waypoints = path;
145 std::lock_guard <std::mutex>
lg(m_mutex);
158 ret.mapgrid = themap;
168 std::lock_guard <std::mutex>
lg(m_mutex);
175 m_current_goal_name.
clear();
181 std::lock_guard <std::mutex>
lg(m_mutex);
188 m_current_goal_name.
clear();
194 std::lock_guard <std::mutex>
lg(m_mutex);
201 m_current_goal_name.
clear();
207 std::lock_guard <std::mutex>
lg(m_mutex);
221 std::lock_guard <std::mutex>
lg(m_mutex);
228 m_current_goal_name.
clear();
234 std::lock_guard <std::mutex>
lg(m_mutex);
254 std::lock_guard <std::mutex>
lg(m_mutex);
277 std::lock_guard <std::mutex>
lg(m_mutex);
290 std::lock_guard <std::mutex>
lg(m_mutex);
313 std::lock_guard <std::mutex>
lg(m_mutex);
321 ret.ret = ReturnValue::return_code::return_value_error_method_failed;
325 ret.ret = ReturnValue::return_code::return_value_ok;
332 m_current_goal_name = name;
338 if (m_current_goal_name ==
"")
342 name = m_current_goal_name;
348 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
yarp::dev::ReturnValue suspend_navigation_RPC(double time_s) override
return_get_abs_loc_of_curr_target get_absolute_location_of_current_target_RPC() override
return_get_name_of_current_target get_name_of_current_target_RPC() override
yarp::dev::ReturnValue stop_navigation_RPC() override
return_get_current_nav_map get_current_navigation_map_RPC(yarp::dev::Nav2D::NavigationMapTypeEnum map_type) override
yarp::dev::ReturnValue goto_target_by_relative_location2_RPC(double x, double y, double theta) override
yarp::dev::ReturnValue resume_navigation_RPC() override
INavigation2DRPCd(yarp::dev::Nav2D::INavigation2DTargetActions *iNav_target, yarp::dev::Nav2D::INavigation2DControlActions *iNav_ctrl, yarp::dev::Nav2D::INavigation2DVelocityActions *iNav_vel)
yarp::dev::ReturnValue recompute_current_navigation_path_RPC() override
yarp::dev::ReturnValue goto_target_by_absolute_location_and_set_name_RPC(const yarp::dev::Nav2D::Map2DLocation &loc, const std::string &name) override
yarp::dev::ReturnValue goto_target_by_absolute_location_RPC(const yarp::dev::Nav2D::Map2DLocation &loc) override
return_get_rel_loc_of_curr_target get_relative_location_of_current_target_RPC() override
return_get_last_velocity_command get_last_velocity_command_RPC() override
yarp::dev::ReturnValue follow_path_RPC(const yarp::dev::Nav2D::Map2DPath &path) override
return_get_navigation_status get_navigation_status_RPC() override
yarp::dev::ReturnValue apply_velocity_command_RPC(double x_vel, double y_vel, double theta_vel, double timeout) override
yarp::dev::ReturnValue goto_target_by_relative_location1_RPC(double x, double y) override
bool set_current_goal_name(const std::string &name)
bool get_current_goal_name(std::string &name)
virtual yarp::dev::ReturnValue 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 yarp::dev::ReturnValue getCurrentNavigationWaypoint(yarp::dev::Nav2D::Map2DLocation &curr_waypoint)=0
Returns the current waypoint pursued by the navigation algorithm.
virtual yarp::dev::ReturnValue getAllNavigationWaypoints(yarp::dev::Nav2D::TrajectoryTypeEnum trajectory_type, yarp::dev::Nav2D::Map2DPath &waypoints)=0
Returns the list of waypoints generated by the navigation algorithm.
virtual yarp::dev::ReturnValue resumeNavigation()=0
Resume a previously suspended navigation task.
virtual yarp::dev::ReturnValue recomputeCurrentNavigationPath()=0
Forces the navigation system to recompute the path from the current robot position to the current goa...
virtual yarp::dev::ReturnValue getNavigationStatus(NavigationStatusEnum &status)=0
Gets the current status of the navigation task.
virtual yarp::dev::ReturnValue stopNavigation()=0
Terminates the current navigation task.
virtual yarp::dev::ReturnValue getCurrentNavigationMap(yarp::dev::Nav2D::NavigationMapTypeEnum map_type, yarp::dev::Nav2D::MapGrid2D &map)=0
Returns the current navigation map processed by the navigation algorithm.
virtual yarp::dev::ReturnValue getAbsoluteLocationOfCurrentTarget(yarp::dev::Nav2D::Map2DLocation &loc)=0
Gets the last navigation target in the world reference frame.
virtual yarp::dev::ReturnValue getRelativeLocationOfCurrentTarget(double &x, double &y, double &theta)=0
Gets the last navigation target in the robot reference frame.
virtual yarp::dev::ReturnValue gotoTargetByRelativeLocation(double x, double y)=0
Ask the robot to reach a position defined in the robot reference frame.
virtual yarp::dev::ReturnValue 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 yarp::dev::ReturnValue gotoTargetByAbsoluteLocation(yarp::dev::Nav2D::Map2DLocation loc)=0
Ask the robot to reach a position defined in the world reference frame.
virtual yarp::dev::ReturnValue getLastVelocityCommand(double &x_vel, double &y_vel, double &theta_vel)=0
Returns the last applied velocity command.
virtual yarp::dev::ReturnValue applyVelocityCommand(double x_vel, double y_vel, double theta_vel, double timeout=0.1)=0
Apply a 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.