SMACC
Loading...
Searching...
No Matches
forward_local_planner.h
Go to the documentation of this file.
1/*****************************************************************************************************************
2 * ReelRobotix Inc. - Software License Agreement Copyright (c) 2018
3 * Authors: Pablo Inigo Blasco, Brett Aldrich
4 *
5 ******************************************************************************************************************/
6#pragma once
7#include <dynamic_reconfigure/server.h>
8#include <geometry_msgs/PoseStamped.h>
9#include <nav_core/base_local_planner.h>
10#include <tf/tf.h>
11#include <tf/transform_listener.h>
12#include <tf2_ros/buffer.h>
13#include <Eigen/Eigen>
14
15typedef double meter;
16typedef double rad;
17
18namespace cl_move_base_z
19{
20namespace forward_local_planner
21{
22class ForwardLocalPlanner : public nav_core::BaseLocalPlanner
23{
24
25public:
27
28 virtual ~ForwardLocalPlanner();
29
35 virtual bool computeVelocityCommands(geometry_msgs::Twist &cmd_vel) override;
36
41 virtual bool isGoalReached() override;
42
48 virtual bool setPlan(const std::vector<geometry_msgs::PoseStamped> &plan) override;
49
56 void initialize(std::string name, tf::TransformListener *tf, costmap_2d::Costmap2DROS *costmapRos_);
57
58 void initialize(std::string name, tf2_ros::Buffer *tf, costmap_2d::Costmap2DROS *costmapRos);
59
60 void initialize();
61
62private:
63 void publishGoalMarker(double x, double y, double phi);
64
65 costmap_2d::Costmap2DROS *costmapRos_;
66
67 ros::Publisher goalMarkerPublisher_;
68
69 double k_rho_;
70 double k_alpha_;
71 double k_betta_;
73
74 const double alpha_offset_ = 0;
75 const double betta_offset_ = 0;
76
79
80 double yaw_goal_tolerance_; // radians
81 double xy_goal_tolerance_; // meters
82
85
86 void generateTrajectory(const Eigen::Vector3f &pos, const Eigen::Vector3f &vel, float maxdist, float maxangle, float maxtime, float dt, std::vector<Eigen::Vector3f> &outtraj);
87 Eigen::Vector3f computeNewPositions(const Eigen::Vector3f &pos, const Eigen::Vector3f &vel, double dt);
88
89 // references the current point inside the backwardsPlanPath were the robot is located
91
92 std::vector<geometry_msgs::PoseStamped> plan_;
93
95 ros::Duration waitingTimeout_;
96 ros::Time waitingStamp_;
97};
98} // namespace forward_local_planner
99} // namespace cl_move_base_z
double rad
double meter
Eigen::Vector3f computeNewPositions(const Eigen::Vector3f &pos, const Eigen::Vector3f &vel, double dt)
virtual bool computeVelocityCommands(geometry_msgs::Twist &cmd_vel) override
Given the current position, orientation, and velocity of the robot: compute velocity commands to send...
void generateTrajectory(const Eigen::Vector3f &pos, const Eigen::Vector3f &vel, float maxdist, float maxangle, float maxtime, float dt, std::vector< Eigen::Vector3f > &outtraj)
virtual bool setPlan(const std::vector< geometry_msgs::PoseStamped > &plan) override
Set the plan that the local planner is following.
virtual bool isGoalReached() override
Check if the goal pose has been achieved by the local planner.
double rad
double meter