gazebo_geotagged_images_plugin.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #pragma once
18 
19 #include <string>
20 
21 #include <gazebo/common/Plugin.hh>
22 #include <gazebo/sensors/CameraSensor.hh>
23 #include <gazebo/gazebo.hh>
24 #include <gazebo/common/common.hh>
25 #include <gazebo/rendering/Camera.hh>
26 //#include <gazebo/util/system.hh>
27 #include <gazebo/transport/transport.hh>
28 #include <gazebo/msgs/msgs.hh>
29 #include <gazebo/physics/physics.hh>
30 #include <gazebo/rendering/rendering.hh>
31 
32 namespace gazebo {
33 
35 class GAZEBO_VISIBLE GeotaggedImagesPlugin : public SensorPlugin {
36  public: GeotaggedImagesPlugin();
37 
38  public: virtual ~GeotaggedImagesPlugin();
39 
40  public: virtual void Load(sensors::SensorPtr sensor, sdf::ElementPtr sdf);
41 
42  public: void OnNewFrame(const unsigned char *image);
43  public: void OnNewGpsPosition(ConstVector3dPtr& v);
44 
45  protected: float storeIntervalSec_;
46  private: int imageCounter_;
47  common::Time lastImageTime_;
48 
49  protected: sensors::CameraSensorPtr parentSensor_;
50  protected: rendering::CameraPtr camera_;
51  protected: rendering::ScenePtr scene_;
52  private: event::ConnectionPtr newFrameConnection_;
53  private: std::string storageDir_;
54  private: msgs::Vector3d lastGpsPosition_;
55 
56  private: transport::NodePtr node_handle_;
57  private: std::string namespace_;
58  private: transport::SubscriberPtr gpsSub_;
59 
60  protected: unsigned int width_, height_, depth_;
61  protected: unsigned int destWidth_, destHeight_;
62  protected: std::string format_;
63 };
64 
65 } // namespace gazebo
Gazebo plugin that saves geotagged camera images to disk.


rotors_gazebo_plugins
Author(s): Fadri Furrer, Michael Burri, Mina Kamel, Janosch Nikolic, Markus Achtelik
autogenerated on Mon Feb 28 2022 23:39:03