SMACC
Loading...
Searching...
No Matches
waypoints_navigator.h
Go to the documentation of this file.
1
2/*****************************************************************************************************************
3 * ReelRobotix Inc. - Software License Agreement Copyright (c) 2018
4 * Authors: Pablo Inigo Blasco, Brett Aldrich
5 *
6 ******************************************************************************************************************/
7#pragma once
8
9#include <smacc/smacc.h>
10#include <geometry_msgs/Pose.h>
13
14namespace cl_move_base_z
15{
16class ClMoveBaseZ;
17
18struct Pose2D
19{
20 Pose2D(double x, double y, double yaw)
21 {
22 this->x_ = x;
23 this->y_ = y;
24 this->yaw_ = yaw;
25 }
26
27 double x_;
28 double y_;
29 double yaw_;
30};
31
33{
34public:
36
38
40
41 virtual void onInitialize() override;
42
43 void insertWaypoint(int index, geometry_msgs::Pose &newpose);
44
45 void removeWaypoint(int index);
46
47 void loadWayPointsFromFile(std::string filepath);
48
49 void setWaypoints(const std::vector<geometry_msgs::Pose> &waypoints);
50
51 void setWaypoints(const std::vector<Pose2D> &waypoints);
52
53 void sendNextGoal();
54
55 const std::vector<geometry_msgs::Pose> &getWaypoints() const;
56
57 long getCurrentWaypointIndex() const;
58
59 template <typename TOrthogonal, typename TSourceObject>
61 {
62 waypointsEventDispatcher.initialize<TSourceObject, TOrthogonal>(client_);
63 }
64
66
67private:
69
70 std::vector<geometry_msgs::Pose> waypoints_;
71
72 boost::signals2::connection succeddedConnection_;
73};
74} // namespace cl_move_base_z
SmaccActionClientBase< move_base_msgs::MoveBaseAction >::ResultConstPtr ResultConstPtr
void loadWayPointsFromFile(std::string filepath)
void setWaypoints(const std::vector< geometry_msgs::Pose > &waypoints)
WaypointEventDispatcher waypointsEventDispatcher
const std::vector< geometry_msgs::Pose > & getWaypoints() const
void insertWaypoint(int index, geometry_msgs::Pose &newpose)
boost::signals2::connection succeddedConnection_
std::vector< geometry_msgs::Pose > waypoints_
void onGoalReached(ClMoveBaseZ::ResultConstPtr &res)
Pose2D(double x, double y, double yaw)