SMACC2
Public Member Functions | Public Attributes | List of all members
OdomTrackerActionServer Class Reference
Collaboration diagram for OdomTrackerActionServer:
Collaboration graph

Public Member Functions

 OdomTrackerActionServer ()
 
void execute (const OdomTrackerGoalConstPtr &goal)
 
void run ()
 

Public Attributes

std::shared_ptr< Serveras_
 
OdomTracker odomTracker
 

Detailed Description

Definition at line 30 of file odom_tracker_node.cpp.

Constructor & Destructor Documentation

◆ OdomTrackerActionServer()

OdomTrackerActionServer::OdomTrackerActionServer ( )
inline

Definition at line 36 of file odom_tracker_node.cpp.

36: odomTracker("move_base") {}

Member Function Documentation

◆ execute()

void OdomTrackerActionServer::execute ( const OdomTrackerGoalConstPtr &  goal)
inline

execute()

Definition at line 43 of file odom_tracker_node.cpp.

45 {
46 try
47 {
48 switch (goal->command)
49 {
50 case OdomTrackerGoal::RECORD_PATH:
51 odomTracker.setWorkingMode(WorkingMode::RECORD_PATH);
52 break;
53
54 case OdomTrackerGoal::CLEAR_PATH:
55 odomTracker.setWorkingMode(WorkingMode::CLEAR_PATH);
56 break;
57
58 case OdomTrackerGoal::IDLE:
59 odomTracker.setWorkingMode(WorkingMode::IDLE);
60 break;
61
62 case OdomTrackerGoal::START_BROADCAST_PATH:
64 break;
65
66 case OdomTrackerGoal::STOP_BROADCAST_PATH:
68 break;
69
70 case OdomTrackerGoal::PUSH_PATH:
72 break;
73
74 case OdomTrackerGoal::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 setWorkingMode(WorkingMode workingMode)
void popPath(int pathCount=1, bool keepPreviousPath=false)

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

Referenced by run().

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

◆ run()

void OdomTrackerActionServer::run ( )
inline

run()

Definition at line 101 of file 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", boost::bind(&OdomTrackerActionServer::execute, this, _1), false);
108 RCLCPP_INFO(getLogger(), "Starting OdomTracker Action Server");
109
110 as_->start();
111
112 ros::spin();
113 }
void execute(const OdomTrackerGoalConstPtr &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> OdomTrackerActionServer::as_

Definition at line 33 of file odom_tracker_node.cpp.

Referenced by execute(), and run().

◆ odomTracker

OdomTracker OdomTrackerActionServer::odomTracker

Definition at line 34 of file odom_tracker_node.cpp.

Referenced by execute().


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