From eed7b31b4a2f9163b18e808ecbe06e24f2ec03e7 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Mon, 18 Nov 2024 17:39:32 +0900 Subject: [PATCH] chore(aeva_api): put constants and types to the top of the file Signed-off-by: Max SCHMELLER --- .../connections/aeva_api.hpp | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_aeva/connections/aeva_api.hpp b/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_aeva/connections/aeva_api.hpp index a9e526386..6d2c4c481 100644 --- a/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_aeva/connections/aeva_api.hpp +++ b/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_aeva/connections/aeva_api.hpp @@ -35,6 +35,28 @@ namespace nebula::drivers::connections { +static const uint16_t g_aeva_header = 0xAEFA; + +enum class AevaStreamType : uint16_t { + kSphericalPointCloud = 0, + kHealth = 1, + kConfig = 2, + kTelemetry = 3, + kVelocityEstimate = 4, + kCalibration = 5, + kImage = 6, + kReconfig = 7, + kVehicleStateEstimate = 8, + kLog = 9, + kImu = 10, + kObjectList = 12, + kEstimatedDetectionRange = 33, + kUnknown = 0xFFFFu +}; + +using nebula::drivers::aeva::MessageHeader; +using nebula::drivers::aeva::SomeIpHeader; + class ParseError : public std::exception { }; @@ -58,8 +80,6 @@ class MismatchError : public ParseError const std::string message_; }; -static const uint16_t g_aeva_header = 0xAEFA; - template void expect_eq(A actual, E expected, const std::string & message) { @@ -76,26 +96,6 @@ void expect_geq(A actual, E expected, const std::string & message) if (cast_actual < cast_expected) throw MismatchError(message, cast_expected, cast_actual); } -enum class AevaStreamType : uint16_t { - kSphericalPointCloud = 0, - kHealth = 1, - kConfig = 2, - kTelemetry = 3, - kVelocityEstimate = 4, - kCalibration = 5, - kImage = 6, - kReconfig = 7, - kVehicleStateEstimate = 8, - kLog = 9, - kImu = 10, - kObjectList = 12, - kEstimatedDetectionRange = 33, - kUnknown = 0xFFFFu -}; - -using nebula::drivers::aeva::MessageHeader; -using nebula::drivers::aeva::SomeIpHeader; - template T pull_and_parse( const std::vector::const_iterator & cbegin,