104 "Global Costmap failure."));
119 "Global Planning Failure."));
140 "Local Costmap failure."));
148 ROS_WARN_NAMED(
"locomotor",
"Control loop missed its desired rate of %.4fHz... " 149 "the loop actually took %.4f seconds (>%.4f).",
157 ROS_WARN_NAMED(
"Locomotor",
"Local planning error. Creating new global plan.");
192 int main(
int argc,
char** argv)
void onNewGlobalPlan(nav_2d_msgs::Path2D new_global_plan, const ros::Duration &planning_time)
virtual void setPlan(const nav_2d_msgs::Path2D &path)=0
void onNavigationFailure(const locomotor_msgs::ResultCode result)
void onLocalCostmapUpdate(const ros::Duration &planning_time)
void publishTwist(const nav_2d_msgs::Twist2DStamped &command)
void failNavigation(const locomotor_msgs::ResultCode &result_code)
nav_core2::LocalPlanner & getCurrentLocalPlanner()
#define ROS_INFO_NAMED(name,...)
Collection of objects used in ROS CallbackQueue threading.
#define ROS_WARN_NAMED(name,...)
void onGlobalCostmapUpdate(const ros::Duration &planning_time)
locomotor_msgs::ResultCode makeResultCode(int component=-1, int result_code=-1, const std::string &message="")
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void requestLocalCostmapUpdate(Executor &work_ex, Executor &result_ex, CostmapUpdateCallback cb=nullptr, CostmapUpdateExceptionCallback fail_cb=nullptr)
Request the local costmap get updated as a new callback.
SingleThreadLocomotor(const ros::NodeHandle &private_nh)
void initializeGlobalPlanners(Executor &ex)
virtual void setGoal(nav_2d_msgs::Pose2DStamped goal)
Starts a new navigation to the given goal.
void completeNavigation()
std::exception_ptr NavCore2ExceptionPtr
ROSCPP_DECL void spin(Spinner &spinner)
void publishFeedback(const locomotor_msgs::NavigationState &nav_state)
void onNavigationCompleted()
void onLocalPlanningException(nav_core2::NavCore2ExceptionPtr e_ptr, const ros::Duration &planning_time)
ros::Timer control_loop_timer_
void publishPath(const nav_2d_msgs::Path2D &global_plan)
an extensible path planning coordination engine
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
const locomotor_msgs::NavigationState & getNavigationState() const
void initializeLocalCostmap(Executor &ex)
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
LocomotorActionServer as_
void requestGlobalCostmapUpdate()
void initializeGlobalCostmap(Executor &ex)
double controller_frequency_
Connect the callbacks in Locomotor to do global planning once and then local planning on a timer...
void controlLoopCallback(const ros::TimerEvent &event)
void initializeLocalPlanners(Executor &ex)
void onNewLocalPlan(nav_2d_msgs::Twist2DStamped new_command, const ros::Duration &planning_time)
void requestNavigationFailure(Executor &result_ex, const locomotor_msgs::ResultCode &result, NavigationFailureCallback cb=nullptr)
Request that a onNavigationFailure event be added as a new callback.
void setGoal(nav_2d_msgs::Pose2DStamped goal)
#define ROS_ERROR_NAMED(name,...)
ros::Duration desired_control_duration_
int main(int argc, char **argv)
ros::NodeHandle private_nh_
void requestGlobalCostmapUpdate(Executor &work_ex, Executor &result_ex, CostmapUpdateCallback cb=nullptr, CostmapUpdateExceptionCallback fail_cb=nullptr)
Request the global costmap get updated as a new callback.
void onGlobalPlanningException(nav_core2::NavCore2ExceptionPtr e_ptr, const ros::Duration &planning_time)
void onLocalCostmapException(nav_core2::NavCore2ExceptionPtr e_ptr, const ros::Duration &planning_time)
void requestNavigationFailure(const locomotor_msgs::ResultCode &result)
void onGlobalCostmapException(nav_core2::NavCore2ExceptionPtr e_ptr, const ros::Duration &planning_time)
void requestGlobalPlan(Executor &work_ex, Executor &result_ex, GlobalPlanCallback cb=nullptr, PlannerExceptionCallback fail_cb=nullptr)
Request the global planner get run as a new callback.
int getResultCode(const NavCore2ExceptionPtr &e_ptr)
void requestLocalPlan(Executor &work_ex, Executor &result_ex, LocalPlanCallback cb=nullptr, PlannerExceptionCallback fail_cb=nullptr, NavigationCompleteCallback complete_cb=nullptr)
Request the local planner get run as a new callback.