17 #ifndef GZ_SENSORS_CAMERASENSOR_HH_
18 #define GZ_SENSORS_CAMERASENSOR_HH_
24 #include <gz/msgs/boolean.pb.h>
25 #include <gz/msgs/image.pb.h>
29 #include <gz/utils/SuppressWarning.hh>
35 #pragma warning(disable: 4251)
37 #include <gz/rendering/Camera.hh>
42 #include "gz/sensors/camera/Export.hh"
43 #include "gz/sensors/config.hh"
44 #include "gz/sensors/Export.hh"
52 inline namespace GZ_SENSORS_VERSION_NAMESPACE {
55 class CameraSensorPrivate;
75 public:
virtual bool Load(
const sdf::Sensor &_sdf)
override;
80 public:
virtual bool Load(sdf::ElementPtr _sdf)
override;
84 public:
virtual bool Init()
override;
91 public:
virtual bool Update(
92 const std::chrono::steady_clock::duration &_now)
override;
102 public: gz::common::ConnectionPtr ConnectImageCallback(
104 void(
const gz::msgs::Image &)> _callback);
108 public:
virtual void SetScene(
109 gz::rendering::ScenePtr _scene)
override;
113 public:
virtual unsigned int ImageWidth()
const;
117 public:
virtual unsigned int ImageHeight()
const;
121 public:
virtual rendering::CameraPtr RenderingCamera()
const;
130 public:
void SetBaseline(
double _baseline);
134 public:
double Baseline()
const;
137 public:
virtual bool HasConnections()
const override;
142 public:
bool HasImageConnections()
const;
147 public:
bool HasInfoConnections()
const;
155 protected:
bool AdvertiseInfo();
162 protected:
bool AdvertiseInfo(
const std::string &_topic);
167 protected:
void PopulateInfo(
const sdf::Camera *_cameraSdf);
171 protected:
void PublishInfo(
172 const std::chrono::steady_clock::duration &_now);
176 private:
bool CreateCamera();
181 private:
void OnSceneChange(gz::rendering::ScenePtr );
185 private:
void OnTrigger(
const gz::msgs::Boolean &);
187 GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
191 GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING