ROS Navigation-----dwa_planner_ros类

来源:互联网 发布:雅思经验 知乎 编辑:程序博客网 时间:2024/05/19 15:43

类的成员变量:
private:
tf::TransformListener* tf_; ///< @brief Used for transforming point clouds
ros::Publisher g_plan_pub_, l_plan_pub_; // for visualisation, publishers of global and local plan
base_local_planner::LocalPlannerUtil planner_util_; //该帮助接口提供了通用的接口可供所有规划器使用。它管理当前的全局规划,当前的运动约束,以及当前的代价地图(感知障碍物的局部代价地图)。
boost::shared_ptr dp_; ///< @brief The trajectory controller
costmap_2d::Costmap2DROS* costmap_ros_;
dynamic_reconfigure::Server *dsrv_;
dwa_local_planner::DWAPlannerConfig default_config_;
bool setup_;
tf::Stamped current_pose_;
base_local_planner::LatchedStopRotateController latchedStopRotateController_; //当机器人足够靠近目标时可以迅速启用。 该控制器将执行完全停止操作,让机器人停在目标允许的公差范围内。
bool initialized_;
base_local_planner::OdometryHelperRos odom_helper_;
std::string odom_topic_;

类的成员函数:
public:
1. DWAPlannerROS();
/**
* @brief Constructor for DWAPlannerROS wrapper
*/
2. void initialize(std::string name, tf::TransformListener* tf,
costmap_2d::Costmap2DROS* costmap_ros);
/**
* @brief Constructs the ros wrapper
* @param name The name to give this instance of the trajectory planner
* @param tf A pointer to a transform listener
* @param costmap The cost map to use for assigning costs to trajectories
*/
3. ~DWAPlannerROS();
4. bool computeVelocityCommands(geometry_msgs::Twist& cmd_vel);
5. bool dwaComputeVelocityCommands(tf::Stamped& global_pose, geometry_msgs::Twist& cmd_vel);
6. bool setPlan(const std::vector& orig_global_plan);
/**
* @brief Set the plan that the controller is following
* @param orig_global_plan The plan to pass to the controller
* @return True if the plan was updated successfully, false otherwise
*/
7. bool isGoalReached();
8. bool isInitialized() {return initialized_;}

private:
/**
* @brief Callback to update the local planner’s parameters based on dynamic reconfigure
*/
void reconfigureCB(DWAPlannerConfig &config, uint32_t level);

  void publishLocalPlan(std::vector<geometry_msgs::PoseStamped>& path);  void publishGlobalPlan(std::vector<geometry_msgs::PoseStamped>& path);
原创粉丝点击