fix(test): add teat_autoware module (imu_driver and vehicle_velocity_converter)#681
fix(test): add teat_autoware module (imu_driver and vehicle_velocity_converter)#681nokosaaan wants to merge 48 commits into
Conversation
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
…verter Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
…rgo fmt 1 Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
There was a problem hiding this comment.
Pull request overview
Adds a new applications/tests/test_autoware module with two subcrates (imu_driver and vehicle_velocity_converter) that model/convert Autoware-like messages and include unit tests for parsing and conversion behavior.
Changes:
- Introduce
imu_drivercrate with a Tamagawa IMU binary parser + request builders and unit tests. - Introduce
vehicle_velocity_convertercrate that convertsVelocityReportintoTwistWithCovarianceStamped+ unit tests. - Add a top-level
test_autowarecrate wiring in the new subcrates as path dependencies.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| applications/tests/test_autoware/vehicle_velocity_converter/src/lib.rs | Adds message structs + velocity conversion logic and unit tests. |
| applications/tests/test_autoware/vehicle_velocity_converter/Cargo.toml | New crate manifest for vehicle_velocity_converter. |
| applications/tests/test_autoware/imu_driver/src/lib.rs | Adds IMU message structs, Tamagawa binary parsing/generation utilities, and unit tests. |
| applications/tests/test_autoware/imu_driver/Cargo.toml | New crate manifest for imu_driver. |
| applications/tests/test_autoware/Cargo.toml | New top-level test_autoware crate manifest depending on the two subcrates. |
| applications/tests/test_autoware/src/lib.rs | New (currently empty) top-level library file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/tier4/awkernel/sessions/2a6ef5c8-5491-440d-bebf-6968b2fa5827 Co-authored-by: nokosaaan <106376734+nokosaaan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/tier4/awkernel/sessions/2a6ef5c8-5491-440d-bebf-6968b2fa5827 Co-authored-by: nokosaaan <106376734+nokosaaan@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
Signed-off-by: nokosaaan <nishimura.r.019@ms.saitama-u.ac.jp>
| let high_byte = (data[0] as i32) << 8; | ||
| let low_byte = data[1] as i32; | ||
| let result = (high_byte & 0xFFFFFF00u32 as i32) | (low_byte & 0x000000FF); | ||
| result as i16 |
There was a problem hiding this comment.
The original C++ used & 0xFFFFFF00 to prevent sign extension from char. Since Rust's data is &[u8], this masking is unnecessary.
| pub fn default() -> Self { | ||
| Self::new("base_link", 0.2, 0.1, 1.0) | ||
| } | ||
|
|
There was a problem hiding this comment.
The current default() is a plain method, so it won't work in generic contexts that require T: Default.
| #[repr(C)] | ||
| pub struct Odometry { | ||
| pub velocity: f64, | ||
| } |
There was a problem hiding this comment.
This struct is marked #[repr(C)] (C-compatible memory layout, typically for FFI) and pub, but it is never used anywhere. Is this an incomplete FFI binding or dead code left by mistake? If it's intentional, please add a comment explaining its purpose; otherwise, remove it.
| Self::new("base_link", 0.2, 0.1, 1.0) | ||
| } | ||
|
|
||
| pub fn convert_velocity_report(&self, msg: &VelocityReport) -> TwistWithCovarianceStamped { |
There was a problem hiding this comment.
The original C++ logs a warning when msg->header.frame_id != frame_id_. This is silently dropped in the Rust port.
There was a problem hiding this comment.
| // Ported from the following versions of the original C++ code: | ||
| // core/autoware_core: | ||
| // type: git | ||
| // url: https://github.com/autowarefoundation/autoware_core.git | ||
| // version: 1.8.0 |
There was a problem hiding this comment.
The attribution comment only references the repository and version, but not the specific source file. Please also specify the original file path. Additionally, the original source is Apache 2.0 licensed; the license header should be carried over.
| // Ported from the following versions of the original C++ code: | ||
| // tamagawa_imu_driver | ||
| // type: git | ||
| // url: https://github.com/tier4/tamagawa_imu_driver | ||
| // version: 0.1.0 |
There was a problem hiding this comment.
The attribution comment only references the repository and version, but not the specific source file. Please also specify the original file path. Additionally, the original source is Apache 2.0 licensed; the license header should be carried over.
Description
I have added the
imu_driverandvehicle_velocity_convertermodules. While I based the test code on the implementation inAutoware, there was no test code forimu_driver, so I created test cases focused on input and output. All test cases have been verified.Related links
https://github.com/autowarefoundation/autoware_core/tree/main/sensing/autoware_vehicle_velocity_converter/test
https://github.com/tier4/tamagawa_imu_driver/tree/ros2
How was this PR tested?
cargo test --manifest-path /path/to/module/Cargo.toml
test_imu_driver.log
test_vehicle_velocity_converter.log
Notes for reviewers