From fbd97f9093d12e006f8603ff053d5b9b0332c850 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Thu, 28 Mar 2024 20:10:51 +0900 Subject: [PATCH 01/12] fix(hesai_hw_interface): add error handling * check PTC command error codes, throw exception if necessary * perform size checks before parsing responses * emit errors on too-large payload size --- .../nebula_hw_interfaces_hesai/hesai_cmd_response.hpp | 2 +- .../nebula_hw_interfaces_hesai/hesai_hw_interface.hpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_cmd_response.hpp b/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_cmd_response.hpp index b51ce3b3b..1a5e94776 100644 --- a/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_cmd_response.hpp +++ b/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_cmd_response.hpp @@ -138,7 +138,7 @@ struct HesaiPtpDiagGrandmaster { os << "clockQuality: " << arg.clockQuality; os << ", "; - os << "utc_offset: " << arg.utc_offset; + os << "utc_offset: " << static_cast(arg.utc_offset.value()); os << ", "; os << "time_flags: " << +arg.time_flags; os << ", "; diff --git a/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp b/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp index 668469b2e..35629670e 100644 --- a/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp +++ b/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp @@ -113,6 +113,7 @@ const int PTP_LOG_MIN_DELAY_INTERVAL = 0; const int HESAI_LIDAR_GPS_CLOCK_SOURCE = 0; const int HESAI_LIDAR_PTP_CLOCK_SOURCE = 1; + /// @brief Hardware interface of hesai driver class HesaiHwInterface { From c7cb1cbe237943a881cce7455d3729fb3c41bfe0 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Mon, 8 Apr 2024 15:14:44 +0900 Subject: [PATCH 02/12] fix(hesai_hw_monitor_ros_wrapper): fixed wrong range given for S/N copy --- ros2_socketcan | 1 + transport_drivers | 1 + 2 files changed, 2 insertions(+) create mode 160000 ros2_socketcan create mode 160000 transport_drivers diff --git a/ros2_socketcan b/ros2_socketcan new file mode 160000 index 000000000..4ced5284f --- /dev/null +++ b/ros2_socketcan @@ -0,0 +1 @@ +Subproject commit 4ced5284fdd080274b04530406d887e8330a0cdb diff --git a/transport_drivers b/transport_drivers new file mode 160000 index 000000000..abf8aa8e1 --- /dev/null +++ b/transport_drivers @@ -0,0 +1 @@ +Subproject commit abf8aa8e171f33e0acd6d845c3d795192c964e9c From 3b538060cbca357ef140f1e8d9e1e7bdd340b06a Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Mon, 8 Apr 2024 16:26:42 +0900 Subject: [PATCH 03/12] fix(hesai): print uint8, uint16 as numbers --- .../nebula_hw_interfaces_hesai/hesai_cmd_response.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_cmd_response.hpp b/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_cmd_response.hpp index 1a5e94776..b51ce3b3b 100644 --- a/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_cmd_response.hpp +++ b/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_cmd_response.hpp @@ -138,7 +138,7 @@ struct HesaiPtpDiagGrandmaster { os << "clockQuality: " << arg.clockQuality; os << ", "; - os << "utc_offset: " << static_cast(arg.utc_offset.value()); + os << "utc_offset: " << arg.utc_offset; os << ", "; os << "time_flags: " << +arg.time_flags; os << ", "; From 8b00b4740cb347483af8bb12378d8b620b3d2853 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Tue, 16 Apr 2024 17:57:28 +0900 Subject: [PATCH 04/12] chore: update cspell ignore --- nebula_common/src/velodyne/velodyne_calibration_decoder.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/nebula_common/src/velodyne/velodyne_calibration_decoder.cpp b/nebula_common/src/velodyne/velodyne_calibration_decoder.cpp index d4d69e018..8519be768 100644 --- a/nebula_common/src/velodyne/velodyne_calibration_decoder.cpp +++ b/nebula_common/src/velodyne/velodyne_calibration_decoder.cpp @@ -1,3 +1,4 @@ +// cspell:ignore piyush, fout /** * \author Piyush Khandelwal (piyushk@cs.utexas.edu) * Copyright (C) 2012, Austin Robot Technology, From 87b75e59718f65cd15d7ccb21162677644172d8b Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Thu, 18 Apr 2024 16:40:54 +0900 Subject: [PATCH 05/12] chore(velodyne_calibration_decoder): fix spelling --- nebula_common/src/velodyne/velodyne_calibration_decoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nebula_common/src/velodyne/velodyne_calibration_decoder.cpp b/nebula_common/src/velodyne/velodyne_calibration_decoder.cpp index 8519be768..e60cfa4ad 100644 --- a/nebula_common/src/velodyne/velodyne_calibration_decoder.cpp +++ b/nebula_common/src/velodyne/velodyne_calibration_decoder.cpp @@ -1,5 +1,5 @@ -// cspell:ignore piyush, fout /** + * cspell:ignore piyush, piyushk, fout * \author Piyush Khandelwal (piyushk@cs.utexas.edu) * Copyright (C) 2012, Austin Robot Technology, * The University of Texas at Austin From a3e2355928db516b1adf353a728271d8c9ebb27b Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Thu, 18 Apr 2024 19:30:25 +0900 Subject: [PATCH 06/12] chore(velodyne_calibration_decoder): fix spelling once and for all --- nebula_common/src/velodyne/velodyne_calibration_decoder.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/nebula_common/src/velodyne/velodyne_calibration_decoder.cpp b/nebula_common/src/velodyne/velodyne_calibration_decoder.cpp index e60cfa4ad..d4d69e018 100644 --- a/nebula_common/src/velodyne/velodyne_calibration_decoder.cpp +++ b/nebula_common/src/velodyne/velodyne_calibration_decoder.cpp @@ -1,5 +1,4 @@ /** - * cspell:ignore piyush, piyushk, fout * \author Piyush Khandelwal (piyushk@cs.utexas.edu) * Copyright (C) 2012, Austin Robot Technology, * The University of Texas at Austin From 378f4b220a85849136e19d0f01711cd393e49463 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Mon, 22 Apr 2024 11:30:28 +0900 Subject: [PATCH 07/12] fix(hesai_hw_interface): add missing check for PTC error, make error type more readable --- .../nebula_hw_interfaces_hesai/hesai_hw_interface.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp b/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp index 35629670e..668469b2e 100644 --- a/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp +++ b/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp @@ -113,7 +113,6 @@ const int PTP_LOG_MIN_DELAY_INTERVAL = 0; const int HESAI_LIDAR_GPS_CLOCK_SOURCE = 0; const int HESAI_LIDAR_PTP_CLOCK_SOURCE = 1; - /// @brief Hardware interface of hesai driver class HesaiHwInterface { From b5f06136bea624cf422c2c2560100ce27773e562 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Wed, 24 Apr 2024 18:31:53 +0900 Subject: [PATCH 08/12] feat(hesai): add support for setting hires mode for Pandar128 and OT128 Signed-off-by: Max SCHMELLER --- .../nebula_common/hesai/hesai_common.hpp | 4 ++- .../hesai_hw_interface.hpp | 8 +++++ .../hesai_hw_interface.cpp | 36 +++++++++++++++++++ nebula_ros/launch/nebula_launch.py | 2 ++ nebula_ros/src/hesai/hesai_ros_wrapper.cpp | 5 ++- 5 files changed, 53 insertions(+), 2 deletions(-) diff --git a/nebula_common/include/nebula_common/hesai/hesai_common.hpp b/nebula_common/include/nebula_common/hesai/hesai_common.hpp index 2017bbf4f..8f583018e 100644 --- a/nebula_common/include/nebula_common/hesai/hesai_common.hpp +++ b/nebula_common/include/nebula_common/hesai/hesai_common.hpp @@ -42,6 +42,7 @@ struct HesaiSensorConfiguration : public LidarConfigurationBase uint8_t ptp_domain; PtpTransportType ptp_transport_type; PtpSwitchType ptp_switch_type; + bool hires_mode; }; /// @brief Convert HesaiSensorConfiguration to string (Overloading the << operator) /// @param os @@ -55,7 +56,8 @@ inline std::ostream & operator<<(std::ostream & os, HesaiSensorConfiguration con << ", DualReturnDistanceThreshold:" << arg.dual_return_distance_threshold << ", PtpProfile:" << arg.ptp_profile << ", PtpDomain:" << std::to_string(arg.ptp_domain) << ", PtpTransportType:" << arg.ptp_transport_type - << ", PtpSwitchType:" << arg.ptp_switch_type; + << ", PtpSwitchType:" << arg.ptp_switch_type + << ", HighResolutionMode:" << arg.hires_mode; return os; } diff --git a/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp b/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp index 668469b2e..39be56faa 100644 --- a/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp +++ b/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp @@ -72,6 +72,8 @@ const uint8_t PTC_COMMAND_SET_LIDAR_RANGE = 0x22; const uint8_t PTC_COMMAND_GET_LIDAR_RANGE = 0x23; const uint8_t PTC_COMMAND_SET_PTP_CONFIG = 0x24; const uint8_t PTC_COMMAND_GET_PTP_CONFIG = 0x26; +const uint8_t PTC_COMMAND_SET_HIGH_RESOLUTION_MODE = 0x29; +const uint8_t PTC_COMMAND_GET_HIGH_RESOLUTION_MODE = 0x28; const uint8_t PTC_COMMAND_RESET = 0x25; const uint8_t PTC_COMMAND_SET_ROTATE_DIRECTION = 0x2a; const uint8_t PTC_COMMAND_LIDAR_MONITOR = 0x27; @@ -322,6 +324,12 @@ class HesaiHwInterface /// @brief Getting values with PTC_COMMAND_GET_LIDAR_RANGE /// @return Resulting status HesaiLidarRangeAll GetLidarRange(); + /// @brief Setting values with PTC_COMMAND_GET_HIGH_RESOLUTION_MODE + /// @return Resulting status + Status SetHighResolutionMode(bool enable); + /// @brief Getting values with PTC_COMMAND_GET_HIGH_RESOLUTION_MODE + /// @return Resulting status + bool GetHighResolutionMode(); Status SetClockSource(int clock_source); diff --git a/nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp b/nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp index 4a976f9e6..7c224f3cd 100644 --- a/nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp +++ b/nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp @@ -503,6 +503,26 @@ HesaiLidarRangeAll HesaiHwInterface::GetLidarRange() return hesai_range_all; } +Status HesaiHwInterface::SetHighResolutionMode(bool enable) { + std::vector request_payload; + request_payload.emplace_back(enable ? 0x01 : 0x00); + + auto response_or_err = SendReceive(PTC_COMMAND_SET_HIGH_RESOLUTION_MODE, request_payload); + response_or_err.value_or_throw(PrettyPrintPTCError(response_or_err.error_or({}))); + return Status::OK; +} + +bool HesaiHwInterface::GetHighResolutionMode() { + auto response_or_err = SendReceive(PTC_COMMAND_GET_HIGH_RESOLUTION_MODE); + auto response = response_or_err.value_or_throw(PrettyPrintPTCError(response_or_err.error_or({}))); + + if (response.size() != 1) { + throw std::runtime_error("Unexpected payload size"); + } + + return response[0] > 0x00; +} + Status HesaiHwInterface::SetClockSource(int clock_source) { std::vector request_payload; @@ -924,6 +944,22 @@ HesaiStatus HesaiHwInterface::CheckAndSetConfig( PTP_SYNC_INTERVAL, PTP_LOG_MIN_DELAY_INTERVAL); } + if ( + sensor_configuration->sensor_model == SensorModel::HESAI_PANDAR128_E3X || + sensor_configuration->sensor_model == SensorModel::HESAI_PANDAR128_E4X) { + auto hires_currently_enabled = GetHighResolutionMode(); + + if (hires_currently_enabled != sensor_configuration->hires_mode) { + + PrintInfo("current lidar hires_mode: " + std::to_string(hires_currently_enabled)); + PrintInfo( + "current configuration hires_mode: " + std::to_string(sensor_configuration->hires_mode)); + + PrintInfo("Setting hires_mode via TCP."); + SetHighResolutionMode(sensor_configuration->hires_mode); + } + } + #ifdef WITH_DEBUG_STDOUT_HESAI_HW_INTERFACE std::cout << "End CheckAndSetConfig(HesaiConfig)!!" << std::endl; #endif diff --git a/nebula_ros/launch/nebula_launch.py b/nebula_ros/launch/nebula_launch.py index 6eee53443..2bb234512 100644 --- a/nebula_ros/launch/nebula_launch.py +++ b/nebula_ros/launch/nebula_launch.py @@ -110,6 +110,7 @@ def launch_setup(context, *args, **kwargs): "ptp_domain": LaunchConfiguration("ptp_domain"), "ptp_transport_type": LaunchConfiguration("ptp_transport_type"), "ptp_switch_type": LaunchConfiguration("ptp_switch_type"), + "hires_mode": LaunchConfiguration("hires_mode"), }, ], ), @@ -206,6 +207,7 @@ def add_launch_arg(name: str, default_value=None): add_launch_arg("ptp_domain", "0"), add_launch_arg("ptp_transport_type", "UDP"), add_launch_arg("ptp_switch_type", "TSN"), + add_launch_arg("hires_mode", "false"), ] + [OpaqueFunction(function=launch_setup)] ) diff --git a/nebula_ros/src/hesai/hesai_ros_wrapper.cpp b/nebula_ros/src/hesai/hesai_ros_wrapper.cpp index f7b93cb81..6ec0262a5 100644 --- a/nebula_ros/src/hesai/hesai_ros_wrapper.cpp +++ b/nebula_ros/src/hesai/hesai_ros_wrapper.cpp @@ -1,6 +1,7 @@ // Copyright 2024 TIER IV, Inc. #include "nebula_ros/hesai/hesai_ros_wrapper.hpp" +#include "nebula_ros/common/parameter_descriptors.hpp" #pragma clang diagnostic ignored "-Wbitwise-instead-of-logical" @@ -91,6 +92,7 @@ nebula::Status HesaiRosWrapper::DeclareAndGetSensorConfigParams() config.min_range = declare_parameter("min_range", param_read_write()); config.max_range = declare_parameter("max_range", param_read_write()); config.packet_mtu_size = declare_parameter("packet_mtu_size", param_read_only()); + config.hires_mode = this->declare_parameter("hires_mode", param_read_write()); { rcl_interfaces::msg::ParameterDescriptor descriptor = param_read_write(); @@ -257,7 +259,8 @@ rcl_interfaces::msg::SetParametersResult HesaiRosWrapper::OnParameterChange( get_param(p, "rotation_speed", new_cfg.rotation_speed) | get_param(p, "cloud_min_angle", new_cfg.cloud_min_angle) | get_param(p, "cloud_max_angle", new_cfg.cloud_max_angle) | - get_param(p, "dual_return_distance_threshold", new_cfg.dual_return_distance_threshold); + get_param(p, "dual_return_distance_threshold", new_cfg.dual_return_distance_threshold) | + get_param(p, "hires_mode", new_cfg.hires_mode); // Currently, HW interface and monitor wrappers have only read-only parameters, so their update // logic is not implemented From 4c07b3d1675f35715fcba6ae1219dd5d4aed5566 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Thu, 4 Jul 2024 19:07:37 +0900 Subject: [PATCH 09/12] fix(hesai): add hires_mode to parameter schema --- .../nebula_hw_interfaces_hesai/hesai_hw_interface.hpp | 2 +- nebula_ros/schema/Pandar128E4X.schema.json | 3 +++ nebula_ros/schema/sub/lidar_hesai.json | 5 +++++ nebula_ros/src/hesai/hesai_ros_wrapper.cpp | 9 ++++++++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp b/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp index 39be56faa..e2edfe406 100644 --- a/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp +++ b/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp @@ -324,7 +324,7 @@ class HesaiHwInterface /// @brief Getting values with PTC_COMMAND_GET_LIDAR_RANGE /// @return Resulting status HesaiLidarRangeAll GetLidarRange(); - /// @brief Setting values with PTC_COMMAND_GET_HIGH_RESOLUTION_MODE + /// @brief Setting values with PTC_COMMAND_SET_HIGH_RESOLUTION_MODE /// @return Resulting status Status SetHighResolutionMode(bool enable); /// @brief Getting values with PTC_COMMAND_GET_HIGH_RESOLUTION_MODE diff --git a/nebula_ros/schema/Pandar128E4X.schema.json b/nebula_ros/schema/Pandar128E4X.schema.json index 913d58be0..5e17306cd 100644 --- a/nebula_ros/schema/Pandar128E4X.schema.json +++ b/nebula_ros/schema/Pandar128E4X.schema.json @@ -92,6 +92,9 @@ }, "dual_return_distance_threshold": { "$ref": "sub/misc.json#/definitions/dual_return_distance_threshold" + }, + "hires_mode": { + "$ref": "sub/lidar_hesai.json#/definitions/hires_mode" } }, "required": [ diff --git a/nebula_ros/schema/sub/lidar_hesai.json b/nebula_ros/schema/sub/lidar_hesai.json index ef374da50..5e8de6cad 100644 --- a/nebula_ros/schema/sub/lidar_hesai.json +++ b/nebula_ros/schema/sub/lidar_hesai.json @@ -31,6 +31,11 @@ "minimum": 300, "maximum": 1200, "multipleOf": 60 + }, + "hires_mode": { + "type": "boolean", + "description": "Whether to turn on or off the sensor's high resolution mode", + "default": false } } } diff --git a/nebula_ros/src/hesai/hesai_ros_wrapper.cpp b/nebula_ros/src/hesai/hesai_ros_wrapper.cpp index 6ec0262a5..12fb3db27 100644 --- a/nebula_ros/src/hesai/hesai_ros_wrapper.cpp +++ b/nebula_ros/src/hesai/hesai_ros_wrapper.cpp @@ -1,6 +1,7 @@ // Copyright 2024 TIER IV, Inc. #include "nebula_ros/hesai/hesai_ros_wrapper.hpp" + #include "nebula_ros/common/parameter_descriptors.hpp" #pragma clang diagnostic ignored "-Wbitwise-instead-of-logical" @@ -92,7 +93,13 @@ nebula::Status HesaiRosWrapper::DeclareAndGetSensorConfigParams() config.min_range = declare_parameter("min_range", param_read_write()); config.max_range = declare_parameter("max_range", param_read_write()); config.packet_mtu_size = declare_parameter("packet_mtu_size", param_read_only()); - config.hires_mode = this->declare_parameter("hires_mode", param_read_write()); + + config.hires_mode = false; + if ( + config.sensor_model == drivers::SensorModel::HESAI_PANDAR128_E4X || + config.sensor_model == drivers::SensorModel::HESAI_PANDAR128_E3X) { + config.hires_mode = this->declare_parameter("hires_mode", param_read_write()); + } { rcl_interfaces::msg::ParameterDescriptor descriptor = param_read_write(); From d996e03ea8dddbbf0eac5eddd3b1ee3f5ad4c2c1 Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Thu, 4 Jul 2024 20:38:43 +0900 Subject: [PATCH 10/12] chore: remove erroneously committed dependency directories --- ros2_socketcan | 1 - transport_drivers | 1 - 2 files changed, 2 deletions(-) delete mode 160000 ros2_socketcan delete mode 160000 transport_drivers diff --git a/ros2_socketcan b/ros2_socketcan deleted file mode 160000 index 4ced5284f..000000000 --- a/ros2_socketcan +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4ced5284fdd080274b04530406d887e8330a0cdb diff --git a/transport_drivers b/transport_drivers deleted file mode 160000 index abf8aa8e1..000000000 --- a/transport_drivers +++ /dev/null @@ -1 +0,0 @@ -Subproject commit abf8aa8e171f33e0acd6d845c3d795192c964e9c From 3780cafe2d6bd111c5211464b0f0beca9838ded6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 4 Jul 2024 11:39:59 +0000 Subject: [PATCH 11/12] ci(pre-commit): autofix --- build_depends.repos | 2 +- .../include/nebula_common/hesai/hesai_common.hpp | 3 +-- .../hesai_hw_interface.cpp | 7 ++++--- nebula_ros/launch/continental_launch_all_hw.xml | 2 +- nebula_ros/schema/SRR520.schema.json | 8 ++++++-- nebula_ros/schema/sub/communication.json | 16 +++++++++++++--- 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/build_depends.repos b/build_depends.repos index 8e7351482..6b7e58ff7 100644 --- a/build_depends.repos +++ b/build_depends.repos @@ -8,4 +8,4 @@ repositories: ros2_socketcan: type: git url: https://github.com/knzo25/ros2_socketcan - version: feat/continental_fd \ No newline at end of file + version: feat/continental_fd diff --git a/nebula_common/include/nebula_common/hesai/hesai_common.hpp b/nebula_common/include/nebula_common/hesai/hesai_common.hpp index 8f583018e..9ef149fa9 100644 --- a/nebula_common/include/nebula_common/hesai/hesai_common.hpp +++ b/nebula_common/include/nebula_common/hesai/hesai_common.hpp @@ -55,8 +55,7 @@ inline std::ostream & operator<<(std::ostream & os, HesaiSensorConfiguration con << ", FOV(Start):" << arg.cloud_min_angle << ", FOV(End):" << arg.cloud_max_angle << ", DualReturnDistanceThreshold:" << arg.dual_return_distance_threshold << ", PtpProfile:" << arg.ptp_profile << ", PtpDomain:" << std::to_string(arg.ptp_domain) - << ", PtpTransportType:" << arg.ptp_transport_type - << ", PtpSwitchType:" << arg.ptp_switch_type + << ", PtpTransportType:" << arg.ptp_transport_type << ", PtpSwitchType:" << arg.ptp_switch_type << ", HighResolutionMode:" << arg.hires_mode; return os; } diff --git a/nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp b/nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp index 7c224f3cd..ae3e862e0 100644 --- a/nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp +++ b/nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp @@ -503,7 +503,8 @@ HesaiLidarRangeAll HesaiHwInterface::GetLidarRange() return hesai_range_all; } -Status HesaiHwInterface::SetHighResolutionMode(bool enable) { +Status HesaiHwInterface::SetHighResolutionMode(bool enable) +{ std::vector request_payload; request_payload.emplace_back(enable ? 0x01 : 0x00); @@ -512,7 +513,8 @@ Status HesaiHwInterface::SetHighResolutionMode(bool enable) { return Status::OK; } -bool HesaiHwInterface::GetHighResolutionMode() { +bool HesaiHwInterface::GetHighResolutionMode() +{ auto response_or_err = SendReceive(PTC_COMMAND_GET_HIGH_RESOLUTION_MODE); auto response = response_or_err.value_or_throw(PrettyPrintPTCError(response_or_err.error_or({}))); @@ -950,7 +952,6 @@ HesaiStatus HesaiHwInterface::CheckAndSetConfig( auto hires_currently_enabled = GetHighResolutionMode(); if (hires_currently_enabled != sensor_configuration->hires_mode) { - PrintInfo("current lidar hires_mode: " + std::to_string(hires_currently_enabled)); PrintInfo( "current configuration hires_mode: " + std::to_string(sensor_configuration->hires_mode)); diff --git a/nebula_ros/launch/continental_launch_all_hw.xml b/nebula_ros/launch/continental_launch_all_hw.xml index 9e9ffe421..0255e89f9 100644 --- a/nebula_ros/launch/continental_launch_all_hw.xml +++ b/nebula_ros/launch/continental_launch_all_hw.xml @@ -17,7 +17,7 @@ - + diff --git a/nebula_ros/schema/SRR520.schema.json b/nebula_ros/schema/SRR520.schema.json index 19356adff..0c3004a64 100644 --- a/nebula_ros/schema/SRR520.schema.json +++ b/nebula_ros/schema/SRR520.schema.json @@ -60,10 +60,14 @@ "$ref": "#/definitions/SRR520" } }, - "required": ["ros__parameters"], + "required": [ + "ros__parameters" + ], "additionalProperties": false } }, - "required": ["/**"], + "required": [ + "/**" + ], "additionalProperties": false } diff --git a/nebula_ros/schema/sub/communication.json b/nebula_ros/schema/sub/communication.json index b01c22e06..f7f3b6d86 100644 --- a/nebula_ros/schema/sub/communication.json +++ b/nebula_ros/schema/sub/communication.json @@ -72,7 +72,11 @@ "ptp_profile": { "type": "string", "default": "1588v2", - "enum": ["1588v2", "802.1as", "automotive"], + "enum": [ + "1588v2", + "802.1as", + "automotive" + ], "description": "PTP profile." }, "ptp_domain": { @@ -85,13 +89,19 @@ "ptp_transport_type": { "type": "string", "default": "UDP", - "enum": ["UDP", "L2"], + "enum": [ + "UDP", + "L2" + ], "description": "1588v2 supports 'UDP' or 'L2', other profiles only L2 (HW)." }, "ptp_switch_type": { "type": "string", "default": "TSN", - "enum": ["TSN", "NON_TSN"], + "enum": [ + "TSN", + "NON_TSN" + ], "description": "For automotive profile,'TSN' or 'NON_TSN'." }, "receiver_timeout_sec": { From 0247d39ed434c629bb6570eb1d2e44c17aaaafda Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Thu, 4 Jul 2024 20:50:07 +0900 Subject: [PATCH 12/12] chore(nebula_tests): add copyright --- nebula_tests/continental/parameter_descriptors.cpp | 2 ++ nebula_tests/continental/parameter_descriptors.hpp | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/nebula_tests/continental/parameter_descriptors.cpp b/nebula_tests/continental/parameter_descriptors.cpp index d2d265780..3f26adf10 100644 --- a/nebula_tests/continental/parameter_descriptors.cpp +++ b/nebula_tests/continental/parameter_descriptors.cpp @@ -1,3 +1,5 @@ +// Copyright 2024 TIER IV, Inc. + #include "parameter_descriptors.hpp" namespace nebula diff --git a/nebula_tests/continental/parameter_descriptors.hpp b/nebula_tests/continental/parameter_descriptors.hpp index 6d4e38504..db37cdb10 100644 --- a/nebula_tests/continental/parameter_descriptors.hpp +++ b/nebula_tests/continental/parameter_descriptors.hpp @@ -1,3 +1,17 @@ +// Copyright 2024 TIER IV, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #pragma once #include