Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef _STEREO_NODE_H_
00036 #define _STEREO_NODE_H_
00037
00038
00039 #include <ueye/CameraNode.h>
00040 #include <ueye/stereoConfig.h>
00041
00042
00043 #include <boost/thread/mutex.hpp>
00044 #include <boost/thread/lock_guard.hpp>
00045
00046 namespace ueye
00047 {
00048
00049 class StereoNode
00050 {
00051 public:
00052 StereoNode(ros::NodeHandle node, ros::NodeHandle private_nh);
00053 ~StereoNode();
00054
00055 private:
00056
00057 void reconfig(stereoConfig &config, uint32_t level);
00058 void reconfigCam(stereoConfig &config, uint32_t level, Camera &cam);
00059 void timerCallback(const ros::TimerEvent& event);
00060 void timerForceTrigger(const ros::TimerEvent& event);
00061 bool setCameraInfoL(sensor_msgs::SetCameraInfo::Request& req, sensor_msgs::SetCameraInfo::Response& rsp);
00062 bool setCameraInfoR(sensor_msgs::SetCameraInfo::Request& req, sensor_msgs::SetCameraInfo::Response& rsp);
00063 bool setCameraInfo(sensor_msgs::SetCameraInfo::Request& req, sensor_msgs::SetCameraInfo::Response& rsp, Camera& cam,
00064 sensor_msgs::CameraInfo &msg_info);
00065
00066 void loadIntrinsics(Camera &cam, sensor_msgs::CameraInfo &msg_info);
00067 sensor_msgs::ImagePtr processFrame(const char *frame, size_t size, const Camera &cam,
00068 sensor_msgs::CameraInfoPtr &info, sensor_msgs::CameraInfo &msg_info);
00069 void publishImageL(const char *frame, size_t size);
00070 void publishImageR(const char *frame, size_t size);
00071 void startCamera();
00072 void stopCamera();
00073 void closeCamera();
00074 void handlePath(std::string &path);
00075
00076 dynamic_reconfigure::Server<stereoConfig> srv_;
00077 ros::Timer timer_;
00078 ros::Timer timer_force_trigger_;
00079 sensor_msgs::CameraInfo l_msg_camera_info_, r_msg_camera_info_;
00080
00081 ueye::Camera l_cam_, r_cam_;
00082 bool running_;
00083 bool configured_;
00084 bool force_streaming_;
00085 std::string config_path_;
00086 int trigger_mode_;
00087 bool auto_exposure_;
00088 bool auto_gain_;
00089 int zoom_;
00090 ros::Time l_stamp_, r_stamp_;
00091
00092
00093 image_transport::ImageTransport it_;
00094 image_transport::CameraPublisher l_pub_stream_, r_pub_stream_;
00095 ros::ServiceServer l_srv_cam_info_, r_srv_cam_info_;
00096
00097
00098 boost::mutex mutex_;
00099 };
00100
00101 }
00102
00103 #endif // _STEREO_NODE_H_