adi_3dtof_adtf31xx.h
Go to the documentation of this file.
1 /******************************************************************************
2 Copyright (c), 2023 - Analog Devices Inc. All Rights Reserved.
3 This software is PROPRIETARY & CONFIDENTIAL to Analog Devices, Inc.
4 and its licensors.
5 ******************************************************************************/
6 #ifndef ADI_3DTOF_ADTF31XX__H
7 #define ADI_3DTOF_ADTF31XX__H
8 
9 #include "input_sensor.h"
10 #include "input_sensor_factory.h"
11 #include "image_proc_utils.h"
14 #include <ros/ros.h>
15 #include <sensor_msgs/Image.h>
16 #include <sensor_msgs/PointCloud2.h>
17 #include <cv_bridge/cv_bridge.h>
21 #include <compressed_depth_image_transport/rvl_codec.h>
22 #include <queue>
23 #include <dynamic_reconfigure/server.h>
25 #include <adi_3dtof_adtf31xx/ADTF31xxSensorParamsConfig.h>
26 
28 
34 {
35 public:
45  {
48 
49  ros::NodeHandle nh("~");
50 
51  // Get Parameters
52  // ToF camera link
53  std::string camera_link;
54  nh.param<std::string>("param_camera_link", camera_link, "adi_camera_link");
55 
56  // Input sensor Mode:Camera/File/ROSBag
57  int input_sensor_mode;
58  nh.param<int>("param_input_sensor_mode", input_sensor_mode, 0);
59 
60  std::string input_file_name;
61  nh.param<std::string>("param_input_file_name", input_file_name, "no name");
62 
63  int enable_depth_ab_compression;
64  nh.param<int>("param_enable_depth_ab_compression", enable_depth_ab_compression, 0);
65 
66  int ab_threshold;
67  nh.param<int>("param_ab_threshold", ab_threshold, 10);
68 
69  int confidence_threshold;
70  nh.param<int>("param_confidence_threshold", confidence_threshold, 10);
71 
72  // JBLF Filter State
73  int jblf_filter_state;
74  nh.param<int>("param_jblf_filter_state", jblf_filter_state, 1);
75 
76  // JBLF Filter Size
77  int jblf_filter_size;
78  nh.param<int>("param_jblf_filter_size", jblf_filter_size, 7);
79 
80  // Radial Filter Min Threshold
81  int radial_filter_min_threshold;
82  nh.param<int>("param_radial_filter_min_threshold", radial_filter_min_threshold, 100);
83 
84  // Radial Filter Max Threshold
85  int radial_filter_max_threshold;
86  nh.param<int>("param_radial_filter_max_threshold", radial_filter_max_threshold, 10000);
87 
88  std::string config_file_name_of_tof_sdk;
89  nh.param<std::string>("param_config_file_name_of_tof_sdk", config_file_name_of_tof_sdk, "no name");
90 
91  int camera_mode;
92  nh.param<int>("param_camera_mode", camera_mode, 3);
93 
94  std::string input_sensor_ip;
95  nh.param<std::string>("param_input_sensor_ip", input_sensor_ip, "no name");
96 
97  int enable_point_cloud_publish;
98  nh.param<int>("param_enable_point_cloud_publish", enable_point_cloud_publish, 0);
99 
100  std::string encoding_type;
101  nh.param<std::string>("param_encoding_type", encoding_type, "mono16");
102 
103  enable_point_cloud_publish_ = (enable_point_cloud_publish == 1) ? true : false;
104 
105  camera_link_ = std::move(camera_link);
106  input_sensor_mode_ = input_sensor_mode;
107  input_file_name_ = std::move(input_file_name);
108  input_sensor_ip_ = std::move(input_sensor_ip);
109  encoding_type_ = std::move(encoding_type);
110  frame_number_ = 0;
111  enable_depth_ab_compression_ = (enable_depth_ab_compression == 1) ? true : false;
112 
113  ab_threshold_ = ab_threshold;
114  confidence_threshold_ = confidence_threshold;
115  jblf_filter_state_ = (jblf_filter_state == 1) ? true : false;
116  jblf_filter_size_ = jblf_filter_size;
117  radial_filter_min_threshold_ = radial_filter_min_threshold;
118  radial_filter_max_threshold_ = radial_filter_max_threshold;
119 
120  // Get input sensor module
122 
123  // Open the sensor
124  if (input_sensor_mode_ != 3)
125  {
126  // If the mode is not ADTF31xx sensor over Network, then the ip should be set to ""
127  input_sensor_ip_.clear();
128  }
129  input_sensor_->openSensor(input_file_name_, image_width_, image_height_, config_file_name_of_tof_sdk,
131  if (!input_sensor_->isOpened())
132  {
133  ROS_ERROR("Could not open the sensor %s", input_file_name_.c_str());
135  }
136 
137  // Configure the sensor
138  input_sensor_->configureSensor(camera_mode);
139 
141 
143 
145 
146  // Buffer allocations.
149  xyz_frame_ = nullptr;
150 
151  // Get intrinsics and extrinsics
154 
155  // Create publishers.
156  // Input and Intermediate Debug Images
158  {
159  depth_image_publisher_ = this->advertise<sensor_msgs::CompressedImage>("depth_image/compressedDepth", 10);
160  ab_image_publisher_ = this->advertise<sensor_msgs::CompressedImage>("ab_image/compressedDepth", 10);
161  conf_image_publisher_ = this->advertise<sensor_msgs::CompressedImage>("conf_image/compressedDepth", 10);
162  }
163  else
164  {
165  depth_image_publisher_ = this->advertise<sensor_msgs::Image>("depth_image", 10);
166  ab_image_publisher_ = this->advertise<sensor_msgs::Image>("ab_image", 10);
167  conf_image_publisher_ = this->advertise<sensor_msgs::Image>("conf_image", 10);
168  }
169 
171  {
172  xyz_image_publisher_ = this->advertise<sensor_msgs::PointCloud2>("point_cloud", 10);
173  }
174 
175  // Camera Infos
176  depth_info_publisher_ = this->advertise<sensor_msgs::CameraInfo>("camera_info", 10);
177 
179 
181 
183 
185 
186  // Printing the output in console as parameters are overwritten by launch file.
187  ROS_INFO(
188  "Configuration variables: ab_threshold: %d, confidence_threshold: %d, jblf_filter_state: %d, jblf_filter_size: "
189  "%d, radial_filter_min_threshold: %d, radial_filter_max_threshold: %d",
192 
193  // Initially setting dynamic reconfigure values to same as launch file
195  }
196 
201  void shutDownAllNodes()
202  {
203  int status = system("rosnode kill -a");
204  if (status < 0)
205  {
206  ROS_INFO_STREAM("Error in \"rosnode kill -a\": " << status);
207  }
208  ros::shutdown();
209  }
210 
216  {
217  if (image_proc_utils_ != nullptr)
218  {
220  image_proc_utils_ = nullptr;
221  }
222  }
223 
224  bool readNextFrame();
225  void processOutputAbort();
227  void processOutput();
228  void readInputAbort();
230  void readInput();
231  void dynamicallyReconfigureVariables(adi_3dtof_adtf31xx::ADTF31xxSensorParamsConfig& config, uint32_t level);
233 
234 private:
236  std::string camera_link_;
237  int input_sensor_mode_;
238  int image_width_ = 1024;
239  int image_height_ = 1024;
242  int ab_threshold_ = 10;
244  bool jblf_filter_state_ = true;
248  std::string input_file_name_;
249  std::string input_sensor_ip_;
250  std::string encoding_type_;
252  sensor_msgs::CameraInfo cam_info_msg_;
253  unsigned short* depth_frame_;
254  unsigned short* ab_frame_;
255  short* xyz_frame_;
256  unsigned short* conf_frame_;
266 
269 
270  boost::mutex output_thread_mtx_;
271  boost::mutex input_thread_mtx_;
272 
273  bool error_in_frame_read_ = false;
274 
276  std::queue<ADI3DToFADTF31xxFrameInfo*> input_frames_queue_;
277 
278  int max_debug_queue_length_ = 10;
279  std::queue<ADI3DToFADTF31xxOutputInfo*> output_node_queue_;
280 
281  // dynamic reconfigure parameters
282  dynamic_reconfigure::Server<adi_3dtof_adtf31xx::ADTF31xxSensorParamsConfig> server_;
283  dynamic_reconfigure::Server<adi_3dtof_adtf31xx::ADTF31xxSensorParamsConfig>::CallbackType
285  adi_3dtof_adtf31xx::ADTF31xxSensorParamsConfig dynamic_reconfigure_config_;
286 
294  int processing_scale_ = 2;
296 
303  void fillAndPublishCameraInfo(std::string frame_id, const ros::Publisher& publisher)
304  {
306  cam_info_msg_.header.stamp = curr_frame_timestamp_;
307  cam_info_msg_.header.frame_id = std::move(frame_id);
308 
309  cam_info_msg_.width = image_width_;
310  cam_info_msg_.height = image_height_;
311 
313 
314  cam_info_msg_.K.fill(0.0f);
319  cam_info_msg_.K[8] = 1.0f;
320 
321  cam_info_msg_.P.fill(0.0);
328  cam_info_msg_.P[10] = 1.0f;
330 
331  cam_info_msg_.D.resize(0);
332  for (float distortion_coeff : depth_intrinsics_.distortion_coeffs)
333  {
334  cam_info_msg_.D.push_back(distortion_coeff);
335  }
336 
337  cam_info_msg_.R.fill(0.0f);
338  for (int i = 0; i < 9; i++)
339  {
341  }
342 
343  cam_info_msg_.binning_x = 0;
344  cam_info_msg_.binning_y = 0;
345  cam_info_msg_.roi.do_rectify = false;
346  cam_info_msg_.roi.height = 0;
347  cam_info_msg_.roi.width = 0;
348  cam_info_msg_.roi.x_offset = 0;
349  cam_info_msg_.roi.y_offset = 0;
350 
351  publisher.publish(cam_info_msg_);
352  }
353 
362  void publishImageAsRosMsg(cv::Mat img, const std::string& encoding_type, std::string frame_id,
363  const ros::Publisher& publisher)
364  {
366 
367  cv_ptr->encoding = encoding_type;
368  cv_ptr->header.seq = input_sensor_->getFrameCounter();
369  cv_ptr->header.stamp = curr_frame_timestamp_;
370  cv_ptr->header.frame_id = std::move(frame_id);
371  cv_ptr->image = std::move(img);
372 
373  publisher.publish(cv_ptr->toImageMsg());
374  }
375 
383  void publishPointCloud(short* xyz_frame)
384  {
385  sensor_msgs::PointCloud2::Ptr pointcloud_msg(new sensor_msgs::PointCloud2);
386 
387  pointcloud_msg->header.seq = input_sensor_->getFrameCounter();
388  pointcloud_msg->header.stamp = curr_frame_timestamp_;
389  pointcloud_msg->header.frame_id = camera_link_;
390  pointcloud_msg->width = image_width_;
391  pointcloud_msg->height = image_height_;
392  pointcloud_msg->is_dense = false;
393  pointcloud_msg->is_bigendian = false;
394 
395  // XYZ data from sensor.
396  // This data is in 16 bpp format.
397  short* xyz_sensor_buf = xyz_frame;
398 
399  sensor_msgs::PointCloud2Modifier pcd_modifier(*pointcloud_msg);
400  pcd_modifier.setPointCloud2FieldsByString(1, "xyz");
401 
402  sensor_msgs::PointCloud2Iterator<float> iter_x(*pointcloud_msg, "x");
403  sensor_msgs::PointCloud2Iterator<float> iter_y(*pointcloud_msg, "y");
404  sensor_msgs::PointCloud2Iterator<float> iter_z(*pointcloud_msg, "z");
405  for (int i = 0; i < image_height_; i++)
406  {
407  for (int j = 0; j < image_width_; j++)
408  {
409  *iter_x = (float)(*xyz_sensor_buf++) / 1000.0f;
410  *iter_y = (float)(*xyz_sensor_buf++) / 1000.0f;
411  *iter_z = (float)(*xyz_sensor_buf++) / 1000.0f;
412  ++iter_x;
413  ++iter_y;
414  ++iter_z;
415  }
416  }
417 
418  // Publisher
419  xyz_image_publisher_.publish(pointcloud_msg);
420  }
421 
430  {
431  // Publish Camera info
433 
434  if (enable_depth_ab_compression_ == true)
435  {
436  // Publish compressed depth,ab and confidence image
437  PROFILE_FUNCTION_START(Publish_CompressImg)
440 
443 
446  PROFILE_FUNCTION_END(Publish_CompressImg)
447  }
448  else
449  {
450  // Publish uncompressed depth, ab and confidence image
451  // convert to CV format.
452  cv::Mat m_disp_image_depth, m_disp_image_ab, m_disp_image_conf;
453  m_disp_image_depth = cv::Mat(image_height_, image_width_, CV_16UC1, out_frame->depth_frame_);
454  m_disp_image_ab = cv::Mat(image_height_, image_width_, CV_16UC1, out_frame->ab_frame_);
455  m_disp_image_conf = cv::Mat(image_height_, image_width_, CV_16UC1, out_frame->conf_frame_);
456 
457  // Publish image as Ros message
461  }
462 
463  PROFILE_FUNCTION_START(publish_PointCloud)
464  if (enable_point_cloud_publish_ == true)
465  {
466  // Publish point cloud
467  publishPointCloud(out_frame->xyz_frame_);
468  }
469  PROFILE_FUNCTION_END(publish_PointCloud)
470  }
471 
481  void publishRVLCompressedImageAsRosMsg(unsigned char* compressed_img, int compressed_img_size,
482  const std::string& encoding_type, std::string frame_id,
483  const ros::Publisher& publisher)
484  {
486  sensor_msgs::CompressedImage::Ptr compressed_payload_ptr(new sensor_msgs::CompressedImage());
487 
488  compressed_payload_ptr->format = encoding_type + ";compressedDepth rvl";
489  compressed_payload_ptr->header.seq = input_sensor_->getFrameCounter();
490  compressed_payload_ptr->header.stamp = curr_frame_timestamp_;
491  compressed_payload_ptr->header.frame_id = std::move(frame_id);
492  compressed_payload_ptr->data.resize(compressed_img_size + 8 +
494 
495  // Adding header to compressed depth data as image transport subscribers can decompress.
496  compressed_depth_image_transport::ConfigHeader compressionConfiguration{};
497  compressionConfiguration.format = compressed_depth_image_transport::INV_DEPTH;
498 
499  float depthQuantization = 0;
500  float maximumDepth = 1;
501 
502  // Inverse depth quantization parameters
503  float depthQuantizationA = depthQuantization * (depthQuantization + 1.0f);
504  float depthQuantizationB = 1.0f - depthQuantizationA / maximumDepth;
505  compressionConfiguration.depthParam[0] = depthQuantizationA;
506  compressionConfiguration.depthParam[1] = depthQuantizationB;
507 
508  memcpy(&compressed_payload_ptr->data[0], &compressionConfiguration,
510  memcpy(&compressed_payload_ptr->data[0] + sizeof(compressed_depth_image_transport::ConfigHeader), &image_width_,
511  sizeof(int));
512  memcpy(&compressed_payload_ptr->data[4] + sizeof(compressed_depth_image_transport::ConfigHeader), &image_height_,
513  sizeof(int));
514 
515  memcpy(&compressed_payload_ptr->data[8] + sizeof(compressed_depth_image_transport::ConfigHeader), compressed_img,
516  compressed_img_size);
517 
518  publisher.publish(compressed_payload_ptr);
519  }
520 
522 };
523 
524 #endif
ADI3DToFADTF31xxOutputInfo
This is the class for adtf31xx sensor node output information.
Definition: adi_3dtof_adtf31xx_output_info.h:14
sensor_msgs::image_encodings
sensor_msgs::distortion_models::RATIONAL_POLYNOMIAL
const std::string RATIONAL_POLYNOMIAL
ADI3DToFADTF31xx::cam_info_msg_
sensor_msgs::CameraInfo cam_info_msg_
Definition: adi_3dtof_adtf31xx.h:256
point_cloud2_iterator.h
ADI3DToFADTF31xx::initSettingsForDynamicReconfigure
void initSettingsForDynamicReconfigure()
Dynamic reconfigure initialization.
Definition: adi_3dtof_adtf31xx.cpp:180
ADI3DToFADTF31xx::depth_extrinsics_external_
CameraExtrinsics depth_extrinsics_external_
Definition: adi_3dtof_adtf31xx.h:268
compression_common.h
IInputSensor::getFrameCounter
int getFrameCounter()
Get the current Frame count value.
Definition: input_sensor.h:111
ADI3DToFADTF31xxOutputInfo::compressed_ab_frame_size_
int compressed_ab_frame_size_
Definition: adi_3dtof_adtf31xx_output_info.h:120
ros::Publisher
ADI3DToFADTF31xxOutputInfo::compressed_conf_frame_size_
int compressed_conf_frame_size_
Definition: adi_3dtof_adtf31xx_output_info.h:121
ADI3DToFADTF31xx::enable_depth_ab_compression_
bool enable_depth_ab_compression_
Definition: adi_3dtof_adtf31xx.h:245
ADI3DToFADTF31xx::publishImageAsRosMsg
void publishImageAsRosMsg(cv::Mat img, const std::string &encoding_type, std::string frame_id, const ros::Publisher &publisher)
This function publishes images as Ros messages.
Definition: adi_3dtof_adtf31xx.h:366
boost::shared_ptr
distortion_models.h
ADI3DToFADTF31xx::confidence_threshold_
int confidence_threshold_
Definition: adi_3dtof_adtf31xx.h:247
ADI3DToFADTF31xx::depth_image_publisher_
ros::Publisher depth_image_publisher_
Definition: adi_3dtof_adtf31xx.h:261
pinhole_camera_model.h
ADI3DToFADTF31xx::curr_frame_timestamp_
ros::Time curr_frame_timestamp_
Definition: adi_3dtof_adtf31xx.h:299
ADI3DToFADTF31xx::readInputAbort
void readInputAbort()
Function to read Abort flag, this function will be called by the main function to exit the thread.
Definition: adi_3dtof_adtf31xx_input_thread.cpp:17
ADI3DToFADTF31xxOutputInfo::compressed_ab_frame_
unsigned char * compressed_ab_frame_
Definition: adi_3dtof_adtf31xx_output_info.h:117
IInputSensor::setABinvalidationThreshold
virtual void setABinvalidationThreshold(int threshold)=0
ros.h
ADI3DToFADTF31xx::processOutput
void processOutput()
The output process function, this is running a loop which reads the frame from the putput queue,...
Definition: adi_3dtof_adtf31xx_output_thread.cpp:69
ros::shutdown
ROSCPP_DECL void shutdown()
ADI3DToFADTF31xx::output_thread_mtx_
boost::mutex output_thread_mtx_
Definition: adi_3dtof_adtf31xx.h:274
ADI3DToFADTF31xxFrameInfo
This is the class for adtf31xx sensor frame.
Definition: adi_3dtof_adtf31xx_frame_info.h:16
ADI3DToFADTF31xx::image_width_
int image_width_
Definition: adi_3dtof_adtf31xx.h:242
ADI3DToFADTF31xx::radial_filter_max_threshold_
int radial_filter_max_threshold_
Definition: adi_3dtof_adtf31xx.h:251
ADI3DToFADTF31xxOutputInfo::compressed_depth_frame_size_
int compressed_depth_frame_size_
Definition: adi_3dtof_adtf31xx_output_info.h:119
IInputSensor::setRadialFilterMinThreshold
virtual void setRadialFilterMinThreshold(int radial_min_threshold)=0
IInputSensor::configureSensor
virtual void configureSensor(int camera_mode)=0
ADI3DToFADTF31xx::depth_info_publisher_
ros::Publisher depth_info_publisher_
Definition: adi_3dtof_adtf31xx.h:265
ADI3DToFADTF31xx::publishPointCloud
void publishPointCloud(short *xyz_frame)
This function publishes the point cloud.
Definition: adi_3dtof_adtf31xx.h:387
ADI3DToFADTF31xx::publishRVLCompressedImageAsRosMsg
void publishRVLCompressedImageAsRosMsg(unsigned char *compressed_img, int compressed_img_size, const std::string &encoding_type, std::string frame_id, const ros::Publisher &publisher)
This function publishes a compressed image as Ros message.
Definition: adi_3dtof_adtf31xx.h:485
CameraIntrinsics::camera_matrix
float camera_matrix[9]
Camera matrix = [fx, 0, cx, 0, fy, cy, 0, 0, 1] fx, fy : Camera focal lengths (pixels) cx,...
Definition: adi_camera.h:27
ADI3DToFADTF31xx::read_input_thread_abort_
bool read_input_thread_abort_
Definition: adi_3dtof_adtf31xx.h:272
PROFILE_FUNCTION_END
#define PROFILE_FUNCTION_END(ID)
Definition: module_profile.h:25
ros::Publisher::publish
void publish(const boost::shared_ptr< M > &message) const
ADI3DToFADTF31xx::~ADI3DToFADTF31xx
~ADI3DToFADTF31xx()
Destroy the ADI3DToFADTF31xx object.
Definition: adi_3dtof_adtf31xx.h:219
ADI3DToFADTF31xx::camera_link_
std::string camera_link_
Definition: adi_3dtof_adtf31xx.h:240
IInputSensor::setConfidenceThreshold
virtual void setConfidenceThreshold(int threshold)=0
IInputSensor::getFrameHeight
int getFrameHeight()
Get the Frame Height object Only integer scaling is supported.
Definition: input_sensor.h:74
ADI3DToFADTF31xx::processing_scale_
int processing_scale_
This is the scale factor to scale the input image. The processing will happen on the scaled down imag...
Definition: adi_3dtof_adtf31xx.h:298
ImageProcUtils
This class has image processing utilities.
Definition: image_proc_utils.h:19
ADI3DToFADTF31xx::jblf_filter_state_
bool jblf_filter_state_
Definition: adi_3dtof_adtf31xx.h:248
ADI3DToFADTF31xx::enable_point_cloud_publish_
bool enable_point_cloud_publish_
Definition: adi_3dtof_adtf31xx.h:255
ADI3DToFADTF31xx::error_in_frame_read_
bool error_in_frame_read_
Definition: adi_3dtof_adtf31xx.h:277
ADI3DToFADTF31xx::process_output_thread_abort_
bool process_output_thread_abort_
Definition: adi_3dtof_adtf31xx.h:271
IInputSensor::setJBLFFilterSize
virtual void setJBLFFilterSize(int jblf_filter_size)=0
ADI3DToFADTF31xx::jblf_filter_size_
int jblf_filter_size_
Definition: adi_3dtof_adtf31xx.h:249
ADI3DToFADTF31xx::dynamic_reconfigure_callbacktype_
dynamic_reconfigure::Server< adi_3dtof_adtf31xx::ADTF31xxSensorParamsConfig >::CallbackType dynamic_reconfigure_callbacktype_
Definition: adi_3dtof_adtf31xx.h:288
ADI3DToFADTF31xx::input_sensor_
IInputSensor * input_sensor_
Definition: adi_3dtof_adtf31xx.h:239
ADI3DToFADTF31xx::adtf31xxSensorPushOutputNode
void adtf31xxSensorPushOutputNode(ADI3DToFADTF31xxOutputInfo *new_output_node)
This function pushes the debug node to the output queue. If the queue is full, then the last item in ...
Definition: adi_3dtof_adtf31xx_output_thread.cpp:34
ADI3DToFADTF31xx::input_file_name_
std::string input_file_name_
Definition: adi_3dtof_adtf31xx.h:252
input_sensor_factory.h
sensor_msgs::PointCloud2Iterator
ADI3DToFADTF31xx::input_thread_mtx_
boost::mutex input_thread_mtx_
Definition: adi_3dtof_adtf31xx.h:275
ADI3DToFADTF31xx::updateDynamicReconfigureVariablesInputThread
void updateDynamicReconfigureVariablesInputThread()
updates the parameter of input image based on dynamic reconfigure.
Definition: adi_3dtof_adtf31xx.cpp:34
ADI3DToFADTF31xx::conf_frame_
unsigned short * conf_frame_
Definition: adi_3dtof_adtf31xx.h:260
input_sensor.h
IInputSensor
This is input base class.
Definition: input_sensor.h:18
ADI3DToFADTF31xx::dynamicallyReconfigureVariables
void dynamicallyReconfigureVariables(adi_3dtof_adtf31xx::ADTF31xxSensorParamsConfig &config, uint32_t level)
new values from dynamic reconfigure are copied to a structure variable here, actual update to individ...
Definition: adi_3dtof_adtf31xx.cpp:164
ADI3DToFADTF31xx::dynamic_reconfigure_config_
adi_3dtof_adtf31xx::ADTF31xxSensorParamsConfig dynamic_reconfigure_config_
Definition: adi_3dtof_adtf31xx.h:289
ADI3DToFADTF31xx::depth_extrinsics_
CameraExtrinsics depth_extrinsics_
Definition: adi_3dtof_adtf31xx.h:267
adi_3dtof_adtf31xx_frame_info.h
compressed_depth_image_transport::ConfigHeader
ADI3DToFADTF31xx::adtf31xxSensorGetNextFrame
ADI3DToFADTF31xxFrameInfo * adtf31xxSensorGetNextFrame()
Function to read the next frame from the input Queue.
Definition: adi_3dtof_adtf31xx_input_thread.cpp:27
ADI3DToFADTF31xx::frame_number_
int frame_number_
Definition: adi_3dtof_adtf31xx.h:244
ADI3DToFADTF31xx::input_frames_queue_
std::queue< ADI3DToFADTF31xxFrameInfo * > input_frames_queue_
Definition: adi_3dtof_adtf31xx.h:280
ADI3DToFADTF31xx::processOutputAbort
void processOutputAbort()
This function sets the abort flag for the output thread, the function is normally called by the main ...
Definition: adi_3dtof_adtf31xx_output_thread.cpp:22
ADI3DToFADTF31xx::xyz_image_publisher_
ros::Publisher xyz_image_publisher_
Definition: adi_3dtof_adtf31xx.h:264
ADI3DToFADTF31xx::ab_threshold_
int ab_threshold_
Definition: adi_3dtof_adtf31xx.h:246
ADI3DToFADTF31xx::readNextFrame
bool readNextFrame()
This function is the entry point to the sensor node.
Definition: adi_3dtof_adtf31xx.cpp:86
ADI3DToFADTF31xxOutputInfo::ab_frame_
unsigned short * ab_frame_
Definition: adi_3dtof_adtf31xx_output_info.h:114
CameraExtrinsics::rotation_matrix
float rotation_matrix[9]
Camera rotation parameters.
Definition: adi_camera.h:44
ADI3DToFADTF31xx::radial_filter_min_threshold_
int radial_filter_min_threshold_
Definition: adi_3dtof_adtf31xx.h:250
image_proc_utils.h
ROS_INFO_STREAM
#define ROS_INFO_STREAM(args)
IInputSensor::getExtrinsics
virtual void getExtrinsics(CameraExtrinsics *camera_extrinsics)=0
ADI3DToFADTF31xx::readInput
void readInput()
This function reads the frmae from the sensor. This runs in a loop, reading the frames and adding the...
Definition: adi_3dtof_adtf31xx_input_thread.cpp:63
ADI3DToFADTF31xx::server_
dynamic_reconfigure::Server< adi_3dtof_adtf31xx::ADTF31xxSensorParamsConfig > server_
Definition: adi_3dtof_adtf31xx.h:286
IInputSensor::openSensor
virtual void openSensor(std::string sensor_name, int input_image_width, int input_image_height, std::string config_file_name, std::string input_sensor_ip)=0
ADI3DToFADTF31xx::image_proc_utils_
ImageProcUtils * image_proc_utils_
Definition: adi_3dtof_adtf31xx.h:269
IInputSensor::getFrameWidth
int getFrameWidth()
Get the Frame Width object Only integer scaling is supported.
Definition: input_sensor.h:65
compressed_depth_image_transport::ConfigHeader::format
compressionFormat format
ADI3DToFADTF31xx::encoding_type_
std::string encoding_type_
Definition: adi_3dtof_adtf31xx.h:254
CameraExtrinsics::translation_matrix
float translation_matrix[3]
Camera translation matrix : [Tx,Ty,Tz].
Definition: adi_camera.h:50
ADI3DToFADTF31xx::depth_intrinsics_
CameraIntrinsics depth_intrinsics_
Definition: adi_3dtof_adtf31xx.h:266
PROFILE_FUNCTION_START
#define PROFILE_FUNCTION_START(ID)
Definition: module_profile.h:24
ADI3DToFADTF31xx::ab_image_publisher_
ros::Publisher ab_image_publisher_
Definition: adi_3dtof_adtf31xx.h:262
ADI3DToFADTF31xx::input_sensor_mode_
int input_sensor_mode_
Definition: adi_3dtof_adtf31xx.h:241
ADI3DToFADTF31xx::input_sensor_ip_
std::string input_sensor_ip_
Definition: adi_3dtof_adtf31xx.h:253
ADI3DToFADTF31xx::max_debug_queue_length_
int max_debug_queue_length_
Definition: adi_3dtof_adtf31xx.h:282
ADI3DToFADTF31xx::max_input_queue_length_
int max_input_queue_length_
Definition: adi_3dtof_adtf31xx.h:279
ADI3DToFADTF31xx::shutDownAllNodes
void shutDownAllNodes()
This function shuts down all the nodes running in a roscore.
Definition: adi_3dtof_adtf31xx.h:205
ros::Time
ADI3DToFADTF31xxOutputInfo::depth_frame_
unsigned short * depth_frame_
Definition: adi_3dtof_adtf31xx_output_info.h:113
ADI3DToFADTF31xx::image_height_
int image_height_
Definition: adi_3dtof_adtf31xx.h:243
CameraExtrinsics
Extrinsic parameters of the camera.
Definition: adi_camera.h:38
ADI3DToFADTF31xxOutputInfo::conf_frame_
unsigned short * conf_frame_
Definition: adi_3dtof_adtf31xx_output_info.h:115
ADI3DToFADTF31xx
This is main class for this package.
Definition: adi_3dtof_adtf31xx.h:33
sensor_msgs::PointCloud2Modifier
ADI3DToFADTF31xx::conf_image_publisher_
ros::Publisher conf_image_publisher_
Definition: adi_3dtof_adtf31xx.h:263
cv_bridge.h
CameraIntrinsics
Intrinsic parameters of the camera.
Definition: adi_camera.h:15
ROS_ERROR
#define ROS_ERROR(...)
cv_bridge::CvImage
adi_3dtof_adtf31xx_output_info.h
compressed_depth_image_transport::INV_DEPTH
INV_DEPTH
ADI3DToFADTF31xxOutputInfo::xyz_frame_
short * xyz_frame_
Definition: adi_3dtof_adtf31xx_output_info.h:122
ADI3DToFADTF31xx::ab_frame_
unsigned short * ab_frame_
Definition: adi_3dtof_adtf31xx.h:258
IInputSensor::setRadialFilterMaxThreshold
virtual void setRadialFilterMaxThreshold(int radial_max_threshold)=0
ADI3DToFADTF31xx::ADI3DToFADTF31xx
ADI3DToFADTF31xx()
Construct a new ADI3DToFADTF31xx object.
Definition: adi_3dtof_adtf31xx.h:48
ADI3DToFADTF31xx::depth_frame_
unsigned short * depth_frame_
Definition: adi_3dtof_adtf31xx.h:257
ADI3DToFADTF31xxOutputInfo::compressed_depth_frame_
unsigned char * compressed_depth_frame_
Definition: adi_3dtof_adtf31xx_output_info.h:116
IInputSensor::setJBLFFilterState
virtual void setJBLFFilterState(bool jblf_filter_state)=0
ADI3DToFADTF31xx::xyz_frame_
short * xyz_frame_
Definition: adi_3dtof_adtf31xx.h:259
ROS_INFO
#define ROS_INFO(...)
CameraIntrinsics::distortion_coeffs
float distortion_coeffs[8]
Distortion vector = [k1, k2, p1, p2, k3, k4, k5, k6] k1, k2, k3, k4, k5, k6 : Camera radial distortio...
Definition: adi_camera.h:35
ADI3DToFADTF31xx::fillAndPublishCameraInfo
void fillAndPublishCameraInfo(std::string frame_id, const ros::Publisher &publisher)
This image fills and publishes the camera information.
Definition: adi_3dtof_adtf31xx.h:307
ADI3DToFADTF31xx::publishImageAndCameraInfo
void publishImageAndCameraInfo(ADI3DToFADTF31xxOutputInfo *out_frame)
Publishes the image and camera information. This function publishes the camera information and depth,...
Definition: adi_3dtof_adtf31xx.h:433
IInputSensor::getIntrinsics
virtual void getIntrinsics(CameraIntrinsics *camera_intrinsics)=0
ros::NodeHandle
ADI3DToFADTF31xx::output_node_queue_
std::queue< ADI3DToFADTF31xxOutputInfo * > output_node_queue_
Definition: adi_3dtof_adtf31xx.h:283
ros::Time::now
static Time now()
InputSensorFactory::getInputSensor
static IInputSensor * getInputSensor(int input_sensor_type)
Get the Input Sensor object.
Definition: input_sensor_factory.h:32
ADI3DToFADTF31xxOutputInfo::compressed_conf_frame_
unsigned char * compressed_conf_frame_
Definition: adi_3dtof_adtf31xx_output_info.h:118
IInputSensor::isOpened
bool isOpened()
function to check whether input is opened
Definition: input_sensor.h:55


adi_3dtof_adtf31xx
Author(s):
autogenerated on Sat May 17 2025 02:12:30