Skip to content

Commit

Permalink
Fix typos in SetVelocityVehicle function
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKrug authored Oct 1, 2024
1 parent de9cd6b commit 738e9fe
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,15 +448,15 @@ Status ContinentalARS548HwInterface::SetVelocityVehicle(float velocity_kmh)
constexpr uint8_t VELOCITY_VEHICLE_LENGTH = 28;
const int VELOCITY_VEHICLE_UDP_SIZE = 36;

VelocityVehiclePacket steering_angle_front_axle_packet{};
VelocityVehiclePacket velocity_vehicle_packet{};

Check warning on line 451 in nebula_hw_interfaces/src/nebula_continental_hw_interfaces/continental_ars548_hw_interface.cpp

View check run for this annotation

Codecov / codecov/patch

nebula_hw_interfaces/src/nebula_continental_hw_interfaces/continental_ars548_hw_interface.cpp#L451

Added line #L451 was not covered by tests
static_assert(sizeof(VelocityVehiclePacket) == VELOCITY_VEHICLE_UDP_SIZE);
steering_angle_front_axle_packet.header.service_id = VELOCITY_VEHICLE_SERVICE_ID;
steering_angle_front_axle_packet.header.method_id = VELOCITY_VEHICLE_METHOD_ID;
steering_angle_front_axle_packet.header.length = VELOCITY_VEHICLE_LENGTH;
steering_angle_front_axle_packet.velocity_vehicle = velocity_kmh;
velocity_vehicle_packet.header.service_id = VELOCITY_VEHICLE_SERVICE_ID;
velocity_vehicle_packet.header.method_id = VELOCITY_VEHICLE_METHOD_ID;
velocity_vehicle_packet.header.length = VELOCITY_VEHICLE_LENGTH;
velocity_vehicle_packet.velocity_vehicle = velocity_kmh;

std::vector<uint8_t> send_vector(sizeof(VelocityVehiclePacket));
std::memcpy(send_vector.data(), &steering_angle_front_axle_packet, sizeof(VelocityVehiclePacket));
std::memcpy(send_vector.data(), &velocity_vehicle_packet, sizeof(VelocityVehiclePacket));

if (!sensor_udp_driver_ptr_->sender()->isOpen()) {
return Status::ERROR_1;
Expand Down

0 comments on commit 738e9fe

Please sign in to comment.