18 #ifndef GAZEBO_ROS_CAMERA_UTILS_HH 19 #define GAZEBO_ROS_CAMERA_UTILS_HH 23 #include <boost/thread.hpp> 24 #include <boost/thread/mutex.hpp> 32 #include <sensor_msgs/PointCloud.h> 33 #include <sensor_msgs/Image.h> 34 #include <sensor_msgs/CameraInfo.h> 35 #include <std_msgs/Empty.h> 36 #include <std_msgs/Float64.h> 41 #include <gazebo_plugins/GazeboRosCameraConfig.h> 42 #include <dynamic_reconfigure/server.h> 45 #include <gazebo/physics/physics.hh> 46 #include <gazebo/transport/TransportTypes.hh> 47 #include <gazebo/msgs/MessageTypes.hh> 48 #include <gazebo/common/Time.hh> 49 #include <gazebo/sensors/SensorTypes.hh> 50 #include <gazebo/plugins/CameraPlugin.hh> 55 class GazeboRosMultiCamera;
56 class GazeboRosTriggeredMultiCamera;
70 public:
void Load(sensors::SensorPtr _parent,
72 const std::string &_camera_name_suffix =
"");
79 public:
void Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf,
80 const std::string &_camera_name_suffix,
81 double _hack_baseline);
83 public: event::ConnectionPtr
OnLoad(
const boost::function<
void()>&);
90 common::Time &last_update_time);
105 private:
void SetHFOV(
const std_msgs::Float64::ConstPtr& hfov);
106 private:
void SetUpdateRate(
const std_msgs::Float64::ConstPtr& update_rate);
180 dynamic_reconfigure::Server<gazebo_plugins::GazeboRosCameraConfig>
182 void configCallback(gazebo_plugins::GazeboRosCameraConfig &config,
208 private: sdf::ElementPtr
sdf;
virtual bool CanTriggerCamera()
ros::Subscriber trigger_subscriber_
ros::Subscriber cameraHFOVSubscriber_
std::string image_topic_name_
ROS image topic name.
boost::mutex lock_
A mutex to lock access to fields that are used in ROS message callbacks.
common::Time sensor_update_time_
dynamic_reconfigure::Server< gazebo_plugins::GazeboRosCameraConfig > * dyn_srv_
boost::shared_ptr< camera_info_manager::CameraInfoManager > camera_info_manager_
std::string robot_namespace_
for setting ROS name space
boost::shared_ptr< bool > was_active_
Keep track when we activate this camera through ros subscription, was it already active? resume state when unsubscribed.
image_transport::ImageTransport * itnode_
boost::thread deferred_load_thread_
image_transport::Publisher image_pub_
void Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf, const std::string &_camera_name_suffix="")
Load the plugin.
~GazeboRosCameraUtils()
Destructor.
std::string camera_name_
ROS camera name.
void SetHFOV(const std_msgs::Float64::ConstPtr &hfov)
: Camera modification functions
ros::CallbackQueue camera_queue_
virtual void TriggerCamera()
boost::thread callback_queue_thread_
boost::shared_ptr< int > image_connect_count_
Keep track of number of image connections.
void TriggerCameraInternal(const std_msgs::Empty::ConstPtr &dummy)
sensor_msgs::Image image_msg_
ROS image message.
ros::Subscriber cameraUpdateRateSubscriber_
ros::Publisher camera_info_pub_
camera info
std::string tf_prefix_
tf prefix
event::ConnectionPtr OnLoad(const boost::function< void()> &)
event::ConnectionPtr newFrameConnection_
bool initialized_
True if camera util is initialized.
common::Time last_info_update_time_
double update_rate_
update rate of this sensor
std::string frame_name_
ROS frame transform name to use in the image message header. This should typically match the link nam...
std::string camera_info_topic_name_
void PutCameraData(const unsigned char *_src)
Put camera data to the ROS topic.
rendering::CameraPtr camera_
GazeboRosCameraUtils()
Constructor.
void SetUpdateRate(const std_msgs::Float64::ConstPtr &update_rate)
ros::NodeHandle * rosnode_
A pointer to the ROS node. A node will be instantiated if it does not exist.
common::Time last_update_time_
void InfoConnect()
Keep track of number of connctions for CameraInfo.
std::string trigger_topic_name_
ROS trigger topic name.
event::EventT< void()> load_event_
void configCallback(gazebo_plugins::GazeboRosCameraConfig &config, uint32_t level)
sensors::SensorPtr parentSensor_
std::string type_
size of image buffer
boost::shared_ptr< boost::mutex > image_connect_count_lock_
A mutex to lock access to image_connect_count_.