SMACC
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Attributes | List of all members
cl_move_base_z::CbUndoPathBackwards Class Reference

#include <cb_undo_path_backwards.h>

Inheritance diagram for cl_move_base_z::CbUndoPathBackwards:
Inheritance graph
Collaboration diagram for cl_move_base_z::CbUndoPathBackwards:
Collaboration graph

Public Member Functions

virtual void onEntry () override
 
virtual void onExit () override
 
- Public Member Functions inherited from cl_move_base_z::CbMoveBaseClientBehaviorBase
template<typename TOrthogonal , typename TSourceObject >
void onOrthogonalAllocation ()
 
- Public Member Functions inherited from smacc::SmaccAsyncClientBehavior
template<typename TOrthogonal , typename TSourceObject >
void onOrthogonalAllocation ()
 
virtual ~SmaccAsyncClientBehavior ()
 
template<typename TCallback , typename T >
boost::signals2::connection onSuccess (TCallback callback, T *object)
 
template<typename TCallback , typename T >
boost::signals2::connection onFinished (TCallback callback, T *object)
 
template<typename TCallback , typename T >
boost::signals2::connection onFailure (TCallback callback, T *object)
 
- Public Member Functions inherited from smacc::ISmaccClientBehavior
 ISmaccClientBehavior ()
 
virtual ~ISmaccClientBehavior ()
 
ISmaccStateMachinegetStateMachine ()
 
std::string getName () const
 
template<typename SmaccClientType >
void requiresClient (SmaccClientType *&storage)
 
template<typename SmaccComponentType >
void requiresComponent (SmaccComponentType *&storage)
 
ros::NodeHandle getNode ()
 

Public Attributes

boost::optional< UndoPathLocalPlannerforceUndoLocalPlanner
 

Private Attributes

tf::TransformListener listener
 

Additional Inherited Members

- Protected Member Functions inherited from smacc::SmaccAsyncClientBehavior
virtual void executeOnEntry () override
 
virtual void executeOnExit () override
 
void postSuccessEvent ()
 
void postFailureEvent ()
 
virtual void dispose () override
 
- Protected Member Functions inherited from smacc::ISmaccClientBehavior
virtual void runtimeConfigure ()
 
virtual void onEntry ()
 
virtual void onExit ()
 
template<typename EventType >
void postEvent (const EventType &ev)
 
template<typename EventType >
void postEvent ()
 
ISmaccStategetCurrentState ()
 
virtual void executeOnEntry ()
 
virtual void executeOnExit ()
 
virtual void dispose ()
 
- Protected Attributes inherited from cl_move_base_z::CbMoveBaseClientBehaviorBase
ClMoveBaseZmoveBaseClient_
 
ros::Publisher visualizationMarkersPub_
 

Detailed Description

Definition at line 21 of file cb_undo_path_backwards.h.

Member Function Documentation

◆ onEntry()

void cl_move_base_z::CbUndoPathBackwards::onEntry ( )
overridevirtual

Reimplemented from smacc::ISmaccClientBehavior.

Definition at line 9 of file cb_undo_path_backwards.cpp.

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}
boost::optional< UndoPathLocalPlanner > forceUndoLocalPlanner
TComponent * getComponent()

References forceUndoLocalPlanner, smacc::ISmaccClient::getComponent(), cl_move_base_z::CbMoveBaseClientBehaviorBase::moveBaseClient_, cl_move_base_z::PureSpinningLocalPlanner, and smacc::client_bases::SmaccActionClientBase< ActionType >::sendGoal().

Here is the call graph for this function:

◆ onExit()

void cl_move_base_z::CbUndoPathBackwards::onExit ( )
overridevirtual

Reimplemented from smacc::ISmaccClientBehavior.

Definition at line 50 of file cb_undo_path_backwards.cpp.

51{
52 auto *odomTracker = moveBaseClient_->getComponent<OdomTracker>();
53 odomTracker->popPath();
54}

References smacc::ISmaccClient::getComponent(), and cl_move_base_z::CbMoveBaseClientBehaviorBase::moveBaseClient_.

Here is the call graph for this function:

Member Data Documentation

◆ forceUndoLocalPlanner

boost::optional<UndoPathLocalPlanner> cl_move_base_z::CbUndoPathBackwards::forceUndoLocalPlanner

Definition at line 24 of file cb_undo_path_backwards.h.

Referenced by onEntry().

◆ listener

tf::TransformListener cl_move_base_z::CbUndoPathBackwards::listener
private

Definition at line 31 of file cb_undo_path_backwards.h.


The documentation for this class was generated from the following files: