From c3bcffc8f3c1c92acd3820f87d98a15bb92fd388 Mon Sep 17 00:00:00 2001 From: Arnau Date: Wed, 29 May 2024 08:23:16 +0000 Subject: [PATCH 1/3] Added missing constructor in NavSatStatusData --- .../include/fixposition_driver_lib/msg_data.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/fixposition_driver_lib/include/fixposition_driver_lib/msg_data.hpp b/fixposition_driver_lib/include/fixposition_driver_lib/msg_data.hpp index a4ed53c..20789af 100644 --- a/fixposition_driver_lib/include/fixposition_driver_lib/msg_data.hpp +++ b/fixposition_driver_lib/include/fixposition_driver_lib/msg_data.hpp @@ -117,6 +117,7 @@ struct NavSatStatusData { }; int8_t status; uint16_t service; + NavSatStatusData() : status(static_cast(Status::STATUS_NO_FIX)), service(0) {} }; struct NavSatFixData { From 65626fb026aabe1b319ffe7fc3511c1766b980da Mon Sep 17 00:00:00 2001 From: Arnau Date: Wed, 29 May 2024 08:23:29 +0000 Subject: [PATCH 2/3] fixed static_cast type --- fixposition_driver_lib/src/helper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fixposition_driver_lib/src/helper.cpp b/fixposition_driver_lib/src/helper.cpp index 2543f9b..fecb209 100644 --- a/fixposition_driver_lib/src/helper.cpp +++ b/fixposition_driver_lib/src/helper.cpp @@ -43,14 +43,14 @@ void BestGnssPosToNavSatFix(const Oem7MessageHeaderMem* const header, const BEST switch (static_cast(bestgnsspos->pos_type)) { case PositionOrVelocityType::NARROW_INT: - navsatfix.status.status = static_cast(NavSatStatusData::Status::STATUS_GBAS_FIX); + navsatfix.status.status = static_cast(NavSatStatusData::Status::STATUS_GBAS_FIX); break; case PositionOrVelocityType::NARROW_FLOAT: case PositionOrVelocityType::SINGLE: - navsatfix.status.status = static_cast(NavSatStatusData::Status::STATUS_FIX); + navsatfix.status.status = static_cast(NavSatStatusData::Status::STATUS_FIX); break; default: - navsatfix.status.status = static_cast(NavSatStatusData::Status::STATUS_NO_FIX); + navsatfix.status.status = static_cast(NavSatStatusData::Status::STATUS_NO_FIX); } // TODO hardcoded for now for all 4 systems From 75f109ec65ba32720a0cf0ecfb62582dfe48d2fe Mon Sep 17 00:00:00 2001 From: Arnau Date: Wed, 29 May 2024 08:52:40 +0000 Subject: [PATCH 3/3] build with more warnings --- fixposition_driver_lib/CMakeLists.txt | 3 ++- fixposition_driver_ros1/CMakeLists.txt | 3 ++- fixposition_driver_ros2/CMakeLists.txt | 3 ++- fixposition_odometry_converter_ros1/CMakeLists.txt | 3 ++- fixposition_odometry_converter_ros2/CMakeLists.txt | 7 ++++--- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/fixposition_driver_lib/CMakeLists.txt b/fixposition_driver_lib/CMakeLists.txt index b1b35af..38d134f 100644 --- a/fixposition_driver_lib/CMakeLists.txt +++ b/fixposition_driver_lib/CMakeLists.txt @@ -3,7 +3,8 @@ cmake_minimum_required(VERSION 3.5) project(fixposition_driver_lib VERSION 5.0.0 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 14) set(CMAKE_BUILD_TYPE "Release") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always -Wall -Wextra -Wpedantic -Wno-unused-parameter") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic\ + -Wshadow -Wunused-parameter -Wformat -Wpointer-arith") set(CMAKE_CXX_FLAGS_RELEASE "-O3") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) diff --git a/fixposition_driver_ros1/CMakeLists.txt b/fixposition_driver_ros1/CMakeLists.txt index 408b0d8..b1608b7 100644 --- a/fixposition_driver_ros1/CMakeLists.txt +++ b/fixposition_driver_ros1/CMakeLists.txt @@ -3,7 +3,8 @@ cmake_minimum_required(VERSION 3.5) project(fixposition_driver_ros1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 14) set(CMAKE_BUILD_TYPE "Release") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always -Wall -Wextra -Wpedantic -Wno-unused-parameter") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic\ + -Wshadow -Wunused-parameter -Wformat -Wpointer-arith") set(CMAKE_CXX_FLAGS_RELEASE "-O3") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) diff --git a/fixposition_driver_ros2/CMakeLists.txt b/fixposition_driver_ros2/CMakeLists.txt index f3c0f09..7bf698c 100644 --- a/fixposition_driver_ros2/CMakeLists.txt +++ b/fixposition_driver_ros2/CMakeLists.txt @@ -3,7 +3,8 @@ cmake_minimum_required(VERSION 3.5) project(fixposition_driver_ros2) set(CMAKE_CXX_STANDARD 14) set(CMAKE_BUILD_TYPE "Release") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always -Wall -Wextra -Wpedantic -Wno-unused-parameter") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic\ + -Wshadow -Wunused-parameter -Wformat -Wpointer-arith") set(CMAKE_CXX_FLAGS_RELEASE "-O3") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) diff --git a/fixposition_odometry_converter_ros1/CMakeLists.txt b/fixposition_odometry_converter_ros1/CMakeLists.txt index 9de66b7..2498d69 100644 --- a/fixposition_odometry_converter_ros1/CMakeLists.txt +++ b/fixposition_odometry_converter_ros1/CMakeLists.txt @@ -3,7 +3,8 @@ cmake_minimum_required(VERSION 3.5) project(fixposition_odometry_converter_ros1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 14) set(CMAKE_BUILD_TYPE "Release") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always -Wall -Wextra -Wpedantic -Wno-unused-parameter") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic\ + -Wshadow -Wunused-parameter -Wformat -Wpointer-arith") set(CMAKE_CXX_FLAGS_RELEASE "-O3") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) diff --git a/fixposition_odometry_converter_ros2/CMakeLists.txt b/fixposition_odometry_converter_ros2/CMakeLists.txt index cee1bf0..beaaf2a 100644 --- a/fixposition_odometry_converter_ros2/CMakeLists.txt +++ b/fixposition_odometry_converter_ros2/CMakeLists.txt @@ -3,7 +3,8 @@ cmake_minimum_required(VERSION 3.10.2) project(fixposition_odometry_converter_ros2) set(CMAKE_CXX_STANDARD 14) set(CMAKE_BUILD_TYPE "Release") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always -Wall -Wextra -Wpedantic -Wno-unused-parameter") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic\ + -Wshadow -Wunused-parameter -Wformat -Wpointer-arith") set(CMAKE_CXX_FLAGS_RELEASE "-O3") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -27,7 +28,7 @@ include_directories( ) # BUILD EXECUTABLE ===================================================================================================== -add_library(odom_converter SHARED +add_library(odom_converter SHARED src/params.cpp src/odom_converter_node.cpp) ament_target_dependencies(odom_converter ${PACKAGE_INCLUDE_DEPENDS}) @@ -49,4 +50,4 @@ install(DIRECTORY include DESTINATION . ) -ament_package() \ No newline at end of file +ament_package()