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: support Aeva Aeries II #169

Open
wants to merge 58 commits into
base: main
Choose a base branch
from

Conversation

mojomex
Copy link
Collaborator

@mojomex mojomex commented Jun 26, 2024

PR Type

  • New Feature

Description

Add support for Aeva Aeries II:

  • output pointclouds with velocity info
  • allow for frame sync, scan pattern and FoV setup via the launch config
  • publish diagnostics (health + telemetry) to /diagnostics

Review Procedure

  • Code review
  • Test with sensor
    • Pointcloud fields are correct (use rviz2)
    • Packets are published when subscribed to when launch_hw:=true, subscribed to when launch_hw:=false
    • Diagnostics are correct (use rqt's Plugins->Robot Tools->Runtime Monitor)
  • Test with PTP configs provided by Aeva

Remarks

This is a fairly minimal implementation for now.

Pre-Review Checklist for the PR Author

PR Author should check the checkboxes below when creating the PR.

  • Assign PR to reviewer

Checklist for the PR Reviewer

Reviewers should check the checkboxes below before approval.

  • Commits are properly organized and messages are according to the guideline
  • (Optional) Unit tests have been written for new behavior
  • PR title describes the changes

Post-Review Checklist for the PR Author

PR Author should check the checkboxes below before merging.

  • All open points are addressed and tracked via issues or tickets

CI Checks

  • Build and test for PR: Required to pass before the merge.

@mojomex mojomex requested a review from drwnz June 26, 2024 08:17
@mojomex mojomex self-assigned this Jun 26, 2024
@mojomex mojomex force-pushed the aeva-aries2-support branch 2 times, most recently from a8c9ee5 to 4829c22 Compare June 26, 2024 10:59
@mojomex mojomex marked this pull request as ready for review June 26, 2024 11:00
@mojomex mojomex force-pushed the aeva-aries2-support branch from 4829c22 to 282c6aa Compare June 26, 2024 11:15
@mojomex
Copy link
Collaborator Author

mojomex commented Jul 4, 2024

🟢 Evaluation

🟢 Pointcloud Output

Pointcloud Field Image
azimuth azimuth
elevation elevation
distance distance
range rate range_rate_-2_2
intensity intensity
channel channel
return type* returtn_type_strongest_secondstrongest
timestamp** time_stamp_0_1e8

*: red: strongest, magenta: second strongest. Currently, there is no documented way to get or set the return mode without the proprietary API. Nebula is currently hard-coded for the default configuration. fixed in 7ea9137. Return modes are now correctly handled.
**: clamped to [red, magenta] = [0 ns, 1e8 ns]. Timestamps are loosely proportional to increasing elevation.

🟢 Performance

The pointcloud is published consistently at around 10 Hz:
pointcloud_10hz

🟢 Hardware Monitor

Diagnostic Image
temperature monitor_temperature
system info monitor_sysinfo
SPC converter monitor_spc_converter
scanner monitor_scanner
health codes*** monitor_health
configuration monitor_config

***: ⚠️ Currently, the descriptions of health codes are under NDA and cannot be put into Nebula.

🟢 PTP & Synchronization

PTP has been tested with all provided mechanisms (1588v2, gPTP, automotive) and works with all of them using the vendor-provided configurations.

Pointcloud timestamps take around 1-2 min to converge.

Description Image
PTP started, sensor syncs shortly after ptp_start
~100s later, timestamp converges to ToS sync_converged
HW monitor shows converged state monitor_converged
HW monitor shows PTP info monitor_ptp

🟢 Error Handling & Recovery

Currently, Nebula does not attempt to recover from communication errors and instead exits, instead of continuing in a possibly corrupted state.
Errors that have been observed:

  • failing to connect to sensor early after power-on (sensor boots for ~1-2 mins)
  • failing to fetch configuration manifest (timeout) fixed in 7781318 (protocol impl was wrong)
  • receiving unexpected responses after configuration command fixed in 7781318 (protocol impl was wrong)

All of these errors only occur during startup. No crashes / errors were observed during runtime.

🟢 Parameters

All parameters from the sensor's manifest that have more than one possible value have been added to Nebula. No attempt was made to convert them to the common naming scheme used in the other drivers (e.g. return_mode for Aeva is second_peak_type).

Validation:

  • Parameters are validated by the sensor and rejected by Nebula if the sensor reports them as invalid
  • Parameters are automatically propagated to the hardware and decoder
  • Parameter schema allows for auto-complete in config file

@mojomex
Copy link
Collaborator Author

mojomex commented Jul 9, 2024

@drwnz All issues from yesterday have been addressed and I could not find any bugs or unexpected behavior since. I think this is ready to merge.

@codecov-commenter
Copy link

codecov-commenter commented Jul 23, 2024

Codecov Report

Attention: Patch coverage is 7.62389% with 727 lines in your changes missing coverage. Please review.

Project coverage is 24.67%. Comparing base (97959dd) to head (dc8f483).

Files with missing lines Patch % Lines
nebula_ros/src/aeva/aeva_ros_wrapper.cpp 0.00% 167 Missing ⚠️
...nebula_hw_interfaces_aeva/connections/reconfig.hpp 0.00% 101 Missing ⚠️
...ebula_hw_interfaces_aeva/connections/telemetry.hpp 0.00% 78 Missing ⚠️
nebula_ros/src/aeva/hw_monitor_wrapper.cpp 0.00% 77 Missing ⚠️
...rc/nebula_aeva_hw_interfaces/aeva_hw_interface.cpp 0.00% 49 Missing ⚠️
...nebula_hw_interfaces_aeva/connections/aeva_api.hpp 35.82% 39 Missing and 4 partials ⚠️
.../src/nebula_decoders_aeva/aeva_aeries2_decoder.cpp 0.00% 38 Missing ⚠️
...hw_interfaces_common/connections/stream_buffer.hpp 0.00% 23 Missing ⚠️
...common/include/nebula_common/aeva/config_types.hpp 0.00% 17 Missing ⚠️
...s/nebula_hw_interfaces_aeva/connections/health.hpp 0.00% 16 Missing ⚠️
... and 20 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #169      +/-   ##
==========================================
- Coverage   26.07%   24.67%   -1.41%     
==========================================
  Files         101      124      +23     
  Lines        9232    10008     +776     
  Branches     2213     2315     +102     
==========================================
+ Hits         2407     2469      +62     
- Misses       6436     7133     +697     
- Partials      389      406      +17     
Flag Coverage Δ
differential 24.67% <7.62%> (?)
total ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mojomex mojomex requested a review from drwnz September 2, 2024 07:42
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<launch>
<arg name="sensor_model" description="Aeries2"/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description or default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Addressed in 3a7898a. Also added support for Aeva in the generic launch file in d7f1c7a.

@mojomex mojomex force-pushed the aeva-aries2-support branch from b3ffe46 to e2da3f4 Compare September 3, 2024 01:59
@mojomex mojomex force-pushed the aeva-aries2-support branch from 1a92701 to 9a9bc9f Compare November 12, 2024 07:58
@mojomex
Copy link
Collaborator Author

mojomex commented Nov 12, 2024

🟢 Confirmed working with FW 14.0.0 after the latest commits:
image

Copy link
Collaborator

@drwnz drwnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(quick read through review, will go through in more detail)

docs/point_types.md Outdated Show resolved Hide resolved
nebula_common/CMakeLists.txt Outdated Show resolved Hide resolved
auto mode_name = util::get_if_exists<std::string>(tree, {"dsp_control", "second_peak_type"});

if (!mode_name) return {};
if (mode_name == "strongest") return ReturnMode::DUAL_STRONGEST_SECONDSTRONGEST;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: although no performance benefit in this case, a switch looks nicer (IMO)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++ doesn't allow switch statements for strings 🥲 I agree though

nebula_common/include/nebula_common/aeva/config_types.hpp Outdated Show resolved Hide resolved

POINT_CLOUD_REGISTER_POINT_STRUCT( // NOLINT
nebula::drivers::aeva::PointXYZVIRCAEDT,
(float, x,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes is this how pre-commit wanted the line break? :P

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, tried to coax it to do it differently but it's stubborn.

nebula_common/include/nebula_common/util/parsing.hpp Outdated Show resolved Hide resolved
const aeva::Aeries2Config & config, const std::shared_ptr<loggers::Logger> & logger)
{
return std::make_shared<ReconfigParser>(
std::make_shared<TcpStream>(config.sensor_ip, 41007),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is plausible that the port numbers change with updated sensor models, should these be constexpr in a relevant header file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed! Addressed in f5bd7fc.

@mojomex mojomex changed the base branch from develop to main November 12, 2024 09:39
@mojomex mojomex force-pushed the aeva-aries2-support branch from 1a6f4bd to 0cae323 Compare November 18, 2024 08:22
@mojomex mojomex requested review from drwnz and knzo25 December 12, 2024 08:02
@knzo25
Copy link
Collaborator

knzo25 commented Dec 13, 2024

@mojomex
There seem to be conflicts !

mojomex and others added 25 commits December 16, 2024 09:47
… sensor_model in launch file

Signed-off-by: Max SCHMELLER <[email protected]>
@mojomex mojomex force-pushed the aeva-aries2-support branch from dfb1a02 to b248dee Compare December 16, 2024 01:13
@mojomex
Copy link
Collaborator Author

mojomex commented Dec 16, 2024

@knzo25
Sorry for the inconvenience 🙇
The PR has now been rebased ontothe newest main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants