gazebo_geotagged_images_plugin.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2016 Open Source Robotics Foundation
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  *
00016 */
00017 #pragma once
00018 
00019 #include <string>
00020 
00021 #include <gazebo/common/Plugin.hh>
00022 #include <gazebo/sensors/CameraSensor.hh>
00023 #include <gazebo/gazebo.hh>
00024 #include <gazebo/common/common.hh>
00025 #include <gazebo/rendering/Camera.hh>
00026 //#include <gazebo/util/system.hh>
00027 #include <gazebo/transport/transport.hh>
00028 #include <gazebo/msgs/msgs.hh>
00029 #include <gazebo/physics/physics.hh>
00030 #include <gazebo/rendering/rendering.hh>
00031 
00032 namespace gazebo {
00033 
00035 class GAZEBO_VISIBLE GeotaggedImagesPlugin : public SensorPlugin {
00036   public: GeotaggedImagesPlugin();
00037 
00038   public: virtual ~GeotaggedImagesPlugin();
00039 
00040   public: virtual void Load(sensors::SensorPtr sensor, sdf::ElementPtr sdf);
00041 
00042   public: void OnNewFrame(const unsigned char *image);
00043   public: void OnNewGpsPosition(ConstVector3dPtr& v);
00044 
00045   protected: float storeIntervalSec_;
00046   private: int imageCounter_;
00047   common::Time lastImageTime_;
00048 
00049   protected: sensors::CameraSensorPtr parentSensor_;
00050   protected: rendering::CameraPtr camera_;
00051   protected: rendering::ScenePtr scene_;
00052   private: event::ConnectionPtr newFrameConnection_;
00053   private: std::string storageDir_;
00054   private: msgs::Vector3d lastGpsPosition_;
00055 
00056   private: transport::NodePtr node_handle_;
00057   private: std::string namespace_;
00058   private: transport::SubscriberPtr gpsSub_;
00059 
00060   protected: unsigned int width_, height_, depth_;
00061   protected: unsigned int destWidth_, destHeight_; 
00062   protected: std::string format_;
00063 };
00064 
00065 } // namespace gazebo


rotors_gazebo_plugins
Author(s): Fadri Furrer, Michael Burri, Mina Kamel, Janosch Nikolic, Markus Achtelik
autogenerated on Thu Apr 18 2019 02:43:43