From 310ea758a319b5d476a6b409d0ae2f317962e516 Mon Sep 17 00:00:00 2001 From: Ruixiang Du Date: Thu, 20 Aug 2020 22:03:11 +0800 Subject: [PATCH 1/2] moved asyncio source files to folder src/asyncio, removed unused variable in scout_base.hpp --- CHANGELOG.md | 4 +++- CMakeLists.txt | 11 +++++------ include/wrp_sdk/platforms/scout/scout_base.hpp | 4 ---- src/{ => asyncio}/async_can.cpp | 0 src/{ => asyncio}/async_serial.cpp | 0 src/{ => asyncio}/asyncio_utils.cpp | 0 src/{ => asyncio}/asyncio_utils.hpp | 0 7 files changed, 8 insertions(+), 11 deletions(-) rename src/{ => asyncio}/async_can.cpp (100%) rename src/{ => asyncio}/async_serial.cpp (100%) rename src/{ => asyncio}/asyncio_utils.cpp (100%) rename src/{ => asyncio}/asyncio_utils.hpp (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3eaba6..bbd763d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,14 @@ ## 0.1.5 (2020-06-17) ------------------- -* Merged multiple small libraries into one "wrpsdk" +* Merged multiple small libraries into one "wrp_sdk" * Changed to "plain" project structure +* Contributors: Ruixiang Du ## 0.1.4 (2020-04-01) ------------------- * Added initial support of Hunter +* Contributors: Ruixiang Du ## 0.1.3 (2019-09-15) ------------------ diff --git a/CMakeLists.txt b/CMakeLists.txt index 090c846..5bc5f09 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,8 @@ project(wrp_sdk VERSION 0.1.5) ## Project Options option(BUILD_TESTS ON) +# set(CMAKE_BUILD_TYPE Release) +# set(CMAKE_BUILD_TYPE Debug) ## Check if pkg is built with ROS catkin if(CATKIN_DEVEL_PREFIX) @@ -35,9 +37,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) ## Chosse build type -# set(CMAKE_BUILD_TYPE Release) -# set(CMAKE_BUILD_TYPE Debug) - set(default_build_type "Release") if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "Setting build type to '${default_build_type}' as none was specified.") @@ -63,9 +62,9 @@ endif() find_package(Threads REQUIRED) add_library(${PROJECT_NAME} - src/async_serial.cpp - src/async_can.cpp - src/asyncio_utils.cpp + src/asyncio/async_serial.cpp + src/asyncio/async_can.cpp + src/asyncio/asyncio_utils.cpp # agilex mobile platforms src/platforms/mobile_base.cpp src/platforms/hunter_base.cpp diff --git a/include/wrp_sdk/platforms/scout/scout_base.hpp b/include/wrp_sdk/platforms/scout/scout_base.hpp index 6ac6a4e..c859e36 100644 --- a/include/wrp_sdk/platforms/scout/scout_base.hpp +++ b/include/wrp_sdk/platforms/scout/scout_base.hpp @@ -48,7 +48,6 @@ class ScoutBase : public MobileBase { uint8_t tx_buffer_[SCOUT_CMD_BUF_LEN]; // cmd/status update related variables - std::thread cmd_thread_; std::mutex scout_state_mutex_; std::mutex motion_cmd_mutex_; std::mutex light_cmd_mutex_; @@ -57,9 +56,6 @@ class ScoutBase : public MobileBase { ScoutMotionCmd current_motion_cmd_; ScoutLightCmd current_light_cmd_; - - - bool light_ctrl_enabled_ = false; bool light_ctrl_requested_ = false; diff --git a/src/async_can.cpp b/src/asyncio/async_can.cpp similarity index 100% rename from src/async_can.cpp rename to src/asyncio/async_can.cpp diff --git a/src/async_serial.cpp b/src/asyncio/async_serial.cpp similarity index 100% rename from src/async_serial.cpp rename to src/asyncio/async_serial.cpp diff --git a/src/asyncio_utils.cpp b/src/asyncio/asyncio_utils.cpp similarity index 100% rename from src/asyncio_utils.cpp rename to src/asyncio/asyncio_utils.cpp diff --git a/src/asyncio_utils.hpp b/src/asyncio/asyncio_utils.hpp similarity index 100% rename from src/asyncio_utils.hpp rename to src/asyncio/asyncio_utils.hpp From 14cee54fe7bd27bbaad54c346695f31a2a47ea22 Mon Sep 17 00:00:00 2001 From: Ruixiang Du Date: Sat, 22 Aug 2020 22:29:24 +0800 Subject: [PATCH 2/2] added cppcheck config --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bc5f09..ad8219c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 3.10.2) +project(wrp_sdk VERSION 0.1.5) find_program(CCACHE_PROGRAM ccache) if(CCACHE_PROGRAM) @@ -6,10 +7,9 @@ if(CCACHE_PROGRAM) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") endif() -project(wrp_sdk VERSION 0.1.5) - ## Project Options option(BUILD_TESTS ON) +option(STATIC_CHECK OFF) # set(CMAKE_BUILD_TYPE Release) # set(CMAKE_BUILD_TYPE Debug) @@ -25,6 +25,14 @@ endif() ## Generate symbols for IDE indexer set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +if(STATIC_CHECK) + find_program(CPPCHECK cppcheck) + if(CPPCHECK) + message(STATUS "Found cppcheck") + set(CMAKE_CXX_CPPCHECK cppcheck;--std=c++11;--enable=all) + endif() +endif() + ## Additional cmake module path set(USER_CMAKE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") list(APPEND CMAKE_MODULE_PATH "${USER_CMAKE_PATH}/modules")