@@ -58,30 +58,25 @@ K4AROSDevice::K4AROSDevice()
5858 static const std::string compressed_png_level = " /compressed/png_level" ;
5959
6060 // Declare node parameters
61- this ->declare_parameter (" depth_enabled" );
62- this ->declare_parameter (" depth_mode" );
63- this ->declare_parameter (" color_enabled" );
64- this ->declare_parameter (" color_format" );
65- this ->declare_parameter (" color_resolution" );
66- this ->declare_parameter (" fps" );
67- this ->declare_parameter (" point_cloud" );
68- this ->declare_parameter (" rgb_point_cloud" );
69- this ->declare_parameter (" point_cloud_in_depth_frame" );
70- this ->declare_parameter (" required" );
71- this ->declare_parameter (" sensor_sn" );
72- this ->declare_parameter (" recording_file" );
73- this ->declare_parameter (" recording_loop_enabled" );
74- this ->declare_parameter (" body_tracking_enabled" );
75- this ->declare_parameter (" body_tracking_smoothing_factor" );
76- this ->declare_parameter (" rescale_ir_to_mono8" );
77- this ->declare_parameter (" ir_mono8_scaling_factor" );
78- this ->declare_parameter (" imu_rate_target" );
79- this ->declare_parameter (" wired_sync_mode" );
80- this ->declare_parameter (" subordinate_delay_off_master_usec" );
81- this ->declare_parameter ({depth_raw_topic + compressed_format});
82- this ->declare_parameter ({depth_raw_topic + compressed_png_level});
83- this ->declare_parameter ({depth_rect_topic + compressed_format});
84- this ->declare_parameter ({depth_rect_topic + compressed_png_level});
61+ this ->declare_parameter (" depth_enabled" , rclcpp::ParameterValue (true ));
62+ this ->declare_parameter (" depth_mode" , rclcpp::ParameterValue (" NFOV_UNBINNED" ));
63+ this ->declare_parameter (" color_enabled" , rclcpp::ParameterValue (false ));
64+ this ->declare_parameter (" color_format" , rclcpp::ParameterValue (" bgra" ));
65+ this ->declare_parameter (" color_resolution" , rclcpp::ParameterValue (" 720P" ));
66+ this ->declare_parameter (" fps" , rclcpp::ParameterValue (5 ));
67+ this ->declare_parameter (" point_cloud" , rclcpp::ParameterValue (true ));
68+ this ->declare_parameter (" rgb_point_cloud" , rclcpp::ParameterValue (false ));
69+ this ->declare_parameter (" point_cloud_in_depth_frame" , rclcpp::ParameterValue (true ));
70+ this ->declare_parameter (" sensor_sn" , rclcpp::ParameterValue (" " ));
71+ this ->declare_parameter (" recording_file" , rclcpp::ParameterValue (" " ));
72+ this ->declare_parameter (" recording_loop_enabled" , rclcpp::ParameterValue (false ));
73+ this ->declare_parameter (" body_tracking_enabled" , rclcpp::ParameterValue (false ));
74+ this ->declare_parameter (" body_tracking_smoothing_factor" , rclcpp::ParameterValue (0 .0f ));
75+ this ->declare_parameter (" rescale_ir_to_mono8" , rclcpp::ParameterValue (false ));
76+ this ->declare_parameter (" ir_mono8_scaling_factor" , rclcpp::ParameterValue (1 .0f ));
77+ this ->declare_parameter (" imu_rate_target" , rclcpp::ParameterValue (0 ));
78+ this ->declare_parameter (" wired_sync_mode" , rclcpp::ParameterValue (0 ));
79+ this ->declare_parameter (" subordinate_delay_off_master_usec" , rclcpp::ParameterValue (0 ));
8580
8681 // Collect ROS parameters from the param server or from the command line
8782#define LIST_ENTRY (param_variable, param_help_string, param_type, param_default_val ) \
@@ -194,7 +189,7 @@ K4AROSDevice::K4AROSDevice()
194189 {
195190 device = k4a::device::open (i);
196191 }
197- catch (exception)
192+ catch (exception const & )
198193 {
199194 RCLCPP_ERROR_STREAM (this ->get_logger ()," Failed to open K4A device at index " << i);
200195 continue ;
@@ -259,14 +254,6 @@ K4AROSDevice::K4AROSDevice()
259254 depth_raw_publisher_ = image_transport_->advertise (" depth/image_raw" , 1 , true );
260255 depth_raw_camerainfo_publisher_ = this ->create_publisher <CameraInfo>(" depth/camera_info" , 1 );
261256
262- if (params_.depth_unit == sensor_msgs::image_encodings::TYPE_16UC1) {
263- // set lowest PNG compression for maximum FPS
264- this ->set_parameter ({depth_raw_topic + compressed_format, " png" });
265- this ->set_parameter ({depth_raw_topic + compressed_png_level, 1 });
266- this ->set_parameter ({depth_rect_topic + compressed_format, " png" });
267- this ->set_parameter ({depth_rect_topic + compressed_png_level, 1 });
268- }
269-
270257 depth_raw_publisher_ = image_transport_->advertise (depth_raw_topic, 1 , true );
271258 depth_raw_camerainfo_publisher_ = this ->create_publisher <CameraInfo>(" depth/camera_info" , 1 );
272259
@@ -863,7 +850,6 @@ void K4AROSDevice::framePublisherThread()
863850{
864851 rclcpp::Rate loop_rate (params_.fps );
865852
866- k4a_wait_result_t wait_result;
867853 k4a_result_t result;
868854
869855 CameraInfo rgb_raw_camera_info;
0 commit comments