force_navigation_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 _force_navigation_alg_node_h_
00026 #define _force_navigation_alg_node_h_
00027 
00028 #include <iri_base_algorithm/iri_base_algorithm.h>
00029 #include "force_navigation_alg.h"
00030 #include "force_navigation.h" //people prediction library
00031 #include <tf/transform_listener.h>
00032 #include <geometry_msgs/PointStamped.h>
00033 
00034 // [publisher subscriber headers]
00035 #include <std_msgs/Float64MultiArray.h>
00036 #include <geometry_msgs/PoseStamped.h>
00037 #include <iri_perception_msgs/peopleTrackingArray.h>
00038 #include <visualization_msgs/MarkerArray.h>
00039 
00040 // [service client headers]
00041 
00042 // [action server client headers]
00043 #include <actionlib/client/simple_action_client.h>
00044 #include <actionlib/client/terminal_state.h>
00045 #include <move_base_msgs/MoveBaseAction.h>
00046 
00051 class ForceNavigationAlgNode : public algorithm_base::IriBaseAlgorithm<ForceNavigationAlgorithm>
00052 {
00053   private:
00054     // [publisher attributes]
00055     ros::Publisher navigation_work_publisher_;
00056     std_msgs::Float64MultiArray Float64_msg_;
00057     ros::Publisher robot_simulated_pose_publisher_;
00058     geometry_msgs::PoseStamped PoseStamped_msg_;
00059     ros::Publisher trajectories_publisher_;
00060     visualization_msgs::MarkerArray MarkerArray_trajectories_msg_;
00061     ros::Publisher forces_publisher_;
00062     visualization_msgs::MarkerArray MarkerArray_forces_msg_;
00063         ros::Publisher destinations_publisher_;
00064     visualization_msgs::MarkerArray MarkerArray_destinations_msg_;
00065         visualization_msgs::Marker traj_marker_, traj_robot_marker_, robot_marker_;
00066         visualization_msgs::Marker target_marker_;
00067         visualization_msgs::Marker dest_marker_;
00068         visualization_msgs::Marker text_marker_;
00069         visualization_msgs::Marker force_marker_, force_goal_marker_, force_goal2_marker_, force_int_person_marker_,
00070                         force_int_robot_marker_, force_obstacle_map_marker_, force_obstacle_laser_marker_;
00071     ros::Publisher velocity_publisher_;
00072     geometry_msgs::Twist Twist_msg_;
00073 
00074     // [subscriber attributes]
00075     ros::Subscriber tracks_subscriber_;
00076     void tracks_callback(const iri_perception_msgs::peopleTrackingArray::ConstPtr& msg);
00077     CMutex tracks_mutex_;
00078 
00079     // [service attributes]
00080 
00081     // [client attributes]
00082 
00083     // [action server attributes]
00084 
00085     // [action client attributes]
00086     actionlib::SimpleActionClient<move_base_msgs::MoveBaseAction> move_robot_client_;
00087     move_base_msgs::MoveBaseGoal move_robot_goal_;
00088     void move_robotMakeActionRequest();
00089     void move_robotDone(const actionlib::SimpleClientGoalState& state,  const move_base_msgs::MoveBaseResultConstPtr& result);
00090     void move_robotActive();
00091     void move_robotFeedback(const move_base_msgs::MoveBaseFeedbackConstPtr& feedback);
00092 
00093 
00094         // class atributes
00095         Cforce_navigation force_navigation_;
00096         void init_node();
00097         void vis_trajectories();
00098         void clear_force_markers();
00099         void vis_destinations();
00100         std::string target_frame_, robot_frame_;
00101         bool move_base_mode_, robot_sim_, robot_stop_;
00102         tf::TransformListener tf_listener_,tf_main_;
00103         double robot_x_ini_,robot_y_ini_;
00104     Spose robot_desired_position_;
00105         string force_map_path_,destination_map_path_;
00106 
00107   public:
00114     ForceNavigationAlgNode(void);
00115 
00122     ~ForceNavigationAlgNode(void);
00123 
00124   protected:
00137     void mainNodeThread(void);
00138 
00151     void node_config_update(Config &config, uint32_t level);
00152 
00159     void addNodeDiagnostics(void);
00160 
00161     // [diagnostic functions]
00162     
00163     // [test functions]
00164 };
00165 
00166 #endif


iri_force_navigation
Author(s): gferrer
autogenerated on Fri Dec 6 2013 21:53:16