SMACC
Loading...
Searching...
No Matches
cb_undo_path_backwards.cpp
Go to the documentation of this file.
4
5namespace cl_move_base_z
6{
7using namespace ::cl_move_base_z::odom_tracker;
8
10{
11 auto *odomTracker = moveBaseClient_->getComponent<OdomTracker>();
12
13 auto plannerSwitcher = moveBaseClient_->getComponent<PlannerSwitcher>();
14
15 nav_msgs::Path forwardpath = odomTracker->getPath();
16 // ROS_INFO_STREAM("[UndoPathBackward] Current path backwards: " << forwardpath);
17
18 odomTracker->setWorkingMode(WorkingMode::CLEAR_PATH);
19
20 ClMoveBaseZ::Goal goal;
21 // this line is used to flush/reset backward planner in the case it were already there
22 // plannerSwitcher->setDefaultPlanners();
23 if (forwardpath.poses.size() > 0)
24 {
25 goal.target_pose = forwardpath.poses.front();
26
28 {
30 {
31 ROS_INFO("[CbUndoPathBackwards] forced to use Pure Spinning local planner");
32 plannerSwitcher->setUndoPathPureSpinningPlannerConfiguration();
33 }
34 else
35 {
36 plannerSwitcher->setUndoPathBackwardsPlannerConfiguration();
37 ROS_INFO("[CbUndoPathBackwards] forced to use BackwardsLocalPlanner (default)");
38 }
39 }
40 else
41 {
42 ROS_INFO("[CbUndoPathBackwards] using default local planner: BackwardsLocalPlanner");
43 plannerSwitcher->setUndoPathBackwardsPlannerConfiguration();
44 }
45
47 }
48}
49
51{
52 auto *odomTracker = moveBaseClient_->getComponent<OdomTracker>();
53 odomTracker->popPath();
54}
55
56} // namespace cl_move_base_z
boost::optional< UndoPathLocalPlanner > forceUndoLocalPlanner
TComponent * getComponent()