Skip to content

Commit

Permalink
feat: disabled objects from corner radars since they are not supported
Browse files Browse the repository at this point in the history
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
  • Loading branch information
knzo25 committed Jan 17, 2025
1 parent 9ab56a1 commit e48c43c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 41 deletions.
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) {
return true;
}

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

Expand Down Expand Up @@ -345,27 +355,6 @@ bool ContinentalARS548Decoder::parse_objects_list_packet(
object_msg.orientation = object.position_orientation.value();
object_msg.orientation_std = object.position_orientation_std.value();

// cSpell:ignore knzo25
// NOTE(knzo25): In the radar firmware used when developing this driver,
// corner radars are not supported. We can partially address this,
// but the coordinates look only spatially correct (not the dynamics).
// so its use is the responsibility of the user.
// Corner radars are expected to be supported in a new firmware version,
// but this is not yet confirmed.
if (
std::abs(radar_status_.yaw) > 5.0 * M_PI / 180.0 &&
std::abs(radar_status_.yaw) < 90.0 * M_PI / 180.0) {
const double dx = radar_status_.longitudinal + radar_status_.wheel_base;
const double dy = radar_status_.lateral;
double x = object_msg.position.x - dx;
double y = object_msg.position.y - dy;
const auto & yaw = radar_status_.yaw;

object_msg.position.x = x * std::cos(yaw) - y * std::sin(yaw) + dx;
object_msg.position.y = x * std::sin(yaw) + y * std::cos(yaw) + dy;
object_msg.orientation += yaw;
}

object_msg.existence_probability = object.existence_probability.value();
object_msg.classification_car = object.classification_car;
object_msg.classification_truck = object.classification_truck;
Expand Down
17 changes: 6 additions & 11 deletions nebula_ros/src/continental/continental_ars548_decoder_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,26 +206,21 @@ void ContinentalARS548DecoderWrapper::sensor_status_callback(

// cSpell:ignore knzo25
// NOTE(knzo25): In the radar firmware used when developing this driver,
// corner radars are not supported. We can partially address this,
// but the coordinates look only spatially correct (not the dynamics).
// so its use is the responsibility of the user.
// Corner radars are expected to be supported in a new firmware version,
// but this is not yet confirmed.
// 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. We "
"can partially address this, but the coordinates look only spatially correct (not the "
"dynamics). so its use is the responsibility of the user. Corner radars are expected to be "
"supported in a new firmware version, but this is not yet confirmed.");
"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). This should only be used for "
"evaluation purposes.";
". 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,13 @@ void ContinentalARS548HwInterfaceWrapper::set_sensor_mounting_request_callback(

// cSpell:ignore knzo25
// NOTE(knzo25): In the radar firmware used when developing this driver,
// corner radars are not supported. We can partially address this,
// but the coordinates look only spatially correct (not the dynamics).
// so its use is the responsibility of the user.
// Corner radars are expected to be supported in a new firmware version,
// but this is not yet confirmed.
// 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_,
"This radar has been configured as a corner radar, which is not supported by the sensor. We "
"can partially address this, but the coordinates look only spatially correct (not the "
"dynamics). so its use is the responsibility of the user. Corner radars are expected to be "
"supported in a new firmware version, but this is not yet confirmed.");
"You are attempting to configure the device as a corner radar, which is not supported so "
"far.");
}

auto result = hw_interface_->set_sensor_mounting(
Expand Down

0 comments on commit e48c43c

Please sign in to comment.