41 #include "sensor_msgs/Image.h" 42 #include "calibration_msgs/DenseLaserSnapshot.h" 58 intensity_pub_ = n_.advertise<sensor_msgs::Image> (
"dense_laser_intensity", 1) ;
59 range_pub_ = n_.advertise<sensor_msgs::Image> (
"dense_laser_intensity", 1) ;
65 sensor_msgs::Image image ;
66 const unsigned int N = msg->num_scans * msg->readings_per_scan ;
69 image.header.stamp = msg->header.stamp ;
70 image.encoding =
"mono8" ;
71 image.height = msg->num_scans;
72 image.width = msg->readings_per_scan;
73 image.step = msg->readings_per_scan;
75 image.data.resize(msg->num_scans*msg->readings_per_scan) ;
77 for(
unsigned int i=0; i<N; i++)
79 image.data[i] = (
unsigned int) ((fmin(3000, fmax(2000, msg->intensities[i])) - 2000) / 1000.0 * 255) ;
81 intensity_pub_.publish(image) ;
92 int main(
int argc,
char** argv)
void snapshotCallback(const calibration_msgs::DenseLaserSnapshotConstPtr &msg)
int main(int argc, char **argv)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)