EKF_RTT.hpp
Go to the documentation of this file.
00001 /*********************************************************************
00002  * EKF_RTT.cpp
00003  *
00004  *  Created on: 
00005  *      Author: Dula Nad
00006  *      
00007  *  Modified by: Filip Mandic
00008  *
00009  ********************************************************************/
00010 /*********************************************************************
00011  * Software License Agreement (BSD License)
00012  *
00013  *  Copyright (c) 2014, LABUST, UNIZG-FER
00014  *  All rights reserved.
00015  *
00016  *  Redistribution and use in source and binary forms, with or without
00017  *  modification, are permitted provided that the following conditions
00018  *  are met:
00019  *
00020  *   * Redistributions of source code must retain the above copyright
00021  *     notice, this list of conditions and the following disclaimer.
00022  *   * Redistributions in binary form must reproduce the above
00023  *     copyright notice, this list of conditions and the following
00024  *     disclaimer in the documentation and/or other materials provided
00025  *     with the distribution.
00026  *   * Neither the name of the LABUST nor the names of its
00027  *     contributors may be used to endorse or promote products derived
00028  *     from this software without specific prior written permission.
00029  *
00030  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00031  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00032  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00033  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00034  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00035  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00036  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00037  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00038  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00039  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00040  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00041  *  POSSIBILITY OF SUCH DAMAGE.
00042  *********************************************************************/
00043 #ifndef EKF_RTT_HPP_
00044 #define EKF_RTT_HPP_
00045 #include <labust/navigation/KFCore.hpp>
00046 #include <labust/navigation/RelativeTrackingModel.hpp>
00047 #include <labust/navigation/SensorHandlers.hpp>
00048 #include <labust/math/NumberManipulation.hpp>
00049 #include <navcon_msgs/ModelParamsUpdate.h>
00050 
00051 #include <tf2_ros/transform_broadcaster.h>
00052 #include <std_msgs/Float32.h>
00053 #include <std_msgs/Bool.h>
00054 #include <auv_msgs/BodyForceReq.h>
00055 
00056 #include <std_msgs/Bool.h>
00057 #include <auv_msgs/NavSts.h>
00058 #include <underwater_msgs/USBLFix.h>
00059 
00060 namespace labust
00061 {
00062         namespace navigation
00063         {
00069                 class Estimator3D
00070                 {
00071                         enum{X=0,Y,Z,K,M,N, DoF};
00072                         typedef labust::navigation::KFCore<labust::navigation::RelativeTrackingModel> KFNav;
00073                 public:
00077                         Estimator3D();
00081                         void onInit();
00085                         void start();
00086 
00087                 private:
00091                         void configureNav(KFNav& nav, ros::NodeHandle& nh);
00095                         void onModelUpdate(const navcon_msgs::ModelParamsUpdate::ConstPtr& update);
00099                         void onStateHat(const auv_msgs::NavSts::ConstPtr& data);
00103                         void onCurrentsHat(const  geometry_msgs::TwistStamped::ConstPtr& data);
00107                         void onTargetTau(const auv_msgs::BodyForceReq::ConstPtr& tau);
00111                         void onTargetDepth(const std_msgs::Float32::ConstPtr& data);
00115                         void onTargetHeading(const std_msgs::Float32::ConstPtr& data);
00119                         void onUSBLfix(const underwater_msgs::USBLFix::ConstPtr& data);
00123                         //void onRange(const std_msgs::Float32::ConstPtr& data);
00127                         //void onBearing(const std_msgs::Float32::ConstPtr& data);
00131                         void processMeasurements();
00135                         void publishState();
00139                         KFNav nav;
00143                         KFNav::vector inputVec;
00147                         KFNav::vector measurements, newMeas;
00151                         labust::math::unwrap unwrap;
00155                         ros::Publisher pubStateMeas, pubStateHat;
00159                         ros::Subscriber subStateHat, subCurrentsHat, subTargetTau, subTargetDepth, subTargetHeading, subUSBLfix, modelUpdate;
00163                         tf2_ros::TransformBroadcaster broadcaster;
00167                         double alt, xc, yc, u, v;
00171                         KFNav::ModelParams params[DoF];
00172                 };
00173         }
00174 }
00175 /* EKF3D_HPP_ */
00176 #endif


labust_navigation
Author(s): Gyula Nagy
autogenerated on Fri Aug 28 2015 11:23:33