scans_2_odom_alg_node.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 _scans_2_odom_alg_node_h_
00026 #define _scans_2_odom_alg_node_h_
00027 
00028 #include <Eigen/Dense>
00029 #include <iri_base_algorithm/iri_base_algorithm.h>
00030 #include "scans_2_odom_alg.h"
00031 #include <tf/transform_datatypes.h>
00032 
00033 // [publisher subscriber headers]
00034 #include <sensor_msgs/LaserScan.h>
00035 #include <geometry_msgs/PoseWithCovarianceStamped.h>
00036 
00037 // [service client headers]
00038 #include <iri_poseslam/GetLink.h>
00039 #include <iri_laser_icp/GetRelativePose.h>
00040 
00041 // [action server client headers]
00042 
00043 using namespace Eigen;
00044 
00049 class Scans2OdomAlgNode : public algorithm_base::IriBaseAlgorithm<Scans2OdomAlgorithm>
00050 {
00051   private:
00052     // [publisher attributes]
00053     
00054     // [subscriber attributes]
00055     ros::Subscriber scan_subscriber_;
00056     void scan_callback(const sensor_msgs::LaserScan::ConstPtr& msg);
00057     
00058     // [service attributes]
00059     ros::ServiceServer get_link_server_;
00060     bool get_linkCallback(iri_poseslam::GetLink::Request &req, iri_poseslam::GetLink::Response &res);
00061 
00062     // [client attributes]
00063     ros::ServiceClient get_relative_pose_client_;
00064     iri_laser_icp::GetRelativePose get_relative_pose_srv_;
00065 
00066     // [action server attributes]
00067 
00068     // [action client attributes]
00069     
00070     // Buffers
00071     std::vector<sensor_msgs::LaserScan> laser_scan_buffer_;
00072     std::vector<sensor_msgs::LaserScan> discarded_laser_scan_buffer_;
00073 
00074     bool online_mode;
00075     double bad_cov_thres, ICP_covariance_correction_factor;
00076     Vector3d d_base_2_laser;
00077     
00078   public:
00085     Scans2OdomAlgNode(void);
00086 
00093     ~Scans2OdomAlgNode(void);
00094 
00095   protected:
00108     void mainNodeThread(void);
00109 
00122     void node_config_update(Config &config, uint32_t level);
00123 
00130     void addNodeDiagnostics(void);
00131 
00141     Matrix3d rotation_matrix(const double &alpha) const;
00142     
00150     Matrix3d covariance_2_matrix(const geometry_msgs::PoseWithCovariance &pose) const;
00151     
00159     Vector3d pose_2_vector(const geometry_msgs::Pose &pose) const;
00160     
00170     geometry_msgs::PoseWithCovariance eigen_2_posewithcovariance(const Vector3d &p, const Matrix3d &cov) const;
00171 
00179     void change_2_base_footprint_frame(Vector3d &odom_ICP, Matrix3d &odom_ICP_cov);
00180     
00181     // [diagnostic functions]
00182     
00183     // [test functions]
00184 };
00185 
00186 #endif


iri_poseslam
Author(s): Joan Vallvé
autogenerated on Fri Dec 6 2013 21:21:14