gazebo_ros_triggered_camera.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 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 
18 #ifndef GAZEBO_ROS_TRIGGERED_CAMERA_HH
19 #define GAZEBO_ROS_TRIGGERED_CAMERA_HH
20 
21 #include <mutex>
22 #include <string>
23 
24 // library for processing camera data for gazebo / ros conversions
25 #include <gazebo/plugins/CameraPlugin.hh>
26 
28 
29 namespace gazebo
30 {
31  class GazeboRosTriggeredMultiCamera;
32  class GazeboRosTriggeredCamera : public CameraPlugin, GazeboRosCameraUtils
33  {
36  public: GazeboRosTriggeredCamera();
37 
39  public: ~GazeboRosTriggeredCamera();
40 
43  public: void Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf);
44 
50  public: void Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf,
51  const std::string &_camera_name_suffix,
52  double _hack_baseline);
53 
55  protected: virtual void OnNewFrame(const unsigned char *_image,
56  unsigned int _width, unsigned int _height,
57  unsigned int _depth, const std::string &_format);
58 
59  protected: virtual void TriggerCamera();
60 
61  protected: virtual bool CanTriggerCamera();
62 
63  protected: event::ConnectionPtr preRenderConnection_;
64 
65  public: void SetCameraEnabled(const bool _enabled);
66 
67  protected: void PreRender();
68 
69  protected: int triggered = 0;
70 
71  protected: std::mutex mutex;
72 
74  };
75 }
76 #endif
77 
void Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf)
Load the plugin.
virtual void OnNewFrame(const unsigned char *_image, unsigned int _width, unsigned int _height, unsigned int _depth, const std::string &_format)
Update the controller.


gazebo_plugins
Author(s): John Hsu
autogenerated on Tue Apr 6 2021 02:19:39