From 1de44850ac97edbc96d94aae52c0fa903e2353d9 Mon Sep 17 00:00:00 2001 From: macDure Date: Fri, 17 Jul 2020 17:34:55 +0800 Subject: [PATCH] canbus: devkit protocol: add the AEB state and some signals' unit --- modules/canbus/proto/devkit.proto | 100 +++++++++++------- .../devkit/protocol/brake_command_101.cc | 4 +- .../devkit/protocol/brake_command_101.h | 4 +- .../devkit/protocol/brake_report_501.cc | 2 +- .../devkit/protocol/brake_report_501.h | 2 +- .../devkit/protocol/steering_command_102.cc | 2 +- .../devkit/protocol/steering_command_102.h | 2 +- .../devkit/protocol/steering_report_502.cc | 9 +- .../devkit/protocol/steering_report_502.h | 4 +- .../devkit/protocol/throttle_command_100.cc | 4 +- .../devkit/protocol/throttle_command_100.h | 2 +- .../devkit/protocol/throttle_report_500.cc | 2 +- .../devkit/protocol/throttle_report_500.h | 2 +- .../devkit/protocol/ultr_sensor_1_507.h | 8 +- .../devkit/protocol/ultr_sensor_2_508.cc | 8 +- .../devkit/protocol/ultr_sensor_2_508.h | 8 +- .../devkit/protocol/ultr_sensor_3_509.cc | 8 +- .../devkit/protocol/ultr_sensor_3_509.h | 8 +- .../devkit/protocol/ultr_sensor_4_510.cc | 8 +- .../devkit/protocol/ultr_sensor_4_510.h | 8 +- .../devkit/protocol/ultr_sensor_5_511.cc | 8 +- .../devkit/protocol/ultr_sensor_5_511.h | 8 +- .../vehicle/devkit/protocol/vcu_report_505.cc | 72 ++++++++++++- .../vehicle/devkit/protocol/vcu_report_505.h | 36 ++++++- .../devkit/protocol/vcu_report_505_test.cc | 4 + .../devkit/protocol/wheelspeed_report_506.cc | 8 +- .../devkit/protocol/wheelspeed_report_506.h | 8 +- 27 files changed, 233 insertions(+), 106 deletions(-) diff --git a/modules/canbus/proto/devkit.proto b/modules/canbus/proto/devkit.proto index 65e00e2c73..214acd297f 100755 --- a/modules/canbus/proto/devkit.proto +++ b/modules/canbus/proto/devkit.proto @@ -4,25 +4,25 @@ package apollo.canbus; message Wheelspeed_report_506 { // Report Message - // [] [0|65.535] + // [m/s] [0|65.535] optional double rr = 1; - // [] [0|65.535] + // [m/s] [0|65.535] optional double rl = 2; - // [] [0|65.535] + // [m/s] [0|65.535] optional double fr = 3; - // [] [0|65.535] + // [m/s] [0|65.535] optional double fl = 4; } message Ultr_sensor_1_507 { // Report Message - // [] [0|65535] + // [cm] [0|65535] optional double uiuss9_tof_direct = 1; - // [] [0|65535] + // [cm] [0|65535] optional double uiuss8_tof_direct = 2; - // [] [0|65535] + // [cm] [0|65535] optional double uiuss11_tof_direct = 3; - // [] [0|65535] + // [cm] [0|65535] optional double uiuss10_tof_direct = 4; } @@ -34,7 +34,7 @@ message Steering_command_102 { } // [] [0|1] optional Steer_en_ctrlType steer_en_ctrl = 1; - // [] [-500|500] + // [deg] [-500|500] optional double steer_angle_target = 2; // [] [0|250] optional int32 steer_angle_spd = 3; @@ -69,11 +69,11 @@ message Throttle_command_100 { THROTTLE_EN_CTRL_DISABLE = 0; THROTTLE_EN_CTRL_ENABLE = 1; } - // [] [0|10] + // [m/s^2] [0|10] optional double throttle_acc = 1; // [] [0|255] optional int32 checksum_110 = 2; - // [] [0|100] + // [%] [0|100] optional double throttle_pedal_target = 3; // [] [0|1] optional Throttle_en_ctrlType throttle_en_ctrl = 4; @@ -85,11 +85,11 @@ message Brake_command_101 { BRAKE_EN_CTRL_DISABLE = 0; BRAKE_EN_CTRL_ENABLE = 1; } - // [] [0|10.23] + // [m/s^2] [0|10] optional double brake_dec = 1; // [] [0|255] optional int32 checksum_111 = 2; - // [] [0|100] + // [%] [0|100] optional double brake_pedal_target = 3; // [] [0|1] optional Brake_en_ctrlType brake_en_ctrl = 4; @@ -115,49 +115,49 @@ message Park_command_104 { message Ultr_sensor_2_508 { // Report Message - // [] [0|65535] + // [cm] [0|65535] optional double uiuss9_tof_indirect = 1; - // [] [0|65535] + // [cm] [0|65535] optional double uiuss8_tof_indirect = 2; - // [] [0|65535] + // [cm] [0|65535] optional double uiuss11_tof_indirect = 3; - // [] [0|65535] + // [cm] [0|65535] optional double uiuss10_tof_indirect = 4; } message Ultr_sensor_3_509 { // Report Message - // [] [0|65535] + // [cm] [0|65535] optional double uiuss5_tof_direct = 1; - // [] [0|65535] + // [cm] [0|65535] optional double uiuss4_tof_direct = 2; - // [] [0|65535] + // [cm] [0|65535] optional double uiuss3_tof_direct = 3; - // [] [0|65535] + // [cm] [0|65535] optional double uiuss2_tof_direct = 4; } message Ultr_sensor_5_511 { // Report Message - // [] [0|65535] + // [cm] [0|65535] optional double uiuss7_tof_direct = 1; - // [] [0|65535] + // [cm] [0|65535] optional double uiuss6_tof_direct = 2; - // [] [0|65535] + // [cm] [0|65535] optional double uiuss1_tof_direct = 3; - // [] [0|65535] + // [cm] [0|65535] optional double uiuss0_tof_direct = 4; } message Ultr_sensor_4_510 { // Report Message - // [] [0|65535] + // [cm] [0|65535] optional double uiuss5_tof_indirect = 1; - // [] [0|65535] + // [cm] [0|65535] optional double uiuss4_tof_indirect = 2; - // [] [0|65535] + // [cm] [0|65535] optional double uiuss3_tof_indirect = 3; - // [] [0|65535] + // [cm] [0|65535] optional double uiuss2_tof_indirect = 4; } @@ -179,10 +179,36 @@ message Park_report_504 { message Vcu_report_505 { // Report Message - // [] [-10|10] - optional double acc = 1; - // [] [0|65.535] - optional double speed = 2; + enum Vehicle_mode_stateType { + VEHICLE_MODE_STATE_MANUAL_REMOTE_MODE = 0; + VEHICLE_MODE_STATE_AUTO_MODE = 1; + VEHICLE_MODE_STATE_EMERGENCY_MODE = 2; + VEHICLE_MODE_STATE_STANDBY_MODE = 3; + } + enum Frontcrash_stateType { + FRONTCRASH_STATE_NO_EVENT = 0; + FRONTCRASH_STATE_CRASH_EVENT = 1; + } + enum Backcrash_stateType { + BACKCRASH_STATE_NO_EVENT = 0; + BACKCRASH_STATE_CRASH_EVENT = 1; + } + enum Aeb_stateType { + AEB_STATE_INCTIVE = 0; + AEB_STATE_ACTIVE = 1; + } + // [] [0|0] + optional Vehicle_mode_stateType vehicle_mode_state = 1; + // [] [0|0] + optional Frontcrash_stateType frontcrash_state = 2; + // [] [0|0] + optional Backcrash_stateType backcrash_state = 3; + // [] [0|0] + optional Aeb_stateType aeb_state = 4; + // [m/s^2] [-10|10] + optional double acc = 5; + // [m/s] [0|65.535] + optional double speed = 6; } message Steering_report_502 { @@ -201,7 +227,7 @@ message Steering_report_502 { STEER_EN_STATE_TAKEOVER = 2; STEER_EN_STATE_STANDBY = 3; } - // [] [0|0] + // [deg/s] [0|250] optional int32 steer_angle_spd_actual = 1; // Steer system communication fault [] [0|1] optional Steer_flt2Type steer_flt2 = 2; @@ -209,7 +235,7 @@ message Steering_report_502 { optional Steer_flt1Type steer_flt1 = 3; // [] [0|2] optional Steer_en_stateType steer_en_state = 4; - // [] [-500|500] + // [deg] [-500|500] optional double steer_angle_actual = 5; } @@ -248,7 +274,7 @@ message Throttle_report_500 { THROTTLE_EN_STATE_TAKEOVER = 2; THROTTLE_EN_STATE_STANDBY = 3; } - // [] [0|100] + // [%] [0|100] optional double throttle_pedal_actual = 1; // Drive system communication fault [] [0|1] optional Throttle_flt2Type throttle_flt2 = 2; @@ -274,7 +300,7 @@ message Brake_report_501 { BRAKE_EN_STATE_TAKEOVER = 2; BRAKE_EN_STATE_STANDBY = 3; } - // [] [0|100] + // [%] [0|100] optional double brake_pedal_actual = 1; // Brake system communication fault [] [0|1] optional Brake_flt2Type brake_flt2 = 2; diff --git a/modules/canbus/vehicle/devkit/protocol/brake_command_101.cc b/modules/canbus/vehicle/devkit/protocol/brake_command_101.cc index 31ab57d0d8..6024ea63e1 100755 --- a/modules/canbus/vehicle/devkit/protocol/brake_command_101.cc +++ b/modules/canbus/vehicle/devkit/protocol/brake_command_101.cc @@ -59,7 +59,7 @@ Brakecommand101* Brakecommand101::set_brake_dec(double brake_dec) { // config detail: {'name': 'Brake_Dec', 'offset': 0.0, 'precision': 0.01, 'len': // 10, 'is_signed_var': False, 'physical_range': '[0|10]', 'bit': 15, 'type': -// 'double', 'order': 'motorola', 'physical_unit': ''} +// 'double', 'order': 'motorola', 'physical_unit': 'm/s^2'} void Brakecommand101::set_p_brake_dec(uint8_t* data, double brake_dec) { brake_dec = ProtocolData::BoundedValue(0.0, 10.0, brake_dec); int x = brake_dec / 0.010000; @@ -99,7 +99,7 @@ Brakecommand101* Brakecommand101::set_brake_pedal_target( // config detail: {'name': 'Brake_Pedal_Target', 'offset': 0.0, 'precision': // 0.1, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|100]', 'bit': -// 31, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 31, 'type': 'double', 'order': 'motorola', 'physical_unit': '%'} void Brakecommand101::set_p_brake_pedal_target(uint8_t* data, double brake_pedal_target) { brake_pedal_target = diff --git a/modules/canbus/vehicle/devkit/protocol/brake_command_101.h b/modules/canbus/vehicle/devkit/protocol/brake_command_101.h index eb3ff704c9..88f53331fe 100755 --- a/modules/canbus/vehicle/devkit/protocol/brake_command_101.h +++ b/modules/canbus/vehicle/devkit/protocol/brake_command_101.h @@ -38,7 +38,7 @@ class Brakecommand101 : public ::apollo::drivers::canbus::ProtocolData< // config detail: {'name': 'Brake_Dec', 'offset': 0.0, 'precision': 0.01, // 'len': 10, 'is_signed_var': False, 'physical_range': '[0|10.00]', 'bit': - // 15, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 15, 'type': 'double', 'order': 'motorola', 'physical_unit': 'm/s^2'} Brakecommand101* set_brake_dec(double brake_dec); // config detail: {'name': 'CheckSum_111', 'offset': 0.0, 'precision': 1.0, @@ -48,7 +48,7 @@ class Brakecommand101 : public ::apollo::drivers::canbus::ProtocolData< // config detail: {'name': 'Brake_Pedal_Target', 'offset': 0.0, 'precision': // 0.1, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|100]', 'bit': - // 31, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 31, 'type': 'double', 'order': 'motorola', 'physical_unit': '%'} Brakecommand101* set_brake_pedal_target(double brake_pedal_target); // config detail: {'name': 'Brake_EN_CTRL', 'enum': {0: diff --git a/modules/canbus/vehicle/devkit/protocol/brake_report_501.cc b/modules/canbus/vehicle/devkit/protocol/brake_report_501.cc index 04d2c622d8..8588f7f826 100755 --- a/modules/canbus/vehicle/devkit/protocol/brake_report_501.cc +++ b/modules/canbus/vehicle/devkit/protocol/brake_report_501.cc @@ -45,7 +45,7 @@ void Brakereport501::Parse(const std::uint8_t* bytes, int32_t length, // config detail: {'name': 'brake_pedal_actual', 'offset': 0.0, 'precision': // 0.1, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|100]', 'bit': -// 31, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 31, 'type': 'double', 'order': 'motorola', 'physical_unit': '%'} double Brakereport501::brake_pedal_actual(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 3); diff --git a/modules/canbus/vehicle/devkit/protocol/brake_report_501.h b/modules/canbus/vehicle/devkit/protocol/brake_report_501.h index 1ba56d0957..6ac7cd980f 100755 --- a/modules/canbus/vehicle/devkit/protocol/brake_report_501.h +++ b/modules/canbus/vehicle/devkit/protocol/brake_report_501.h @@ -34,7 +34,7 @@ class Brakereport501 : public ::apollo::drivers::canbus::ProtocolData< private: // config detail: {'name': 'Brake_Pedal_Actual', 'offset': 0.0, 'precision': // 0.1, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|100]', 'bit': - // 31, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 31, 'type': 'double', 'order': 'motorola', 'physical_unit': '%'} double brake_pedal_actual(const std::uint8_t* bytes, const int32_t length) const; diff --git a/modules/canbus/vehicle/devkit/protocol/steering_command_102.cc b/modules/canbus/vehicle/devkit/protocol/steering_command_102.cc index 8ca7651eda..9b82b2651e 100755 --- a/modules/canbus/vehicle/devkit/protocol/steering_command_102.cc +++ b/modules/canbus/vehicle/devkit/protocol/steering_command_102.cc @@ -78,7 +78,7 @@ Steeringcommand102* Steeringcommand102::set_steer_angle_target( // config detail: {'name': 'Steer_ANGLE_Target', 'offset': -500.0, 'precision': // 0.1, 'len': 16, 'is_signed_var': False, 'physical_range': '[-500|500]', -// 'bit': 31, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 31, 'type': 'double', 'order': 'motorola', 'physical_unit': 'deg'} void Steeringcommand102::set_p_steer_angle_target(uint8_t* data, double steer_angle_target) { steer_angle_target = diff --git a/modules/canbus/vehicle/devkit/protocol/steering_command_102.h b/modules/canbus/vehicle/devkit/protocol/steering_command_102.h index 5bccc2278d..f8568d9fdf 100755 --- a/modules/canbus/vehicle/devkit/protocol/steering_command_102.h +++ b/modules/canbus/vehicle/devkit/protocol/steering_command_102.h @@ -46,7 +46,7 @@ class Steeringcommand102 : public ::apollo::drivers::canbus::ProtocolData< // config detail: {'name': 'Steer_ANGLE_Target', 'offset': -500.0, // 'precision': 0.1, 'len': 16, 'is_signed_var': False, 'physical_range': // '[-500|500]', 'bit': 31, 'type': 'double', 'order': 'motorola', - // 'physical_unit': ''} + // 'physical_unit': 'deg'} Steeringcommand102* set_steer_angle_target(double steer_angle_target); // config detail: {'name': 'Steer_ANGLE_SPD', 'offset': 0.0, 'precision': 1.0, diff --git a/modules/canbus/vehicle/devkit/protocol/steering_report_502.cc b/modules/canbus/vehicle/devkit/protocol/steering_report_502.cc index d1e98e7cc3..d379501a96 100755 --- a/modules/canbus/vehicle/devkit/protocol/steering_report_502.cc +++ b/modules/canbus/vehicle/devkit/protocol/steering_report_502.cc @@ -49,7 +49,8 @@ void Steeringreport502::Parse(const std::uint8_t* bytes, int32_t length, // config detail: {'name': 'steer_angle_spd_actual', 'offset': 0.0, // 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': -// '[0|0]', 'bit': 55, 'type': 'int', 'order': 'motorola', 'physical_unit': ''} +// '[0|0]', 'bit': 55, 'type': 'int', 'order': 'motorola', 'physical_unit': +// 'deg/s'} int Steeringreport502::steer_angle_spd_actual(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 6); @@ -94,10 +95,6 @@ Steering_report_502::Steer_flt1Type Steeringreport502::steer_flt1( // 'STEER_EN_STATE_TAKEOVER', 3: 'STEER_EN_STATE_STANDBY'}, 'precision': 1.0, // 'len': 2, 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|2]', // 'bit': 1, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''} -// 'STEER_EN_STATE_MANUAL', 1: 'STEER_EN_STATE_AUTO', 2: -// 'STEER_EN_STATE_TAKEOVER'}, 'precision': 1.0, 'len': 2, 'is_signed_var': -// False, 'offset': 0.0, 'physical_range': '[0|2]', 'bit': 1, 'type': 'enum', -// 'order': 'motorola', 'physical_unit': ''} Steering_report_502::Steer_en_stateType Steeringreport502::steer_en_state( const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 0); @@ -110,7 +107,7 @@ Steering_report_502::Steer_en_stateType Steeringreport502::steer_en_state( // config detail: {'name': 'steer_angle_actual', 'offset': -500.0, 'precision': // 0.1, 'len': 16, 'is_signed_var': False, 'physical_range': '[-500|500]', -// 'bit': 31, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 31, 'type': 'double', 'order': 'motorola', 'physical_unit': 'deg'} double Steeringreport502::steer_angle_actual(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 3); diff --git a/modules/canbus/vehicle/devkit/protocol/steering_report_502.h b/modules/canbus/vehicle/devkit/protocol/steering_report_502.h index b560bd3b26..7f36096c57 100755 --- a/modules/canbus/vehicle/devkit/protocol/steering_report_502.h +++ b/modules/canbus/vehicle/devkit/protocol/steering_report_502.h @@ -35,7 +35,7 @@ class Steeringreport502 : public ::apollo::drivers::canbus::ProtocolData< // config detail: {'name': 'Steer_ANGLE_SPD_Actual', 'offset': 0.0, // 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': // '[0|0]', 'bit': 55, 'type': 'int', 'order': 'motorola', 'physical_unit': - // ''} + // 'deg/s'} int steer_angle_spd_actual(const std::uint8_t* bytes, const int32_t length) const; @@ -67,7 +67,7 @@ class Steeringreport502 : public ::apollo::drivers::canbus::ProtocolData< // config detail: {'name': 'Steer_ANGLE_Actual', 'offset': -500.0, // 'precision': 0.1, 'len': 16, 'is_signed_var': False, 'physical_range': // '[-500|500]', 'bit': 31, 'type': 'double', 'order': 'motorola', - // 'physical_unit': ''} + // 'physical_unit': 'deg'} double steer_angle_actual(const std::uint8_t* bytes, const int32_t length) const; }; diff --git a/modules/canbus/vehicle/devkit/protocol/throttle_command_100.cc b/modules/canbus/vehicle/devkit/protocol/throttle_command_100.cc index 3a7d14bf25..d8105e2c01 100755 --- a/modules/canbus/vehicle/devkit/protocol/throttle_command_100.cc +++ b/modules/canbus/vehicle/devkit/protocol/throttle_command_100.cc @@ -59,7 +59,7 @@ Throttlecommand100* Throttlecommand100::set_throttle_acc(double throttle_acc) { // config detail: {'name': 'Throttle_Acc', 'offset': 0.0, 'precision': 0.01, // 'len': 10, 'is_signed_var': False, 'physical_range': '[0|10]', 'bit': 15, -// 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'type': 'double', 'order': 'motorola', 'physical_unit': 'm/s^2'} void Throttlecommand100::set_p_throttle_acc(uint8_t* data, double throttle_acc) { throttle_acc = ProtocolData::BoundedValue(0.0, 10.0, throttle_acc); @@ -100,7 +100,7 @@ Throttlecommand100* Throttlecommand100::set_throttle_pedal_target( // config detail: {'name': 'Throttle_Pedal_Target', 'offset': 0.0, 'precision': // 0.1, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|100]', 'bit': -// 31, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 31, 'type': 'double', 'order': 'motorola', 'physical_unit': '%'} void Throttlecommand100::set_p_throttle_pedal_target( uint8_t* data, double throttle_pedal_target) { throttle_pedal_target = diff --git a/modules/canbus/vehicle/devkit/protocol/throttle_command_100.h b/modules/canbus/vehicle/devkit/protocol/throttle_command_100.h index 60262443a3..efc2e673ea 100755 --- a/modules/canbus/vehicle/devkit/protocol/throttle_command_100.h +++ b/modules/canbus/vehicle/devkit/protocol/throttle_command_100.h @@ -49,7 +49,7 @@ class Throttlecommand100 : public ::apollo::drivers::canbus::ProtocolData< // config detail: {'name': 'Throttle_Pedal_Target', 'offset': 0.0, // 'precision': 0.1, 'len': 16, 'is_signed_var': False, 'physical_range': // '[0|100]', 'bit': 31, 'type': 'double', 'order': 'motorola', - // 'physical_unit': ''} + // 'physical_unit': '%'} Throttlecommand100* set_throttle_pedal_target(double throttle_pedal_target); // config detail: {'name': 'Throttle_EN_CTRL', 'enum': {0: diff --git a/modules/canbus/vehicle/devkit/protocol/throttle_report_500.cc b/modules/canbus/vehicle/devkit/protocol/throttle_report_500.cc index c63eb8d03c..6c2050eba5 100755 --- a/modules/canbus/vehicle/devkit/protocol/throttle_report_500.cc +++ b/modules/canbus/vehicle/devkit/protocol/throttle_report_500.cc @@ -47,7 +47,7 @@ void Throttlereport500::Parse(const std::uint8_t* bytes, int32_t length, // config detail: {'name': 'throttle_pedal_actual', 'offset': 0.0, 'precision': // 0.1, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|100]', 'bit': -// 31, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 31, 'type': 'double', 'order': 'motorola', 'physical_unit': '%'} double Throttlereport500::throttle_pedal_actual(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 3); diff --git a/modules/canbus/vehicle/devkit/protocol/throttle_report_500.h b/modules/canbus/vehicle/devkit/protocol/throttle_report_500.h index 85b91167ed..9842cc0a20 100755 --- a/modules/canbus/vehicle/devkit/protocol/throttle_report_500.h +++ b/modules/canbus/vehicle/devkit/protocol/throttle_report_500.h @@ -35,7 +35,7 @@ class Throttlereport500 : public ::apollo::drivers::canbus::ProtocolData< // config detail: {'name': 'Throttle_Pedal_Actual', 'offset': 0.0, // 'precision': 0.1, 'len': 16, 'is_signed_var': False, 'physical_range': // '[0|100]', 'bit': 31, 'type': 'double', 'order': 'motorola', - // 'physical_unit': ''} + // 'physical_unit': '%'} double throttle_pedal_actual(const std::uint8_t* bytes, const int32_t length) const; diff --git a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_1_507.h b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_1_507.h index 0da718ba05..855cff4ed1 100755 --- a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_1_507.h +++ b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_1_507.h @@ -34,25 +34,25 @@ class Ultrsensor1507 : public ::apollo::drivers::canbus::ProtocolData< private: // config detail: {'name': 'uiUSS9_ToF_Direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss9_tof_direct(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'uiUSS8_ToF_Direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss8_tof_direct(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'uiUSS11_ToF_Direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss11_tof_direct(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'uiUSS10_ToF_Direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss10_tof_direct(const std::uint8_t* bytes, const int32_t length) const; }; diff --git a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_2_508.cc b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_2_508.cc index 2a4bc8d9ae..b33a21d52a 100755 --- a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_2_508.cc +++ b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_2_508.cc @@ -47,7 +47,7 @@ void Ultrsensor2508::Parse(const std::uint8_t* bytes, int32_t length, // config detail: {'name': 'uiuss9_tof_indirect', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', -// 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double Ultrsensor2508::uiuss9_tof_indirect(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 2); @@ -64,7 +64,7 @@ double Ultrsensor2508::uiuss9_tof_indirect(const std::uint8_t* bytes, // config detail: {'name': 'uiuss8_tof_indirect', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', -// 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double Ultrsensor2508::uiuss8_tof_indirect(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 0); @@ -81,7 +81,7 @@ double Ultrsensor2508::uiuss8_tof_indirect(const std::uint8_t* bytes, // config detail: {'name': 'uiuss11_tof_indirect', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', -// 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double Ultrsensor2508::uiuss11_tof_indirect(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 6); @@ -98,7 +98,7 @@ double Ultrsensor2508::uiuss11_tof_indirect(const std::uint8_t* bytes, // config detail: {'name': 'uiuss10_tof_indirect', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', -// 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double Ultrsensor2508::uiuss10_tof_indirect(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 4); diff --git a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_2_508.h b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_2_508.h index c8436a8134..e4b5bb0ebe 100755 --- a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_2_508.h +++ b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_2_508.h @@ -34,25 +34,25 @@ class Ultrsensor2508 : public ::apollo::drivers::canbus::ProtocolData< private: // config detail: {'name': 'uiUSS9_ToF_Indirect', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss9_tof_indirect(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'uiUSS8_ToF_Indirect', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss8_tof_indirect(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'uiUSS11_ToF_Indirect', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss11_tof_indirect(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'uiUSS10_ToF_Indirect', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss10_tof_indirect(const std::uint8_t* bytes, const int32_t length) const; }; diff --git a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_3_509.cc b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_3_509.cc index b72782ace0..bce9999dc9 100755 --- a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_3_509.cc +++ b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_3_509.cc @@ -43,7 +43,7 @@ void Ultrsensor3509::Parse(const std::uint8_t* bytes, int32_t length, // config detail: {'name': 'uiuss5_tof_direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', -// 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double Ultrsensor3509::uiuss5_tof_direct(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 6); @@ -60,7 +60,7 @@ double Ultrsensor3509::uiuss5_tof_direct(const std::uint8_t* bytes, // config detail: {'name': 'uiuss4_tof_direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', -// 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double Ultrsensor3509::uiuss4_tof_direct(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 4); @@ -77,7 +77,7 @@ double Ultrsensor3509::uiuss4_tof_direct(const std::uint8_t* bytes, // config detail: {'name': 'uiuss3_tof_direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', -// 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double Ultrsensor3509::uiuss3_tof_direct(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 2); @@ -94,7 +94,7 @@ double Ultrsensor3509::uiuss3_tof_direct(const std::uint8_t* bytes, // config detail: {'name': 'uiuss2_tof_direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', -// 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double Ultrsensor3509::uiuss2_tof_direct(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 0); diff --git a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_3_509.h b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_3_509.h index 26ed9a09b0..a9143e10a6 100755 --- a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_3_509.h +++ b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_3_509.h @@ -34,25 +34,25 @@ class Ultrsensor3509 : public ::apollo::drivers::canbus::ProtocolData< private: // config detail: {'name': 'uiUSS5_ToF_Direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss5_tof_direct(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'uiUSS4_ToF_Direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss4_tof_direct(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'uiUSS3_ToF_Direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss3_tof_direct(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'uiUSS2_ToF_Direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss2_tof_direct(const std::uint8_t* bytes, const int32_t length) const; }; diff --git a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_4_510.cc b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_4_510.cc index edb5c256c3..a2076547c1 100755 --- a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_4_510.cc +++ b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_4_510.cc @@ -47,7 +47,7 @@ void Ultrsensor4510::Parse(const std::uint8_t* bytes, int32_t length, // config detail: {'name': 'uiuss5_tof_indirect', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', -// 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double Ultrsensor4510::uiuss5_tof_indirect(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 6); @@ -64,7 +64,7 @@ double Ultrsensor4510::uiuss5_tof_indirect(const std::uint8_t* bytes, // config detail: {'name': 'uiuss4_tof_indirect', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', -// 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double Ultrsensor4510::uiuss4_tof_indirect(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 4); @@ -81,7 +81,7 @@ double Ultrsensor4510::uiuss4_tof_indirect(const std::uint8_t* bytes, // config detail: {'name': 'uiuss3_tof_indirect', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', -// 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double Ultrsensor4510::uiuss3_tof_indirect(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 2); @@ -98,7 +98,7 @@ double Ultrsensor4510::uiuss3_tof_indirect(const std::uint8_t* bytes, // config detail: {'name': 'uiuss2_tof_indirect', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', -// 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double Ultrsensor4510::uiuss2_tof_indirect(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 0); diff --git a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_4_510.h b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_4_510.h index 47424e95c7..549fff61be 100755 --- a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_4_510.h +++ b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_4_510.h @@ -34,25 +34,25 @@ class Ultrsensor4510 : public ::apollo::drivers::canbus::ProtocolData< private: // config detail: {'name': 'uiUSS5_ToF_Indirect', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss5_tof_indirect(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'uiUSS4_ToF_Indirect', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss4_tof_indirect(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'uiUSS3_ToF_Indirect', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss3_tof_indirect(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'uiUSS2_ToF_Indirect', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss2_tof_indirect(const std::uint8_t* bytes, const int32_t length) const; }; diff --git a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_5_511.cc b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_5_511.cc index 0c626c63f9..e042ddd78f 100755 --- a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_5_511.cc +++ b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_5_511.cc @@ -43,7 +43,7 @@ void Ultrsensor5511::Parse(const std::uint8_t* bytes, int32_t length, // config detail: {'name': 'uiuss7_tof_direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', -// 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double Ultrsensor5511::uiuss7_tof_direct(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 6); @@ -60,7 +60,7 @@ double Ultrsensor5511::uiuss7_tof_direct(const std::uint8_t* bytes, // config detail: {'name': 'uiuss6_tof_direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', -// 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double Ultrsensor5511::uiuss6_tof_direct(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 4); @@ -77,7 +77,7 @@ double Ultrsensor5511::uiuss6_tof_direct(const std::uint8_t* bytes, // config detail: {'name': 'uiuss1_tof_direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', -// 'bit': 16, 'type': 'double', 'order': 'intel', 'physical_unit': ''} +// 'bit': 16, 'type': 'double', 'order': 'intel', 'physical_unit': 'cm'} double Ultrsensor5511::uiuss1_tof_direct(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 3); @@ -94,7 +94,7 @@ double Ultrsensor5511::uiuss1_tof_direct(const std::uint8_t* bytes, // config detail: {'name': 'uiuss0_tof_direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', -// 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double Ultrsensor5511::uiuss0_tof_direct(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 0); diff --git a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_5_511.h b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_5_511.h index c644198c65..dab59af3bf 100755 --- a/modules/canbus/vehicle/devkit/protocol/ultr_sensor_5_511.h +++ b/modules/canbus/vehicle/devkit/protocol/ultr_sensor_5_511.h @@ -34,25 +34,25 @@ class Ultrsensor5511 : public ::apollo::drivers::canbus::ProtocolData< private: // config detail: {'name': 'uiUSS7_ToF_Direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss7_tof_direct(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'uiUSS6_ToF_Direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss6_tof_direct(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'uiUSS1_ToF_Direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 16, 'type': 'double', 'order': 'intel', 'physical_unit': ''} + // 'bit': 16, 'type': 'double', 'order': 'intel', 'physical_unit': 'cm'} double uiuss1_tof_direct(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'uiUSS0_ToF_Direct', 'offset': 0.0, 'precision': // 0.01724, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', - // 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'bit': 7, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'} double uiuss0_tof_direct(const std::uint8_t* bytes, const int32_t length) const; }; diff --git a/modules/canbus/vehicle/devkit/protocol/vcu_report_505.cc b/modules/canbus/vehicle/devkit/protocol/vcu_report_505.cc index 2584c20734..1f2d2fe6c8 100755 --- a/modules/canbus/vehicle/devkit/protocol/vcu_report_505.cc +++ b/modules/canbus/vehicle/devkit/protocol/vcu_report_505.cc @@ -31,15 +31,83 @@ const int32_t Vcureport505::ID = 0x505; void Vcureport505::Parse(const std::uint8_t* bytes, int32_t length, ChassisDetail* chassis) const { + chassis->mutable_devkit()->mutable_vcu_report_505()->set_vehicle_mode_state( + vehicle_mode_state(bytes, length)); + chassis->mutable_devkit()->mutable_vcu_report_505()->set_frontcrash_state( + frontcrash_state(bytes, length)); + chassis->mutable_devkit()->mutable_vcu_report_505()->set_backcrash_state( + backcrash_state(bytes, length)); + chassis->mutable_devkit()->mutable_vcu_report_505()->set_aeb_state( + aeb_state(bytes, length)); chassis->mutable_devkit()->mutable_vcu_report_505()->set_acc( acc(bytes, length)); chassis->mutable_devkit()->mutable_vcu_report_505()->set_speed( speed(bytes, length)); } +// config detail: {'name': 'vehicle_mode_state', 'enum': {0: +// 'VEHICLE_MODE_STATE_MANUAL_REMOTE_MODE', 1: 'VEHICLE_MODE_STATE_AUTO_MODE', +// 2: 'VEHICLE_MODE_STATE_EMERGENCY_MODE', 3: +// 'VEHICLE_MODE_STATE_STANDBY_MODE'}, 'precision': 1.0, 'len': 2, +// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 36, +// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''} +Vcu_report_505::Vehicle_mode_stateType Vcureport505::vehicle_mode_state( + const std::uint8_t* bytes, int32_t length) const { + Byte t0(bytes + 4); + int32_t x = t0.get_byte(3, 2); + + Vcu_report_505::Vehicle_mode_stateType ret = + static_cast(x); + return ret; +} + +// config detail: {'name': 'frontcrash_state', 'enum': {0: +// 'FRONTCRASH_STATE_NO_EVENT', 1: 'FRONTCRASH_STATE_CRASH_EVENT'}, +// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0, +// 'physical_range': '[0|0]', 'bit': 33, 'type': 'enum', 'order': 'motorola', +// 'physical_unit': ''} +Vcu_report_505::Frontcrash_stateType Vcureport505::frontcrash_state( + const std::uint8_t* bytes, int32_t length) const { + Byte t0(bytes + 4); + int32_t x = t0.get_byte(1, 1); + + Vcu_report_505::Frontcrash_stateType ret = + static_cast(x); + return ret; +} + +// config detail: {'name': 'backcrash_state', 'enum': {0: +// 'BACKCRASH_STATE_NO_EVENT', 1: 'BACKCRASH_STATE_CRASH_EVENT'}, +// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0, +// 'physical_range': '[0|0]', 'bit': 34, 'type': 'enum', 'order': 'motorola', +// 'physical_unit': ''} +Vcu_report_505::Backcrash_stateType Vcureport505::backcrash_state( + const std::uint8_t* bytes, int32_t length) const { + Byte t0(bytes + 4); + int32_t x = t0.get_byte(2, 1); + + Vcu_report_505::Backcrash_stateType ret = + static_cast(x); + return ret; +} + +// config detail: {'name': 'aeb_state', 'enum': {0: 'AEB_STATE_INCTIVE', 1: +// 'AEB_STATE_ACTIVE'}, 'precision': 1.0, 'len': 1, 'is_signed_var': False, +// 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 32, 'type': 'enum', 'order': +// 'motorola', 'physical_unit': ''} +Vcu_report_505::Aeb_stateType Vcureport505::aeb_state(const std::uint8_t* bytes, + int32_t length) const { + Byte t0(bytes + 4); + int32_t x = t0.get_byte(0, 1); + + Vcu_report_505::Aeb_stateType ret = + static_cast(x); + return ret; +} + // config detail: {'name': 'acc', 'offset': 0.0, 'precision': 0.01, 'len': 12, // 'is_signed_var': True, 'physical_range': '[-10|10]', 'bit': 7, 'type': -// 'double', 'order': 'motorola', 'physical_unit': ''} +// 'double', 'order': 'motorola', 'physical_unit': 'm/s^2'} double Vcureport505::acc(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 0); int32_t x = t0.get_byte(0, 8); @@ -58,7 +126,7 @@ double Vcureport505::acc(const std::uint8_t* bytes, int32_t length) const { // config detail: {'name': 'speed', 'offset': 0.0, 'precision': 0.001, 'len': // 16, 'is_signed_var': False, 'physical_range': '[0|65.535]', 'bit': 23, -// 'type': 'double', 'order': 'motorola', 'physical_unit': ''} +// 'type': 'double', 'order': 'motorola', 'physical_unit': 'm/s'} double Vcureport505::speed(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 2); int32_t x = t0.get_byte(0, 8); diff --git a/modules/canbus/vehicle/devkit/protocol/vcu_report_505.h b/modules/canbus/vehicle/devkit/protocol/vcu_report_505.h index 67cb8d8080..8146bb9758 100755 --- a/modules/canbus/vehicle/devkit/protocol/vcu_report_505.h +++ b/modules/canbus/vehicle/devkit/protocol/vcu_report_505.h @@ -32,14 +32,46 @@ class Vcureport505 : public ::apollo::drivers::canbus::ProtocolData< ChassisDetail* chassis) const override; private: + // config detail: {'name': 'Vehicle_Mode_State', 'enum': {0: + // 'VEHICLE_MODE_STATE_MANUAL_REMOTE_MODE', 1: 'VEHICLE_MODE_STATE_AUTO_MODE', + // 2: 'VEHICLE_MODE_STATE_EMERGENCY_MODE', 3: + // 'VEHICLE_MODE_STATE_STANDBY_MODE'}, 'precision': 1.0, 'len': 2, + // 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': + // 36, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''} + Vcu_report_505::Vehicle_mode_stateType vehicle_mode_state( + const std::uint8_t* bytes, const int32_t length) const; + + // config detail: {'name': 'FrontCrash_State', 'enum': {0: + // 'FRONTCRASH_STATE_NO_EVENT', 1: 'FRONTCRASH_STATE_CRASH_EVENT'}, + // 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0, + // 'physical_range': '[0|0]', 'bit': 33, 'type': 'enum', 'order': 'motorola', + // 'physical_unit': ''} + Vcu_report_505::Frontcrash_stateType frontcrash_state( + const std::uint8_t* bytes, const int32_t length) const; + + // config detail: {'name': 'BackCrash_State', 'enum': {0: + // 'BACKCRASH_STATE_NO_EVENT', 1: 'BACKCRASH_STATE_CRASH_EVENT'}, + // 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0, + // 'physical_range': '[0|0]', 'bit': 34, 'type': 'enum', 'order': 'motorola', + // 'physical_unit': ''} + Vcu_report_505::Backcrash_stateType backcrash_state( + const std::uint8_t* bytes, const int32_t length) const; + + // config detail: {'name': 'AEB_State', 'enum': {0: 'AEB_STATE_INCTIVE', 1: + // 'AEB_STATE_ACTIVE'}, 'precision': 1.0, 'len': 1, 'is_signed_var': False, + // 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 32, 'type': 'enum', + // 'order': 'motorola', 'physical_unit': ''} + Vcu_report_505::Aeb_stateType aeb_state(const std::uint8_t* bytes, + const int32_t length) const; + // config detail: {'name': 'ACC', 'offset': 0.0, 'precision': 0.01, 'len': 12, // 'is_signed_var': True, 'physical_range': '[-10|10]', 'bit': 7, 'type': - // 'double', 'order': 'motorola', 'physical_unit': ''} + // 'double', 'order': 'motorola', 'physical_unit': 'm/s^2'} double acc(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'SPEED', 'offset': 0.0, 'precision': 0.001, 'len': // 16, 'is_signed_var': False, 'physical_range': '[0|65.535]', 'bit': 23, - // 'type': 'double', 'order': 'motorola', 'physical_unit': ''} + // 'type': 'double', 'order': 'motorola', 'physical_unit': 'm/s'} double speed(const std::uint8_t* bytes, const int32_t length) const; }; diff --git a/modules/canbus/vehicle/devkit/protocol/vcu_report_505_test.cc b/modules/canbus/vehicle/devkit/protocol/vcu_report_505_test.cc index fec479a1b3..af9497cc1a 100755 --- a/modules/canbus/vehicle/devkit/protocol/vcu_report_505_test.cc +++ b/modules/canbus/vehicle/devkit/protocol/vcu_report_505_test.cc @@ -42,6 +42,10 @@ TEST_F(Vcureport505Test, General) { EXPECT_EQ(data[6], 0b00000100); EXPECT_EQ(data[7], 0b00000101); + EXPECT_EQ(cd.devkit().vcu_report_505().vehicle_mode_state(), 1); + EXPECT_EQ(cd.devkit().vcu_report_505().frontcrash_state(), 1); + EXPECT_EQ(cd.devkit().vcu_report_505().backcrash_state(), 0); + EXPECT_EQ(cd.devkit().vcu_report_505().aeb_state(), 0); EXPECT_EQ(cd.devkit().vcu_report_505().acc(), 1.12); EXPECT_EQ(cd.devkit().vcu_report_505().speed(), 0.258); } diff --git a/modules/canbus/vehicle/devkit/protocol/wheelspeed_report_506.cc b/modules/canbus/vehicle/devkit/protocol/wheelspeed_report_506.cc index 6676c78e05..4801432818 100755 --- a/modules/canbus/vehicle/devkit/protocol/wheelspeed_report_506.cc +++ b/modules/canbus/vehicle/devkit/protocol/wheelspeed_report_506.cc @@ -43,7 +43,7 @@ void Wheelspeedreport506::Parse(const std::uint8_t* bytes, int32_t length, // config detail: {'name': 'rr', 'offset': 0.0, 'precision': 0.001, 'len': 16, // 'is_signed_var': False, 'physical_range': '[0|65.535]', 'bit': 55, 'type': -// 'double', 'order': 'motorola', 'physical_unit': ''} +// 'double', 'order': 'motorola', 'physical_unit': 'm/s'} double Wheelspeedreport506::rr(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 6); @@ -60,7 +60,7 @@ double Wheelspeedreport506::rr(const std::uint8_t* bytes, // config detail: {'name': 'rl', 'offset': 0.0, 'precision': 0.001, 'len': 16, // 'is_signed_var': False, 'physical_range': '[0|65.535]', 'bit': 39, 'type': -// 'double', 'order': 'motorola', 'physical_unit': ''} +// 'double', 'order': 'motorola', 'physical_unit': 'm/s'} double Wheelspeedreport506::rl(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 4); @@ -77,7 +77,7 @@ double Wheelspeedreport506::rl(const std::uint8_t* bytes, // config detail: {'name': 'fr', 'offset': 0.0, 'precision': 0.001, 'len': 16, // 'is_signed_var': False, 'physical_range': '[0|65.535]', 'bit': 23, 'type': -// 'double', 'order': 'motorola', 'physical_unit': ''} +// 'double', 'order': 'motorola', 'physical_unit': 'm/s'} double Wheelspeedreport506::fr(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 2); @@ -94,7 +94,7 @@ double Wheelspeedreport506::fr(const std::uint8_t* bytes, // config detail: {'name': 'fl', 'offset': 0.0, 'precision': 0.001, 'len': 16, // 'is_signed_var': False, 'physical_range': '[0|65.535]', 'bit': 7, 'type': -// 'double', 'order': 'motorola', 'physical_unit': ''} +// 'double', 'order': 'motorola', 'physical_unit': 'm/s'} double Wheelspeedreport506::fl(const std::uint8_t* bytes, int32_t length) const { Byte t0(bytes + 0); diff --git a/modules/canbus/vehicle/devkit/protocol/wheelspeed_report_506.h b/modules/canbus/vehicle/devkit/protocol/wheelspeed_report_506.h index 233e8b00dc..dbc65ebabc 100755 --- a/modules/canbus/vehicle/devkit/protocol/wheelspeed_report_506.h +++ b/modules/canbus/vehicle/devkit/protocol/wheelspeed_report_506.h @@ -34,22 +34,22 @@ class Wheelspeedreport506 : public ::apollo::drivers::canbus::ProtocolData< private: // config detail: {'name': 'RR', 'offset': 0.0, 'precision': 0.001, 'len': 16, // 'is_signed_var': False, 'physical_range': '[0|65.535]', 'bit': 55, 'type': - // 'double', 'order': 'motorola', 'physical_unit': ''} + // 'double', 'order': 'motorola', 'physical_unit': 'm/s'} double rr(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'RL', 'offset': 0.0, 'precision': 0.001, 'len': 16, // 'is_signed_var': False, 'physical_range': '[0|65.535]', 'bit': 39, 'type': - // 'double', 'order': 'motorola', 'physical_unit': ''} + // 'double', 'order': 'motorola', 'physical_unit': 'm/s'} double rl(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'FR', 'offset': 0.0, 'precision': 0.001, 'len': 16, // 'is_signed_var': False, 'physical_range': '[0|65.535]', 'bit': 23, 'type': - // 'double', 'order': 'motorola', 'physical_unit': ''} + // 'double', 'order': 'motorola', 'physical_unit': 'm/s'} double fr(const std::uint8_t* bytes, const int32_t length) const; // config detail: {'name': 'FL', 'offset': 0.0, 'precision': 0.001, 'len': 16, // 'is_signed_var': False, 'physical_range': '[0|65.535]', 'bit': 7, 'type': - // 'double', 'order': 'motorola', 'physical_unit': ''} + // 'double', 'order': 'motorola', 'physical_unit': 'm/s'} double fl(const std::uint8_t* bytes, const int32_t length) const; }; -- GitLab