-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chao Qu
committed
Sep 4, 2014
1 parent
5597dce
commit 7f47011
Showing
17 changed files
with
284 additions
and
420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,24 @@ | ||
#ifndef FLIR_GIGE_NODE_H_ | ||
#define FLIR_GIGE_NODE_H_ | ||
|
||
#include "flir_gige/flir_gige_ros.h" | ||
#include "flir_gige/FlirGigeDynConfig.h" | ||
#include "camera_base/camera_node_base.h" | ||
|
||
namespace flir_gige { | ||
} | ||
#endif // FLIR_GIGE_NODE_H_ | ||
|
||
class FlirGigeNode : public CameraNodeBase<FlirGigeDynConfig> { | ||
public: | ||
FlirGigeNode(const ros::NodeHandle &nh) | ||
: CameraNodeBase{nh}, flir_gige_ros_{nh} {} | ||
|
||
virtual void Acquire() override; | ||
virtual void Setup(FlirGigeDynConfig &config) override; | ||
|
||
private: | ||
FlirGigeRos flir_gige_ros_; | ||
}; | ||
|
||
} // namespace flir_gige | ||
|
||
#endif // FLIR_GIGE_NODE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,22 @@ | ||
#ifndef FLIR_GIGE_FLIR_GIGE_H_ | ||
#define FLIR_GIGE_FLIR_GIGE_H_ | ||
#ifndef FLIR_GIGE_ROS_H_ | ||
#define FLIR_GIGE_ROS_H_ | ||
|
||
#include <utility> | ||
|
||
#include <ros/ros.h> | ||
#include <sensor_msgs/Image.h> | ||
#include <sensor_msgs/CameraInfo.h> | ||
#include <dynamic_reconfigure/server.h> | ||
#include <image_transport/image_transport.h> | ||
#include <camera_info_manager/camera_info_manager.h> | ||
#include <cv_bridge/cv_bridge.h> | ||
#include <diagnostic_updater/diagnostic_updater.h> | ||
#include <diagnostic_updater/publisher.h> | ||
|
||
#include <opencv2/core/core.hpp> | ||
#include <boost/thread.hpp> | ||
#include <boost/shared_ptr.hpp> | ||
|
||
#include "flir_gige/planck.h" | ||
#include "flir_gige/gige_camera.h" | ||
#include "flir_gige/FlirDynConfig.h" | ||
#include "flir_gige/flir_gige.h" | ||
#include "camera_base/camera_ros_base.h" | ||
|
||
namespace flir_gige { | ||
|
||
class FlirGige { | ||
class FlirGigeRos : public CameraRosBase { | ||
public: | ||
using camera_info_manager::CameraInfoManager; | ||
using CameraInfoManagerPtr = boost::shared_ptr<CameraInfoManager>; | ||
using FlirDynConfig = ::flir_gige::FlirDynConfig; | ||
|
||
/** | ||
* @brief FlirGige Constructor | ||
* @param nh Private node handle | ||
*/ | ||
FlirGige(const ros::NodeHandle &nh); | ||
|
||
/** | ||
* @brief Run Run camera | ||
*/ | ||
void Run(); | ||
FlirGigeRos(const ros::NodeHandle& nh) | ||
: CameraRosBase{nh}, flir_gige_{identifier()} {} | ||
|
||
/** | ||
* @brief End End camera | ||
*/ | ||
void End(); | ||
virtual bool Grab(const sensor_msgs::ImagePtr* image_msg) override; | ||
|
||
private: | ||
void ReadConfig(); | ||
void PublishImage(const cv::Mat &image, const Planck &planck); | ||
void PublishTemperature(const std::pair<double, double> &spot); | ||
std::string GetImageEncoding(const cv::Mat &image) const; | ||
void ConfigCb(FlirDynConfig &config, int level); | ||
|
||
ros::NodeHandle nh_; ///< Private node handle | ||
std::string frame_id_; ///< Frame id | ||
std::string camera_name_; ///< Camera name | ||
boost::shared_ptr<ros::Rate> rate_; ///< Acquisition rate | ||
|
||
image_transport::ImageTransport it_; ///< Image transport | ||
image_transport::CameraPublisher pub_camera_; ///< Camera publisher | ||
CameraInfoManagerPtr cinfo_manager_; ///< Camera info manager | ||
ros::Publisher pub_temperature_; ///< Temperature publisher | ||
|
||
FlirDynConfig config_; ///< Reconfigure parameters | ||
dynamic_reconfigure::Server<FlirDynConfig> server_; ///< Reconfigure server | ||
|
||
diagnostic_updater::Updater updater_; ///< Diagnostic updater | ||
diagnostic_updater::TopicDiagnostic diagnostics_; ///< topic diagnostics | ||
|
||
boost::shared_ptr<GigeCamera> gige_camera_; ///< GigE camera | ||
boost::shared_ptr<boost::thread> image_thread_; ///< Image acquisition thread | ||
FlirGige flir_gige_; | ||
}; | ||
|
||
} // namespace flir_gige | ||
|
||
#endif // FLIR_GIGE_FLIR_GIGE_H_ | ||
#endif // FLIR_GIGE_ROS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<?xml version="1.0"?> | ||
<package> | ||
<name>flir_gige</name> | ||
<version>0.0.0</version> | ||
<version>0.0.1</version> | ||
<description>The flir_gige package</description> | ||
|
||
<maintainer email="[email protected]">chao</maintainer> | ||
<maintainer email="[email protected]">Chao Qu</maintainer> | ||
|
||
<license>BSD</license> | ||
|
||
|
@@ -13,20 +13,12 @@ | |
<build_depend>roscpp</build_depend> | ||
<build_depend>nodelet</build_depend> | ||
<build_depend>cv_bridge</build_depend> | ||
<build_depend>sensor_msgs</build_depend> | ||
<build_depend>image_transport</build_depend> | ||
<build_depend>camera_info_manager</build_depend> | ||
<build_depend>dynamic_reconfigure</build_depend> | ||
<build_depend>diagnostic_updater</build_depend> | ||
<build_depend>camera_base</build_depend> | ||
|
||
<run_depend>roscpp</run_depend> | ||
<run_depend>nodelet</run_depend> | ||
<run_depend>cv_bridge</run_depend> | ||
<run_depend>sensor_msgs</run_depend> | ||
<run_depend>image_transport</run_depend> | ||
<run_depend>camera_info_manager</run_depend> | ||
<run_depend>dynamic_reconfigure</run_depend> | ||
<run_depend>diagnostic_updater</run_depend> | ||
<run_depend>camera_base</run_depend> | ||
|
||
<export> | ||
<nodelet plugin="${prefix}/nodelet_plugins.xml" /> | ||
|
Oops, something went wrong.