Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable qos and default history depth #229

Open
wants to merge 3 commits into
base: ros2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ouster-ros/src/os_cloud_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,14 @@ class OusterCloud : public OusterProcessingNodeBase {
lidar_packet_handler = LidarPacketHandler::create_handler(
info, processors, timestamp_mode,
static_cast<int64_t>(ptp_utc_tai_offset * 1e+9));
rclcpp::SubscriptionOptions subscription_options;
subscription_options.qos_overriding_options = rclcpp::QosOverridingOptions::with_default_policies();
lidar_packet_sub = create_subscription<PacketMsg>(
"lidar_packets", selected_qos,
"lidar_packets", selected_qos.keep_last(100),
[this](const PacketMsg::ConstSharedPtr msg) {
lidar_packet_handler(msg->buf.data());
});
},
subscription_options);
}
}

Expand Down
6 changes: 4 additions & 2 deletions ouster-ros/src/os_sensor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,9 +643,11 @@ void OusterSensor::create_publishers() {
rclcpp::QoS sensor_data_qos = rclcpp::SensorDataQoS();
auto selected_qos =
use_system_default_qos ? system_default_qos : sensor_data_qos;
rclcpp::PublisherOptions publisher_options;
publisher_options.qos_overriding_options = rclcpp::QosOverridingOptions::with_default_policies();
lidar_packet_pub =
create_publisher<PacketMsg>("lidar_packets", selected_qos);
imu_packet_pub = create_publisher<PacketMsg>("imu_packets", selected_qos);
create_publisher<PacketMsg>("lidar_packets", selected_qos.keep_last(100), publisher_options);
imu_packet_pub = create_publisher<PacketMsg>("imu_packets", selected_qos, publisher_options);
}

void OusterSensor::allocate_buffers() {
Expand Down