20#include <actionlib/server/simple_action_server.h>
21#include <odom_tracker/OdomTrackerAction.h>
25typedef actionlib::SimpleActionServer<odom_tracker::OdomTrackerAction>
Server;
27using namespace odom_tracker;
33 std::shared_ptr<Server>
as_;
44 const OdomTrackerGoalConstPtr & goal)
48 switch (goal->command)
50 case OdomTrackerGoal::RECORD_PATH:
54 case OdomTrackerGoal::CLEAR_PATH:
58 case OdomTrackerGoal::IDLE:
62 case OdomTrackerGoal::START_BROADCAST_PATH:
66 case OdomTrackerGoal::STOP_BROADCAST_PATH:
70 case OdomTrackerGoal::PUSH_PATH:
74 case OdomTrackerGoal::POP_PATH:
81 getLogger(),
"Odom Tracker Node - Action Server execute error: incorrect command - %d",
89 catch (std::exception & ex)
91 RCLCPP_ERROR(getLogger(),
"Odom Tracker Node - Action Server execute error: %s", ex.what());
103 rclcpp::Node::SharedPtr n;
104 RCLCPP_INFO(getLogger(),
"Creating odom tracker action server");
106 as_ = std::make_shared<Server>(
108 RCLCPP_INFO(getLogger(),
"Starting OdomTracker Action Server");
116int main(
int argc,
char ** argv)
118 ros::init(argc, argv,
"odom_tracker_node");
std::shared_ptr< Server > as_
OdomTrackerActionServer()
void execute(const OdomTrackerGoalConstPtr &goal)
void setPublishMessages(bool value)
void setWorkingMode(WorkingMode workingMode)
void popPath(int pathCount=1, bool keepPreviousPath=false)
int main(int argc, char **argv)
actionlib::SimpleActionServer< odom_tracker::OdomTrackerAction > Server