Skip to content

Commit

Permalink
refactor(aeva): create aeva namespace inside connections namespace
Browse files Browse the repository at this point in the history
Signed-off-by: Max SCHMELLER <[email protected]>
  • Loading branch information
mojomex committed Nov 18, 2024
1 parent eed7b31 commit 88823d9
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
namespace nebula::drivers
{

using connections::HealthParser;
using connections::PointcloudParser;
using connections::ReconfigParser;
using connections::TcpSender;
using connections::TcpStream;
using connections::TelemetryParser;
using connections::aeva::HealthParser;
using connections::aeva::PointcloudParser;
using connections::aeva::ReconfigParser;
using connections::aeva::TelemetryParser;
using nlohmann::json;

class AevaHwInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <utility>
#include <vector>

namespace nebula::drivers::connections
namespace nebula::drivers::connections::aeva
{

static const uint16_t g_aeva_header = 0xAEFA;
Expand Down Expand Up @@ -276,4 +276,4 @@ class AevaSender
uint16_t sequence_number_{};
};

} // namespace nebula::drivers::connections
} // namespace nebula::drivers::connections::aeva
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
#include <utility>
#include <vector>

namespace nebula::drivers::connections
namespace nebula::drivers::connections::aeva
{

using aeva::HealthCode;
using drivers::aeva::HealthCode;

class HealthParser : public AevaParser<AevaStreamType::kHealth>
{
Expand Down Expand Up @@ -72,4 +72,4 @@ class HealthParser : public AevaParser<AevaStreamType::kHealth>
callback_t callback_;
};

} // namespace nebula::drivers::connections
} // namespace nebula::drivers::connections::aeva
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <memory>
#include <utility>

namespace nebula::drivers::connections
namespace nebula::drivers::connections::aeva
{

using nebula::drivers::aeva::PointCloudMessage;
Expand Down Expand Up @@ -67,4 +67,4 @@ class PointcloudParser : public AevaParser<AevaStreamType::kSphericalPointCloud>
callback_t callback_;
};

} // namespace nebula::drivers::connections
} // namespace nebula::drivers::connections::aeva
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
#include <utility>
#include <vector>

namespace nebula::drivers::connections
namespace nebula::drivers::connections::aeva
{

using aeva::ReconfigMessage;
using aeva::ReconfigRequestType;
using drivers::aeva::ReconfigMessage;
using drivers::aeva::ReconfigRequestType;
using nlohmann::json;
using namespace std::chrono_literals; // NOLINT

Expand Down Expand Up @@ -269,4 +269,4 @@ class ReconfigParser : public AevaParser<AevaStreamType::kReconfig>,
static const size_t g_n_manifest_responses_expected = 7;
};

} // namespace nebula::drivers::connections
} // namespace nebula::drivers::connections::aeva
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <utility>
#include <vector>

namespace nebula::drivers::connections
namespace nebula::drivers::connections::aeva
{

using nebula::drivers::aeva::TelemetryDataType;
Expand Down Expand Up @@ -121,33 +121,33 @@ class TelemetryParser : public AevaParser<AevaStreamType::kTelemetry>

json value;
switch (type) {
case aeva::TelemetryDataType::kUInt8:
case TelemetryDataType::kUInt8:
value = telemetry_detail::parse_number_array<uint8_t>(
[](const auto * ref) { return *ref; }, entry_data_raw);
break;
case aeva::TelemetryDataType::kInt8:
case TelemetryDataType::kInt8:
value = telemetry_detail::parse_number_array<int8_t>(
[](const auto * ref) { return static_cast<int8_t>(*ref); }, entry_data_raw);
break;
case aeva::TelemetryDataType::kUInt16:
case TelemetryDataType::kUInt16:
value = telemetry_detail::parse_number_array<uint16_t>(&load_little_u16, entry_data_raw);
break;
case aeva::TelemetryDataType::kInt16:
case TelemetryDataType::kInt16:
value = telemetry_detail::parse_number_array<int16_t>(&load_little_s16, entry_data_raw);
break;
case aeva::TelemetryDataType::kUInt32:
case TelemetryDataType::kUInt32:
value = telemetry_detail::parse_number_array<uint32_t>(&load_little_u32, entry_data_raw);
break;
case aeva::TelemetryDataType::kInt32:
case TelemetryDataType::kInt32:
value = telemetry_detail::parse_number_array<int32_t>(&load_little_s32, entry_data_raw);
break;
case aeva::TelemetryDataType::kUInt64:
case TelemetryDataType::kUInt64:
value = telemetry_detail::parse_number_array<uint64_t>(&load_little_u64, entry_data_raw);
break;
case aeva::TelemetryDataType::kInt64:
case TelemetryDataType::kInt64:
value = telemetry_detail::parse_number_array<int64_t>(&load_little_s64, entry_data_raw);
break;
case aeva::TelemetryDataType::kFloat:
case TelemetryDataType::kFloat:
value = telemetry_detail::parse_number_array<float>(
[](const uint8_t * ref) {
auto raw_bytes = load_little_u32(ref);
Expand All @@ -157,7 +157,7 @@ class TelemetryParser : public AevaParser<AevaStreamType::kTelemetry>
},
entry_data_raw);
break;
case aeva::TelemetryDataType::kDouble:
case TelemetryDataType::kDouble:
value = telemetry_detail::parse_number_array<double>(
[](const uint8_t * ref) {
auto raw_bytes = load_little_u64(ref);
Expand All @@ -167,7 +167,7 @@ class TelemetryParser : public AevaParser<AevaStreamType::kTelemetry>
},
entry_data_raw);
break;
case aeva::TelemetryDataType::kChar:
case TelemetryDataType::kChar:
auto overrides = telemetry_detail::g_type_overrides;
bool has_override = std::find(overrides.begin(), overrides.end(), key) != overrides.end();
if (has_override) {
Expand Down Expand Up @@ -204,4 +204,4 @@ class TelemetryParser : public AevaParser<AevaStreamType::kTelemetry>
callback_t callback_;
};

} // namespace nebula::drivers::connections
} // namespace nebula::drivers::connections::aeva
2 changes: 1 addition & 1 deletion nebula_ros/src/aeva/aeva_ros_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
namespace nebula::ros
{
using drivers::AevaAeries2Decoder;
using drivers::PointcloudParser;
using drivers::aeva::Aeries2Config;
using drivers::connections::PointcloudParser;
using nlohmann::json;
using namespace std::chrono_literals; // NOLINT
using AevaPointCloudUniquePtr = AevaAeries2Decoder::AevaPointCloudUniquePtr;
Expand Down
2 changes: 1 addition & 1 deletion nebula_tests/aeva/aeva_hw_interface_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <thread>

using nebula::drivers::aeva::PointCloudMessage;
using nebula::drivers::connections::PointcloudParser;
using nebula::drivers::connections::aeva::PointcloudParser;

TEST(TestParsing, Pointcloud) // NOLINT
{
Expand Down

0 comments on commit 88823d9

Please sign in to comment.