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 _tibi_dabo_pitch_estimator_sin_laser_vertical_alg_node_h_ 00026 #define _tibi_dabo_pitch_estimator_sin_laser_vertical_alg_node_h_ 00027 00028 #include <iri_base_algorithm/iri_base_algorithm.h> 00029 #include "tibi_dabo_pitch_estimator_sin_laser_vertical_alg.h" 00030 00031 // [publisher subscriber headers] 00032 #include <visualization_msgs/MarkerArray.h> 00033 #include <sensor_msgs/LaserScan.h> 00034 #include <iri_segway_rmp_msgs/SegwayRMP200Status.h> 00035 #include <string> 00036 #define PI 3.14159265358 00037 // [service client headers] 00038 00039 // [action server client headers] 00040 00045 class TibiDaboPitchEstimatorSinLaserVerticalAlgNode : public algorithm_base::IriBaseAlgorithm<TibiDaboPitchEstimatorSinLaserVerticalAlgorithm> 00046 { 00047 private: 00048 // [publisher attributes] 00049 ros::Publisher MarkerArray_lines_publisher_; 00050 visualization_msgs::MarkerArray MarkerArray_msg_; 00051 ros::Publisher front_laser_filtrado_publisher_; 00052 sensor_msgs::LaserScan LaserScan_front_msg_; 00053 ros::Publisher rear_laser_filtrado_publisher_; 00054 sensor_msgs::LaserScan LaserScan_rear_msg_; 00055 00056 // [subscriber attributes] 00057 ros::Subscriber front_laser_subscriber_; 00058 void front_laser_callback(const sensor_msgs::LaserScan::ConstPtr& msg); 00059 CMutex front_laser_mutex_; 00060 00061 ros::Subscriber rear_laser_subscriber_; 00062 void rear_laser_callback(const sensor_msgs::LaserScan::ConstPtr& msg); 00063 CMutex rear_laser_mutex_; 00064 00065 ros::Subscriber pitch_subscriber_; 00066 void pitch_callback(const iri_segway_rmp_msgs::SegwayRMP200Status::ConstPtr& msg); 00067 CMutex pitch_mutex_; 00068 00069 // [service attributes] 00070 00071 // [client attributes] 00072 00073 // [action server attributes] 00074 00075 // [action client attributes] 00076 00077 00078 //node functions. 00079 00080 void function_markers(double pitch); 00081 void marker_point_front_laser_node(double front_laser_point_x, double front_laser_point_y); 00082 00083 //variables and functions to fill the visualization messages 00084 00085 visualization_msgs::Marker pitch_arrow_marker_; 00086 visualization_msgs::Marker floor_line_marker_; 00087 visualization_msgs::Marker distance_front_laser_marker6_; 00088 visualization_msgs::Marker arrow_intersection_; 00089 //my stuff 00090 00091 double a1_,b1_,pitch; 00092 double front_laser_point_x,front_laser_point_y, rear_laser_point_x,rear_laser_point_y; 00093 double front_security_distance_,rear_security_distance_; 00094 00095 public: 00102 TibiDaboPitchEstimatorSinLaserVerticalAlgNode(void); 00103 00110 ~TibiDaboPitchEstimatorSinLaserVerticalAlgNode(void); 00111 00112 00113 00114 00115 00116 00117 protected: 00130 void mainNodeThread(void); 00131 00144 void node_config_update(Config &config, uint32_t level); 00145 00152 void addNodeDiagnostics(void); 00153 00154 // [diagnostic functions] 00155 00156 // [test functions] 00157 }; 00158 00159 #endif