23 #include <gazebo/sensors/Sensor.hh> 24 #include <gazebo/sensors/CameraSensor.hh> 25 #include <gazebo/sensors/SensorTypes.hh> 31 GZ_REGISTER_SENSOR_PLUGIN(GazeboRosTriggeredCamera)
51 ROS_FATAL_STREAM(
"A ROS node for Gazebo has not been initialized, unable to load plugin. " 52 <<
"Load the Gazebo system plugin 'libgazebo_ros_api_plugin.so' in the gazebo_ros package)");
56 CameraPlugin::Load(_parent, _sdf);
59 this->
width_ = this->width;
61 this->
depth_ = this->depth;
69 event::Events::ConnectPreRender(
75 const std::string &_camera_name_suffix,
76 double _hack_baseline)
82 event::Events::ConnectPreRender(
89 unsigned int _width,
unsigned int _height,
unsigned int _depth,
90 const std::string &_format)
101 std::lock_guard<std::mutex> lock(this->
mutex);
107 std::lock_guard<std::mutex> lock(this->
mutex);
120 std::lock_guard<std::mutex> lock(this->
mutex);
130 this->
parentSensor_->SetUpdateRate(_enabled ? 0.0 : DBL_MIN);
#define ROS_DEBUG_STREAM_NAMED(name, args)
common::Time sensor_update_time_
ROSCPP_DECL bool isInitialized()
~GazeboRosTriggeredCamera()
Destructor.
void Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf, const std::string &_camera_name_suffix="")
Load the plugin.
boost::shared_ptr< int > image_connect_count_
Keep track of number of image connections.
virtual void TriggerCamera()
void SetCameraEnabled(const bool _enabled)
#define ROS_FATAL_STREAM(args)
event::ConnectionPtr preRenderConnection_
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.
void PutCameraData(const unsigned char *_src)
Put camera data to the ROS topic.
rendering::CameraPtr camera_
sensors::SensorPtr parentSensor_
virtual bool CanTriggerCamera()