visualization.h
Go to the documentation of this file.
00001 /*********************************************************************
00002  *
00003  * Software License Agreement (BSD License)
00004  *
00005  *  Copyright (c) 2016,
00006  *  TU Dortmund - Institute of Control Theory and Systems Engineering.
00007  *  All rights reserved.
00008  *
00009  *  Redistribution and use in source and binary forms, with or without
00010  *  modification, are permitted provided that the following conditions
00011  *  are met:
00012  *
00013  *   * Redistributions of source code must retain the above copyright
00014  *     notice, this list of conditions and the following disclaimer.
00015  *   * Redistributions in binary form must reproduce the above
00016  *     copyright notice, this list of conditions and the following
00017  *     disclaimer in the documentation and/or other materials provided
00018  *     with the distribution.
00019  *   * Neither the name of the institute nor the names of its
00020  *     contributors may be used to endorse or promote products derived
00021  *     from this software without specific prior written permission.
00022  *
00023  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00024  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00025  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00026  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00027  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00028  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00029  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00030  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00031  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00032  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00033  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00034  *  POSSIBILITY OF SUCH DAMAGE.
00035  *
00036  * Author: Christoph Rösmann
00037  *********************************************************************/
00038 
00039 #ifndef VISUALIZATION_H_
00040 #define VISUALIZATION_H_
00041 
00042 
00043 
00044 // teb stuff
00045 #include <teb_local_planner/teb_config.h>
00046 #include <teb_local_planner/timed_elastic_band.h>
00047 #include <teb_local_planner/robot_footprint_model.h>
00048 
00049 // ros stuff
00050 #include <ros/publisher.h>
00051 #include <base_local_planner/goal_functions.h>
00052 
00053 // boost
00054 #include <boost/graph/adjacency_list.hpp>
00055 #include <boost/graph/graph_traits.hpp>
00056 
00057 // std
00058 #include <iterator>
00059 
00060 // messages
00061 #include <nav_msgs/Path.h>
00062 #include <geometry_msgs/PoseStamped.h>
00063 #include <geometry_msgs/PoseArray.h>
00064 #include <tf/transform_datatypes.h>
00065 #include <nav_msgs/Odometry.h>
00066 #include <nav_msgs/Path.h>
00067 #include <visualization_msgs/Marker.h>
00068 
00069 namespace teb_local_planner
00070 {
00071   
00072 class TebOptimalPlanner; 
00073 
00074   
00079 class TebVisualization
00080 {
00081 public:
00082     
00087   TebVisualization();
00088   
00094   TebVisualization(ros::NodeHandle& nh, const std::string& visualization_frame);
00095   
00103   void initialize(ros::NodeHandle& nh, const std::string& visualization_frame);
00104   
00105   
00108   
00113   void publishGlobalPlan(const std::vector<geometry_msgs::PoseStamped>& global_plan) const;
00114   
00119   void publishLocalPlan(const std::vector<geometry_msgs::PoseStamped>& local_plan) const;
00120   
00128   void publishLocalPlanAndPoses(const TimedElasticBand& teb) const;
00129   
00137   void publishRobotFootprintModel(const PoseSE2& current_pose, const BaseRobotFootprintModel& robot_model, const std::string& ns = "RobotFootprintModel");
00138   
00144   void publishObstacles(const ObstContainer& obstacles) const;
00145   
00150   void publishViaPoints(const std::vector< Eigen::Vector2d, Eigen::aligned_allocator<Eigen::Vector2d> >& via_points, const std::string& ns = "ViaPoints") const;
00151   
00160   template <typename GraphType>
00161   void publishGraph(const GraphType& graph, const std::string& ns_prefix = "Graph");
00162   
00188   template <typename BidirIter>
00189   void publishPathContainer(BidirIter first, BidirIter last, const std::string& ns = "PathContainer");
00190   
00197   void publishTebContainer(const std::vector< boost::shared_ptr<TebOptimalPlanner> >& teb_planner, const std::string& ns = "TebContainer");
00198     
00209   void publishFeedbackMessage(const std::vector< boost::shared_ptr<TebOptimalPlanner> >& teb_planners, unsigned int selected_trajectory_idx, const ObstContainer& obstacles);
00210   
00220   void publishFeedbackMessage(const TebOptimalPlanner& teb_planner, const ObstContainer& obstacles);
00221   
00223   
00224 protected:
00225   
00230   bool printErrorWhenNotInitialized() const;
00231 
00232   ros::Publisher global_plan_pub_; 
00233   ros::Publisher local_plan_pub_; 
00234   ros::Publisher teb_poses_pub_; 
00235   ros::Publisher teb_marker_pub_; 
00236   ros::Publisher feedback_pub_; 
00237   
00238   std::string visualization_frame_ = "map"; // coordinate frame in which everything should be visualized by default
00239   
00240   bool initialized_; 
00241 
00242     
00243 public:
00244     EIGEN_MAKE_ALIGNED_OPERATOR_NEW    
00245 };
00246 
00248 typedef boost::shared_ptr<TebVisualization> TebVisualizationPtr;
00249 
00251 typedef boost::shared_ptr<const TebVisualization> TebVisualizationConstPtr;
00252 
00253 
00254 } // namespace teb_local_planner
00255 
00256 
00257 // Include template method implementations / definitions
00258 #include <teb_local_planner/visualization.hpp>
00259 
00260 #endif /* VISUALIZATION_H_ */


teb_local_planner
Author(s): Christoph Rösmann
autogenerated on Sat Jun 8 2019 20:21:34