SMACC2
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
CpOdomTrackerActionServer Class Reference
Collaboration diagram for CpOdomTrackerActionServer:
Collaboration graph

Public Member Functions

 CpOdomTrackerActionServer ()
 
void execute (const CpOdomTrackerGoalConstPtr &goal)
 
void run ()
 

Public Attributes

std::shared_ptr< Serveras_
 
CpOdomTracker odomTracker
 

Detailed Description

Definition at line 30 of file cp_odom_tracker_node.cpp.

Constructor & Destructor Documentation

◆ CpOdomTrackerActionServer()

CpOdomTrackerActionServer::CpOdomTrackerActionServer ( )
inline

Definition at line 36 of file cp_odom_tracker_node.cpp.

36: odomTracker("move_base") {}

Member Function Documentation

◆ execute()

void CpOdomTrackerActionServer::execute ( const CpOdomTrackerGoalConstPtr &  goal)
inline

execute()

Definition at line 43 of file cp_odom_tracker_node.cpp.

45 {
46 try
47 {
48 switch (goal->command)
49 {
50 case CpOdomTrackerGoal::RECORD_PATH:
51 odomTracker.setWorkingMode(WorkingMode::RECORD_PATH);
52 break;
53
54 case CpOdomTrackerGoal::CLEAR_PATH:
55 odomTracker.setWorkingMode(WorkingMode::CLEAR_PATH);
56 break;
57
58 case CpOdomTrackerGoal::IDLE:
59 odomTracker.setWorkingMode(WorkingMode::IDLE);
60 break;
61
62 case CpOdomTrackerGoal::START_BROADCAST_PATH:
64 break;
65
66 case CpOdomTrackerGoal::STOP_BROADCAST_PATH:
68 break;
69
70 case CpOdomTrackerGoal::PUSH_PATH:
72 break;
73
74 case CpOdomTrackerGoal::POP_PATH:
76 break;
77
78 default:
79
80 RCLCPP_ERROR(
81 getLogger(), "Odom Tracker Node - Action Server execute error: incorrect command - %d",
82 goal->command);
83 as_->setAborted();
84 }
85
86 // never reach succeeded because were are interested in keeping the feedback alive
87 as_->setSucceeded();
88 }
89 catch (std::exception & ex)
90 {
91 RCLCPP_ERROR(getLogger(), "Odom Tracker Node - Action Server execute error: %s", ex.what());
92 as_->setAborted();
93 }
94 }
std::shared_ptr< Server > as_
void popPath(int pathCount=1, bool keepPreviousPath=false)
void setWorkingMode(WorkingMode workingMode)

References as_, odomTracker, cl_nav2z::odom_tracker::CpOdomTracker::popPath(), cl_nav2z::odom_tracker::CpOdomTracker::pushPath(), cl_nav2z::odom_tracker::CpOdomTracker::setPublishMessages(), and cl_nav2z::odom_tracker::CpOdomTracker::setWorkingMode().

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

void CpOdomTrackerActionServer::run ( )
inline

run()

Definition at line 101 of file cp_odom_tracker_node.cpp.

102 {
103 rclcpp::Node::SharedPtr n;
104 RCLCPP_INFO(getLogger(), "Creating odom tracker action server");
105
106 as_ = std::make_shared<Server>(
107 n, "odom_tracker",
108 std::bind(&CpOdomTrackerActionServer::execute, this, std::placeholders::_1), false);
109 RCLCPP_INFO(getLogger(), "Starting CpOdomTracker Action Server");
110
111 as_->start();
112
113 ros::spin();
114 }
void execute(const CpOdomTrackerGoalConstPtr &goal)

References as_, and execute().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ as_

std::shared_ptr<Server> CpOdomTrackerActionServer::as_

Definition at line 33 of file cp_odom_tracker_node.cpp.

Referenced by execute(), and run().

◆ odomTracker

CpOdomTracker CpOdomTrackerActionServer::odomTracker

Definition at line 34 of file cp_odom_tracker_node.cpp.

Referenced by execute().


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