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

refactor(hesai): per-sensor diagnostic struct definitions #208

Merged
merged 30 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
53a1080
fix hesaiconfig ptp
ike-kazu Sep 4, 2024
a621baa
chagnge struct name
ike-kazu Sep 4, 2024
b749342
refactor lidaStatus
ike-kazu Sep 30, 2024
404e8bc
fix lidarstatus tcp
ike-kazu Oct 4, 2024
fa87f94
fix lidarmonitor and some issues
ike-kazu Oct 7, 2024
500f751
fix lidarstatus binary issue
ike-kazu Oct 7, 2024
5e4b1c3
refactor lidarConfig
ike-kazu Oct 7, 2024
5dae1b2
fix any codes
ike-kazu Oct 25, 2024
c6a05d4
fix as review
ike-kazu Oct 25, 2024
004d184
fix reviewd points
ike-kazu Oct 28, 2024
aef3445
fix reviewd point
ike-kazu Oct 28, 2024
3553959
Merge branch 'main' into pr/ike-kazu/208
mojomex Oct 29, 2024
1c1ef45
chore(hesai): reduce log spam
mojomex Oct 29, 2024
9f03782
chore(hesai_cmd_response): make all inheritances public
mojomex Oct 29, 2024
4fb5ff9
fix(hesai): correct sensor get command return logic after merge
mojomex Oct 29, 2024
467c3d0
fix(hesai): add missing diagnostics summary, display strings without …
mojomex Oct 29, 2024
c67ca2c
fix(hesai): fix diagnostics keys being output in the wrong categories
mojomex Oct 29, 2024
9ba0284
feat(hesai): change PTP status to ERROR when not synchronized
mojomex Oct 29, 2024
192d3d6
chore(hesai): remove duplicate config printing
mojomex Oct 29, 2024
cb93cb3
chore(hesai): remove unnecessary print statements
mojomex Oct 29, 2024
5cbbe6b
chore(hesai): lessen log spam, error messages
mojomex Oct 29, 2024
5970b99
fix(hesai): add back support for pandar64
mojomex Oct 30, 2024
7ac77d3
fix(hesai): add back support for QT128
mojomex Oct 30, 2024
c64a9c9
fix(hesai): disable voltage monitor output for sensors that don't sup…
mojomex Oct 30, 2024
a3a50a5
chore(hesai_cmd_response): reduce compiler warnings
mojomex Oct 30, 2024
af70dda
fix(hesai_hw_interface): for sensors we couldn't test, fall back to u…
mojomex Oct 30, 2024
ff84899
chore(hesai_hw_interface): remove temporary cxxabi usage
mojomex Oct 30, 2024
0f7c16e
Merge branch 'main' into feat/fix_hesai_all_ptp
mojomex Nov 5, 2024
b98b2d6
fix(nebula_common): properly add nlohmann_json dependency
mojomex Nov 5, 2024
83a226a
fix(pandar64): add calibration_file to schema
mojomex Nov 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions nebula_common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ project(nebula_common)
find_package(ament_cmake_auto REQUIRED)
find_package(PCL REQUIRED COMPONENTS common)
find_package(yaml-cpp REQUIRED)
find_package(nlohmann_json REQUIRED)

# Default to C++17
if (NOT CMAKE_CXX_STANDARD)
Expand All @@ -28,11 +29,13 @@ include_directories(
SYSTEM
${YAML_CPP_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${NLOHMANN_JSON_INCLUDE_DIRS}
)

link_libraries(
${PCL_LIBRARIES}
${YAML_CPP_LIBRARIES}
${NLOHMANN_JSON_LIBRARIES}
)

add_library(nebula_common SHARED
Expand Down
4 changes: 0 additions & 4 deletions nebula_common/include/nebula_common/hesai/hesai_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,26 +349,22 @@ struct HesaiCorrection : public HesaiCalibrationConfigurationBase
inline nebula::Status save_to_file_from_bytes(
const std::string & correction_file, const std::vector<uint8_t> & buf) override
{
std::cerr << "Saving in: " << correction_file << "\n";
std::ofstream ofs(correction_file, std::ios::trunc | std::ios::binary);
if (!ofs) {
std::cerr << "Could not create file: " << correction_file << "\n";
return Status::CANNOT_SAVE_FILE;
}
std::cerr << "Writing start...." << buf.size() << "\n";
bool sop_received = false;
for (const auto & byte : buf) {
if (!sop_received) {
if (byte == 0xEE) {
std::cerr << "SOP received....\n";
sop_received = true;
}
}
if (sop_received) {
ofs << byte;
}
}
std::cerr << "Closing file\n";
ofs.close();
if (sop_received) return Status::OK;
return Status::INVALID_CALIBRATION_FILE;
Expand Down
18 changes: 18 additions & 0 deletions nebula_common/include/nebula_common/util/string_conversions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#pragma once

#include <nlohmann/json.hpp>

#include <ostream>
#include <sstream>
#include <string>
Expand Down Expand Up @@ -41,4 +43,20 @@
return ss.str();
}

template <size_t N>
std::string to_string(const char value[N])
{
return std::string(value, strnlen(value, N));
}

inline std::string to_string(const nlohmann::ordered_json & j)
{
return j.is_string() ? j.template get<std::string>() : j.dump();

Check warning on line 54 in nebula_common/include/nebula_common/util/string_conversions.hpp

View check run for this annotation

Codecov / codecov/patch

nebula_common/include/nebula_common/util/string_conversions.hpp#L54

Added line #L54 was not covered by tests
}

inline std::string to_string(const nlohmann::json & j)
{
return to_string(nlohmann::ordered_json(j));
}

} // namespace nebula::util
1 change: 1 addition & 0 deletions nebula_common/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<buildtool_depend>ros_environment</buildtool_depend>

<depend>libpcl-all-dev</depend>
<depend>nlohmann-json-dev</depend>
<depend>yaml-cpp</depend>

<test_depend>ament_cmake_gtest</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ class HesaiDecoder : public HesaiScanDecoder
logger_(rclcpp::get_logger("HesaiDecoder"))
{
logger_.set_level(rclcpp::Logger::Level::Debug);
RCLCPP_INFO_STREAM(logger_, *sensor_configuration_);

decode_pc_ = std::make_shared<NebulaPointCloud>();
output_pc_ = std::make_shared<NebulaPointCloud>();
Expand Down
Loading
Loading