Skip to content

Commit

Permalink
Fix build issues and new config to the yaml files
Browse files Browse the repository at this point in the history
  • Loading branch information
Samahu committed Aug 21, 2024
1 parent 52c588e commit 785bbeb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
8 changes: 7 additions & 1 deletion ouster-ros/config/driver_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,10 @@ ouster/os_driver:
# - ouster_ros/os_point.h
# - ouster_ros/sensor_point_types.h
# - ouster_ros/common_point_types.h.
point_type: original
point_type: original
# azimuth window start[optional]: values range [0, 360000] millidegrees
azimuth_window_start: 0
# azimuth_window_end[optional]: values range [0, 360000] millidegrees
azimuth_window_end: 360000
# persist_config[optional]: request the sensor to persist settings
persist_config: false
3 changes: 3 additions & 0 deletions ouster-ros/config/os_sensor_cloud_image_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ ouster/os_sensor:
lidar_port: 0
imu_port: 0
use_system_default_qos: False
azimuth_window_start: 0
azimuth_window_end: 360000
persist_config: false
ouster/os_cloud:
ros__parameters:
sensor_frame: os_sensor
Expand Down
11 changes: 6 additions & 5 deletions ouster-ros/src/os_sensor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ using ouster_sensor_msgs::srv::SetConfig;

using namespace std::chrono_literals;
using namespace std::string_literals;
using std::to_string;

namespace ouster_ros {

Expand Down Expand Up @@ -532,9 +533,9 @@ sensor::sensor_config OusterSensor::parse_config_from_ros_parameters() {

persist_config = get_parameter("persist_config").as_bool();
if (persist_config && (lidar_port == 0 || imu_port == 0)) {
RCLCPP_WARN("When using persist_config it is recommended to not "
"use 0 for port values as this currently will trigger sensor reinit "
"event each time");
RCLCPP_WARN(get_logger(), "When using persist_config it is recommended "
" to not use 0 for port values as this currently will trigger sensor "
" reinit event each time");
}

config.udp_profile_lidar = udp_profile_lidar;
Expand All @@ -553,7 +554,7 @@ sensor::sensor_config OusterSensor::parse_config_from_ros_parameters() {
azimuth_window_end < MIN_AZW || azimuth_window_end > MAX_AZW) {
auto error_msg = "azimuth window values must be between " +
to_string(MIN_AZW) + " and " + to_string(MAX_AZW);
RCLCPP_ERROR_STREAM(error_msg);
RCLCPP_ERROR_STREAM(get_logger(), error_msg);
throw std::runtime_error(error_msg);
}

Expand Down Expand Up @@ -599,7 +600,7 @@ uint8_t OusterSensor::compose_config_flags(
}

if (persist_config) {
RCLCPP_INFO("Configuration will be persisted");
RCLCPP_INFO(get_logger(), "Configuration will be persisted");
config_flags |= ouster::sensor::CONFIG_PERSIST;
}

Expand Down

0 comments on commit 785bbeb

Please sign in to comment.