ssdk_interface.h
Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (c) 2011, Markus Achtelik, ASL, ETH Zurich, Switzerland
00004 You can contact the author at <markus dot achtelik at mavt dot ethz dot ch>
00005 
00006 All rights reserved.
00007 
00008 Redistribution and use in source and binary forms, with or without
00009 modification, are permitted provided that the following conditions are met:
00010 * Redistributions of source code must retain the above copyright
00011 notice, this list of conditions and the following disclaimer.
00012 * Redistributions in binary form must reproduce the above copyright
00013 notice, this list of conditions and the following disclaimer in the
00014 documentation and/or other materials provided with the distribution.
00015 * Neither the name of ETHZ-ASL nor the
00016 names of its contributors may be used to endorse or promote products
00017 derived from this software without specific prior written permission.
00018 
00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00020 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00021 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00022 DISCLAIMED. IN NO EVENT SHALL ETHZ-ASL BE LIABLE FOR ANY
00023 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00024 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00025 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00026 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00027 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00028 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 
00030 */
00031 
00032 #ifndef SSDK_INTERFACE_H_
00033 #define SSDK_INTERFACE_H_
00034 
00035 #include <ros/ros.h>
00036 #include <tf/transform_datatypes.h>
00037 #include <boost/thread.hpp>
00038 
00039 #if ROS_VERSION_MINIMUM(1, 11, 7)
00040 #include <boost/signals2.hpp> // ros indigo
00041 typedef boost::signals2::connection Connection;
00042 #else
00043 #include <boost/signals.hpp> // ros hydro or older
00044 typedef boost::signals::connection Connection;
00045 #endif
00046 
00047 
00048 #include <tf/transform_listener.h>
00049 
00050 // message includes
00051 #include <asctec_hl_comm/DoubleArrayStamped.h>
00052 #include <geometry_msgs/PoseWithCovarianceStamped.h>
00053 #include <nav_msgs/Odometry.h>
00054 #include <sensor_fusion_comm/ExtState.h>
00055 
00056 #include "comm.h"
00057 
00058 // dynamic reconfigure includes
00059 #include <dynamic_reconfigure/server.h>
00060 #include <asctec_hl_interface/SSDKConfig.h>
00061 
00062 typedef dynamic_reconfigure::Server<asctec_hl_interface::SSDKConfig> SSDKConfigServer;
00063 
00065 
00072 class SSDKInterface
00073 {
00074 private:
00075 
00076   ros::NodeHandle nh_;
00077   ros::NodeHandle pnh_;
00078   CommPtr & comm_;
00079 
00080   ros::Publisher debug_pub_;
00081   ros::Publisher pose_pub_;
00082   ros::Subscriber pose_sub_;
00083   ros::Subscriber state_sub_;
00084   ros::Subscriber odometry_sub_;
00085 
00086   std::string frame_id_;
00087 
00088   SSDKConfigServer *config_server_;
00089   asctec_hl_interface::SSDKConfig config_;
00090   bool have_config_;
00091 
00092   tf::TransformListener tf_listener_;
00093   Connection tf_callback_;
00094 
00096   void tfCallback();
00097 
00099   void cbPose(const geometry_msgs::PoseWithCovarianceStampedConstPtr &msg);
00100 
00102   void cbState(const sensor_fusion_comm::ExtStatePtr & msg);
00103 
00105 
00107   void cbOdometry(const nav_msgs::OdometryConstPtr& msg);
00108 
00109   void sendPoseToAP(const double & x, const double & y, const double & z, const double & yaw,
00110                     const unsigned char & qual);
00111 
00113   bool sendParameters(const asctec_hl_interface::SSDKConfig & config);
00114   void processDebugData(uint8_t * buf, uint32_t length);
00115   void processStatusData(uint8_t * buf, uint32_t length);
00116   void cbSSDKConfig(asctec_hl_interface::SSDKConfig & config, uint32_t level);
00117 
00118 public:
00119   SSDKInterface(ros::NodeHandle & nh, CommPtr & comm);
00120   ~SSDKInterface();
00121 };
00122 
00123 #endif /* SSDK_INTERFACE_H_ */


asctec_hl_interface
Author(s): Markus Achtelik, Michael Achtelik, Stephan Weiss, Laurent Kneip
autogenerated on Sun Oct 5 2014 22:21:01