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 
gazebo::GazeboRosTriggeredCamera::OnNewFrame
virtual void OnNewFrame(const unsigned char *_image, unsigned int _width, unsigned int _height, unsigned int _depth, const std::string &_format)
Update the controller.
Definition: gazebo_ros_triggered_camera.cpp:92
gazebo::GazeboRosTriggeredCamera::GazeboRosTriggeredCamera
GazeboRosTriggeredCamera()
Constructor.
Definition: gazebo_ros_triggered_camera.cpp:39
gazebo::GazeboRosTriggeredMultiCamera
Definition: gazebo_ros_triggered_multicamera.h:30
gazebo
gazebo::GazeboRosTriggeredCamera::Load
void Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf)
Load the plugin.
Definition: gazebo_ros_triggered_camera.cpp:50
gazebo::GazeboRosTriggeredCamera::CanTriggerCamera
virtual bool CanTriggerCamera()
Definition: gazebo_ros_triggered_camera.cpp:135
gazebo::GazeboRosCameraUtils
Definition: gazebo_ros_camera_utils.h:56
gazebo_ros_camera_utils.h
gazebo::GazeboRosTriggeredCamera::mutex
std::mutex mutex
Definition: gazebo_ros_triggered_camera.h:71
gazebo::GazeboRosTriggeredCamera::PreRender
void PreRender()
Definition: gazebo_ros_triggered_camera.cpp:140
gazebo::GazeboRosTriggeredCamera::triggered
int triggered
Definition: gazebo_ros_triggered_camera.h:69
gazebo::GazeboRosTriggeredCamera
Definition: gazebo_ros_triggered_camera.h:32
gazebo::GazeboRosTriggeredCamera::~GazeboRosTriggeredCamera
~GazeboRosTriggeredCamera()
Destructor.
Definition: gazebo_ros_triggered_camera.cpp:45
gazebo::GazeboRosTriggeredCamera::SetCameraEnabled
void SetCameraEnabled(const bool _enabled)
Definition: gazebo_ros_triggered_camera.cpp:149
gazebo::GazeboRosTriggeredCamera::preRenderConnection_
event::ConnectionPtr preRenderConnection_
Definition: gazebo_ros_triggered_camera.h:63
gazebo::GazeboRosTriggeredCamera::TriggerCamera
virtual void TriggerCamera()
Definition: gazebo_ros_triggered_camera.cpp:127


gazebo_plugins
Author(s): John Hsu
autogenerated on Thu Sep 5 2024 02:49:55