diff --git a/.clang-format b/.clang-format index ee5cc2929cd..1860526f5f2 100644 --- a/.clang-format +++ b/.clang-format @@ -52,16 +52,17 @@ UseTab: Never BreakBeforeBraces: Custom # Control of individual brace wrapping cases -BraceWrapping: { - AfterClass: 'true', - AfterControlStatement: 'true', - AfterEnum : 'true', - AfterFunction : 'true', - AfterNamespace : 'true', - AfterStruct : 'true', - AfterUnion : 'true', - BeforeCatch : 'true', - BeforeElse : 'true', - IndentBraces : 'false', -} +BraceWrapping: + AfterCaseLabel : 'true' + AfterClass: 'true' + AfterControlStatement: 'true' + AfterEnum : 'true' + AfterFunction : 'true' + AfterNamespace : 'true' + AfterStruct : 'true' + AfterUnion : 'true' + BeforeCatch : 'true' + BeforeElse : 'true' + IndentBraces : 'false' + ... diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index 089a88125fc..4a11112d563 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -15,16 +15,17 @@ on: jobs: clang_format: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v1 - name: Run clang format run: | sudo apt update - sudo apt install -y git clang-format-8 + sudo apt install -y git clang-format-12 if [ $? -ge 1 ]; then return 1; fi ./.run-clang-format if [ $? -ge 1 ]; then return 1; fi output=$(git diff) + echo $output if [ -n "$output" ]; then exit 1; else exit 0; fi diff --git a/.github/workflows/cmake_format.yml b/.github/workflows/cmake_format.yml index 501fbcbdf12..e2167fb9c89 100644 --- a/.github/workflows/cmake_format.yml +++ b/.github/workflows/cmake_format.yml @@ -8,8 +8,8 @@ on: pull_request: paths: - 'tesseract**' - - '.github/workflows/clang_format.yml' - - '**clang-format' + - '.github/workflows/cmake_format.yml' + - '**cmake-format' schedule: - cron: '0 5 * * *' diff --git a/.run-clang-format b/.run-clang-format index 47ce0c0406d..68fc043dc6b 100755 --- a/.run-clang-format +++ b/.run-clang-format @@ -1,2 +1,2 @@ #!/bin/bash -find . -type d \( -name bullet3_ros -o -name fcl_ros -o -name libccd_ros -o -name gtest_ros -o -name tesseract_ext \) -prune -o -type f -regex '.*\.\(cpp\|hpp\|cc\|cxx\|h\|hxx\)' -exec clang-format-8 -style=file -i {} \; +find . -type d \( -name bullet3_ros -o -name fcl_ros -o -name libccd_ros -o -name gtest_ros -o -name tesseract_ext \) -prune -o -type f -regex '.*\.\(cpp\|hpp\|cc\|cxx\|h\|hxx\)' -exec clang-format-12 -style=file -i {} \; diff --git a/tesseract_common/include/tesseract_common/joint_state.h b/tesseract_common/include/tesseract_common/joint_state.h index be93f2bf715..9b49981140e 100644 --- a/tesseract_common/include/tesseract_common/joint_state.h +++ b/tesseract_common/include/tesseract_common/joint_state.h @@ -29,6 +29,8 @@ #include TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include +#include +#include #include #include TESSERACT_COMMON_IGNORE_WARNINGS_POP @@ -81,6 +83,7 @@ class JointTrajectory JointTrajectory(std::string description = ""); JointTrajectory(std::vector states, std::string description = ""); + boost::uuids::uuid uuid{}; std::vector states; std::string description; diff --git a/tesseract_common/src/joint_state.cpp b/tesseract_common/src/joint_state.cpp index 4d450392291..6cc6b7812ec 100644 --- a/tesseract_common/src/joint_state.cpp +++ b/tesseract_common/src/joint_state.cpp @@ -29,6 +29,8 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include #include #include +#include +#include TESSERACT_COMMON_IGNORE_WARNINGS_POP #include @@ -77,6 +79,7 @@ JointTrajectory::JointTrajectory(std::vector states, std::string des bool JointTrajectory::operator==(const JointTrajectory& other) const { bool ret_val = true; + ret_val &= (uuid == other.uuid); ret_val &= (description == other.description); ret_val &= (states == other.states); return ret_val; @@ -172,6 +175,7 @@ void JointTrajectory::swap(std::vector& other) { states.swap(other); template void JointTrajectory::serialize(Archive& ar, const unsigned int version) // NOLINT { + ar& BOOST_SERIALIZATION_NVP(uuid); ar& BOOST_SERIALIZATION_NVP(states); ar& BOOST_SERIALIZATION_NVP(description); }