41 #include <dynamic_reconfigure/server.h> 43 #include <optris_drivers/ThresholdConfig.h> 45 #include "libirimager/ImageBuilder.h" 59 static unsigned int frame = 0;
61 unsigned short* data = (
unsigned short*)&image->data[0];
63 sensor_msgs::Image img;
64 img.header.frame_id =
"thermal_image_view";
65 img.height = image->height;
66 img.width = image->width;
67 img.encoding =
"mono8";
68 img.step = image->width;
69 img.data.resize(img.height*img.step);
70 img.header.seq = ++frame;
74 for(
unsigned int i=0; i<image->width*image->height; i++)
76 const double temp = (float(data[i]) -1000.0f)/10.0
f;
80 else img.data[i] = 0x00;
84 else img.data[i] = 0xff;
98 void callback(optris_drivers::ThresholdConfig &config, uint32_t level)
114 int main (
int argc,
char* argv[])
116 ros::init (argc, argv,
"optris_binary_image_node");
119 dynamic_reconfigure::Server<optris_drivers::ThresholdConfig> server;
120 dynamic_reconfigure::Server<optris_drivers::ThresholdConfig>::CallbackType
f;
123 server.setCallback(f);
Subscriber subscribe(const std::string &base_topic, uint32_t queue_size, const boost::function< void(const sensor_msgs::ImageConstPtr &)> &callback, const ros::VoidPtr &tracked_object=ros::VoidPtr(), const TransportHints &transport_hints=TransportHints())
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
Publisher advertise(const std::string &base_topic, uint32_t queue_size, bool latch=false)
void onThermalDataReceive(const sensor_msgs::ImageConstPtr &image)
void callback(optris_drivers::ThresholdConfig &config, uint32_t level)
image_transport::Publisher * _pubThermal
void publish(const sensor_msgs::Image &message) const
bool getParam(const std::string &key, std::string &s) const
int main(int argc, char *argv[])
ROSCPP_DECL void spinOnce()