ftc_planner.h
Go to the documentation of this file.
1 
18 #ifndef FTC_LOCAL_PLANNER_FTC_PLANNER_H_
19 #define FTC_LOCAL_PLANNER_FTC_PLANNER_H_
20 
21 #include <nav_msgs/Odometry.h>
22 
24 
25 #include <tf/transform_listener.h>
26 
27 #include <Eigen/Core>
28 
29 #include <dynamic_reconfigure/server.h>
30 
31 #include <asr_ftc_local_planner/FTCPlannerConfig.h>
32 
34 
36 
38 
40 {
41 
43  {
44 
45  public:
46  FTCPlanner();
52  bool computeVelocityCommands(geometry_msgs::Twist& cmd_vel);
53 
58  bool isGoalReached();
59 
65  bool setPlan(const std::vector<geometry_msgs::PoseStamped>& plan);
66 
73  void initialize(std::string name, tf::TransformListener* tf, costmap_2d::Costmap2DROS* costmap_ros);
74 
75  ~FTCPlanner();
76 
77  private:
78 
82  void reconfigureCB(FTCPlannerConfig &config, uint32_t level);
83 
89  int checkMaxDistance(tf::Stamped<tf::Pose> current_pose);
90 
97  int checkMaxAngle(int points, tf::Stamped<tf::Pose> current_pose);
98 
106  bool rotateToOrientation(double angle, geometry_msgs::Twist& cmd_vel, double accuracy);
107 
112  void publishPlan(int max_point);
113 
120  int driveToward(tf::Stamped<tf::Pose> current_pose, geometry_msgs::Twist& cmd_vel);
121 
128  double calculateGlobalPlanAngle(tf::Stamped<tf::Pose> current_pose, const std::vector<geometry_msgs::PoseStamped>& plan, int points);
129 
135  bool checkCollision(int max_points);
136 
137  //used for transformation
139  //costmap to get the current position
141  //global plan which we run along
142  std::vector<geometry_msgs::PoseStamped> global_plan_;
143  //transformed global plan in global frame with only the points with are needed for calculation (max_points)
144  std::vector<geometry_msgs::PoseStamped> transformed_global_plan_;
145  //check if plan first at first time
147  //last point of the global plan in global frame
149  // true if the robot should rotate to gobal plan if new global goal set
151  // true if the robot should rotate to gobal plan if new global goal set
153  //for dynamic reconfigure
154  dynamic_reconfigure::Server<FTCPlannerConfig> *dsrv_;
155  //start config
156  ftc_local_planner::FTCPlannerConfig default_config_;
157  //reconfigure config
158  ftc_local_planner::FTCPlannerConfig config_;
159  //true if the goal point is reache and orientation of goal is reached
161  //true if the goal point is reache and orientation of goal isn't reached
163  //opublisher where the local plan for visulatation is published
165 
166  //rotation velocity of previous round for the rotateToOrientation methode
168  //x velocity of the previous round
170  //rotation velocity of previous round for the dirveToward methode
172 
174 
175  };
176 };
177 #endif
bool setPlan(const std::vector< geometry_msgs::PoseStamped > &plan)
Set the plan that the local planner is following.
Definition: ftc_planner.cpp:67
int checkMaxAngle(int points, tf::Stamped< tf::Pose > current_pose)
Goes backward along global plan the max angle whith sim_time and max_rotation_vel allow...
tf::Stamped< tf::Pose > goal_pose_
Definition: ftc_planner.h:148
void reconfigureCB(FTCPlannerConfig &config, uint32_t level)
Reconfigure config_.
Definition: ftc_planner.cpp:57
int checkMaxDistance(tf::Stamped< tf::Pose > current_pose)
Goes along global plan the max distance whith sim_time and max_x_vel allow.
tf::Stamped< tf::Pose > old_goal_pose_
Definition: ftc_planner.h:150
tf::TransformListener * tf_
Definition: ftc_planner.h:138
std::vector< geometry_msgs::PoseStamped > transformed_global_plan_
Definition: ftc_planner.h:144
std::vector< geometry_msgs::PoseStamped > global_plan_
Definition: ftc_planner.h:142
bool rotateToOrientation(double angle, geometry_msgs::Twist &cmd_vel, double accuracy)
Rotation at place.
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
bool isGoalReached()
Check if the goal pose has been achieved by the local planner.
dynamic_reconfigure::Server< FTCPlannerConfig > * dsrv_
Definition: ftc_planner.h:154
bool checkCollision(int max_points)
Check if the considerd points are in local collision.
ros::Publisher local_plan_publisher_
Definition: ftc_planner.h:164
double calculateGlobalPlanAngle(tf::Stamped< tf::Pose > current_pose, const std::vector< geometry_msgs::PoseStamped > &plan, int points)
Calculate the orientation of the global plan.
void publishPlan(int max_point)
Publish the global plan for visulatation.
bool computeVelocityCommands(geometry_msgs::Twist &cmd_vel)
Given the current position, orientation, and velocity of the robot, compute velocity commands to send...
void initialize(std::string name, tf::TransformListener *tf, costmap_2d::Costmap2DROS *costmap_ros)
Constructs the local planner.
Definition: ftc_planner.cpp:33
ftc_local_planner::FTCPlannerConfig config_
Definition: ftc_planner.h:158
ftc_local_planner::FTCPlannerConfig default_config_
Definition: ftc_planner.h:156
int driveToward(tf::Stamped< tf::Pose > current_pose, geometry_msgs::Twist &cmd_vel)
Drive along the global plan and calculate the velocity.
costmap_2d::Costmap2DROS * costmap_ros_
Definition: ftc_planner.h:140


asr_ftc_local_planner
Author(s): Marek Felix
autogenerated on Mon Jun 17 2019 19:56:22