From ea11f188229096d314487c9bf840ded15223922d Mon Sep 17 00:00:00 2001 From: Hoop77 <p.badenhoop@gmx.de> Date: Tue, 3 Apr 2018 17:25:40 +0200 Subject: [PATCH] bugfix --- .../PlatoonProtocolLib/include/PlatoonProtocolLib/Protocol.h | 5 ++++- .../PlatoonProtocolLib/include/PlatoonProtocolLib/Vehicle.h | 2 +- modules/catkin_ws/src/PlatoonProtocolLib/src/Vehicle.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/catkin_ws/src/PlatoonProtocolLib/include/PlatoonProtocolLib/Protocol.h b/modules/catkin_ws/src/PlatoonProtocolLib/include/PlatoonProtocolLib/Protocol.h index 3a9478b0..898ce008 100644 --- a/modules/catkin_ws/src/PlatoonProtocolLib/include/PlatoonProtocolLib/Protocol.h +++ b/modules/catkin_ws/src/PlatoonProtocolLib/include/PlatoonProtocolLib/Protocol.h @@ -22,6 +22,9 @@ using InnerPlatoonDistance = float; struct PlatoonConfig { + PlatoonConfig() : platoonSpeed(0.0f), innerPlatoonDistance(0.0f) + {} + PlatoonConfig(PlatoonSpeed platoonSpeed, InnerPlatoonDistance innerPlatoonDistance) : platoonSpeed(platoonSpeed), innerPlatoonDistance(innerPlatoonDistance) {} @@ -35,7 +38,7 @@ bool operator==(const PlatoonConfig & lhs, const PlatoonConfig & rhs) noexcept; bool operator!=(const PlatoonConfig & lhs, const PlatoonConfig & rhs) noexcept; template<typename... Ts> -inline void log(const Ts &... args) +inline void log(const Ts & ... args) { #ifdef PLATOON_PROTOCOL_ENABLE_LOGGING static std::mutex logMutex; diff --git a/modules/catkin_ws/src/PlatoonProtocolLib/include/PlatoonProtocolLib/Vehicle.h b/modules/catkin_ws/src/PlatoonProtocolLib/include/PlatoonProtocolLib/Vehicle.h index 7a76a2b9..b09acea1 100644 --- a/modules/catkin_ws/src/PlatoonProtocolLib/include/PlatoonProtocolLib/Vehicle.h +++ b/modules/catkin_ws/src/PlatoonProtocolLib/include/PlatoonProtocolLib/Vehicle.h @@ -70,7 +70,7 @@ protected: RUNNING_PLATOON }; - static constexpr PlatoonConfig DEFAULT_PLATOON_CONFIG{0.0f, 0.0f}; + static const PlatoonConfig DEFAULT_PLATOON_CONFIG; const VehicleEndpoint ownEndpoint; PlatoonId platoonId; diff --git a/modules/catkin_ws/src/PlatoonProtocolLib/src/Vehicle.cpp b/modules/catkin_ws/src/PlatoonProtocolLib/src/Vehicle.cpp index 4a04156b..5874577b 100644 --- a/modules/catkin_ws/src/PlatoonProtocolLib/src/Vehicle.cpp +++ b/modules/catkin_ws/src/PlatoonProtocolLib/src/Vehicle.cpp @@ -12,7 +12,7 @@ using namespace platoonProtocol; constexpr std::uint16_t Vehicle::UDP_PORT; constexpr std::uint16_t Vehicle::TCP_PORT; -constexpr PlatoonConfig Vehicle::DEFAULT_PLATOON_CONFIG; +const PlatoonConfig Vehicle::DEFAULT_PLATOON_CONFIG{0.0f, 0.0f}; Vehicle::Vehicle(networking::Networking & net, VehicleId ownVehicleId, -- GitLab