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

feat(ars548): disable object output for corner radars #252

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,16 @@ bool ContinentalARS548Decoder::parse_detections_list_packet(
bool ContinentalARS548Decoder::parse_objects_list_packet(
const nebula_msgs::msg::NebulaPacket & packet_msg)
{
// cSpell:ignore knzo25
// NOTE(knzo25): In the radar firmware used when developing this driver,
// corner radars were not supported. When a new firmware addresses this,
// the driver will be updated.
if (
std::abs(radar_status_.yaw) > 5.0 * M_PI / 180.0 &&
std::abs(radar_status_.yaw) < 90.0 * M_PI / 180.0) {
mojomex marked this conversation as resolved.
Show resolved Hide resolved
return true;
}

auto msg_ptr = std::make_unique<continental_msgs::msg::ContinentalArs548ObjectList>();
auto & msg = *msg_ptr;

Expand Down
19 changes: 19 additions & 0 deletions nebula_ros/src/continental/continental_ars548_decoder_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,25 @@
status.name = config_ptr_->frame_id;
status.message = "Diagnostic messages from ARS548";

// cSpell:ignore knzo25
// NOTE(knzo25): In the radar firmware used when developing this driver,
// corner radars were not supported. When a new firmware addresses this,
// the driver will be updated.
if (
std::abs(sensor_status.yaw) > 5.0 * M_PI / 180.0 &&

Check warning on line 212 in nebula_ros/src/continental/continental_ars548_decoder_wrapper.cpp

View check run for this annotation

Codecov / codecov/patch

nebula_ros/src/continental/continental_ars548_decoder_wrapper.cpp#L212

Added line #L212 was not covered by tests
std::abs(sensor_status.yaw) < 90.0 * M_PI / 180.0) {
rclcpp::Clock clock{RCL_ROS_TIME};
RCLCPP_WARN_THROTTLE(

Check warning on line 215 in nebula_ros/src/continental/continental_ars548_decoder_wrapper.cpp

View check run for this annotation

Codecov / codecov/patch

nebula_ros/src/continental/continental_ars548_decoder_wrapper.cpp#L214-L215

Added lines #L214 - L215 were not covered by tests
logger_, clock, 5000,
"This radar has been configured as a corner radar, which is not supported by the sensor. The "
"driver will not output any objects");

status.level = diagnostic_msgs::msg::DiagnosticStatus::WARN;

Check warning on line 220 in nebula_ros/src/continental/continental_ars548_decoder_wrapper.cpp

View check run for this annotation

Codecov / codecov/patch

nebula_ros/src/continental/continental_ars548_decoder_wrapper.cpp#L220

Added line #L220 was not covered by tests
status.message +=
". Unsupported mounting configuration (corner radar). Only detections should be used under "
"these conditions.";
}

Check warning on line 224 in nebula_ros/src/continental/continental_ars548_decoder_wrapper.cpp

View check run for this annotation

Codecov / codecov/patch

nebula_ros/src/continental/continental_ars548_decoder_wrapper.cpp#L224

Added line #L224 was not covered by tests

auto add_diagnostic = [&status](const std::string & key, const std::string & value) {
diagnostic_msgs::msg::KeyValue key_value;
key_value.key = key;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,17 @@
pitch = rpy.y;
}

// cSpell:ignore knzo25
// NOTE(knzo25): In the radar firmware used when developing this driver,
// corner radars were not supported. When a new firmware addresses this,
// the driver will be updated.
if (std::abs(yaw) > 5.0 * M_PI / 180.0 && std::abs(yaw) < 90.0 * M_PI / 180.0) {
RCLCPP_WARN(

Check warning on line 223 in nebula_ros/src/continental/continental_ars548_hw_interface_wrapper.cpp

View check run for this annotation

Codecov / codecov/patch

nebula_ros/src/continental/continental_ars548_hw_interface_wrapper.cpp#L223

Added line #L223 was not covered by tests
logger_,
"You are attempting to configure the device as a corner radar, which is not supported so "
"far.");
}

auto result = hw_interface_->set_sensor_mounting(
longitudinal, lateral, vertical, yaw, pitch, request->plug_orientation);

Expand Down
Loading