trajectory_to_markers_alg.h
Go to the documentation of this file.
00001 // Copyright (C) 2010-2011 Institut de Robotica i Informatica Industrial, CSIC-UPC.
00002 // Author 
00003 // All rights reserved.
00004 //
00005 // This file is part of iri-ros-pkg
00006 // iri-ros-pkg is free software: you can redistribute it and/or modify
00007 // it under the terms of the GNU Lesser General Public License as published by
00008 // the Free Software Foundation, either version 3 of the License, or
00009 // at your option) any later version.
00010 //
00011 // This program is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public License
00017 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018 // 
00019 // IMPORTANT NOTE: This code has been generated through a script from the 
00020 // iri_ros_scripts. Please do NOT delete any comments to guarantee the correctness
00021 // of the scripts. ROS topics can be easly add by using those scripts. Please
00022 // refer to the IRI wiki page for more information:
00023 // http://wikiri.upc.es/index.php/Robotics_Lab
00024 
00025 #ifndef _trajectory_to_markers_alg_h_
00026 #define _trajectory_to_markers_alg_h_
00027 
00028 #include <iri_trajectory_to_markers/TrajectoryToMarkersConfig.h>
00029 #include "mutex.h"
00030 #include <Eigen/Core>
00031 #include <Eigen/Eigenvalues>
00032 
00033 //include trajectory_to_markers_alg main library
00034 #include <visualization_msgs/MarkerArray.h>
00035 #include <iri_nav_msgs/Trajectory.h>
00036 #include <tf/transform_broadcaster.h>
00037 #include <tf/transform_datatypes.h>
00038 
00044 class TrajectoryToMarkersAlgorithm
00045 {
00046   protected:
00053     CMutex alg_mutex_;
00054 
00055   private:
00056     visualization_msgs::MarkerArray marker_array_;
00057     visualization_msgs::Marker loops_marker_;
00058     visualization_msgs::Marker trajectory_marker_;
00059     visualization_msgs::Marker actual_marker_;
00060     std::vector<bool> loop_state_;
00061     uint nLoops_;
00062     
00063   public:
00070     typedef iri_trajectory_to_markers::TrajectoryToMarkersConfig Config;
00071 
00078     Config config_;
00079 
00088     TrajectoryToMarkersAlgorithm(void);
00089 
00095     void lock(void) { alg_mutex_.enter(); };
00096 
00102     void unlock(void) { alg_mutex_.exit(); };
00103 
00111     bool try_enter(void) { return alg_mutex_.try_enter(); };
00112 
00124     void config_update(Config& new_cfg, uint32_t level=0);
00125 
00126     // here define all trajectory_to_markers_alg interface methods to retrieve and set
00127     // the driver parameters
00128 
00135     ~TrajectoryToMarkersAlgorithm(void);
00136     
00139     void initialize_markers();
00140     
00143     bool drawCovariances(const iri_nav_msgs::Trajectory& msg);
00144    
00147     visualization_msgs::MarkerArray get_marker_array() const;
00148     
00151     visualization_msgs::Marker get_actual_marker() const;
00152     
00155     visualization_msgs::Marker create_marker(const uint& id, const std_msgs::Header& header, const Eigen::Matrix2f& covs, const float& theta_cov, const geometry_msgs::Point& position, const bool& loopClosure) const;
00156     
00159     void change_actual_marker(const Eigen::Matrix2f& covs, const float& theta_cov, const geometry_msgs::Point& position, const bool& loopClosure);
00160     
00163     visualization_msgs::Marker create_loop_marker(const uint& id, const std_msgs::Header& header, const geometry_msgs::Point& position1, const geometry_msgs::Point& position2) const;
00164     
00167     Eigen::Matrix2f get_ith_cov(const iri_nav_msgs::Trajectory& msg, const uint i) const;
00168     
00171     float get_ith_theta_cov(const iri_nav_msgs::Trajectory& msg, const uint i) const;
00172 };
00173 
00174 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


iri_trajectory_to_markers
Author(s): joan vallvé
autogenerated on Wed Oct 9 2013 11:47:41