Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add uuid to tesseract_common::JointTrajectory #1055

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -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'

...
5 changes: 3 additions & 2 deletions .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/cmake_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 * * *'

Expand Down
2 changes: 1 addition & 1 deletion .run-clang-format
Original file line number Diff line number Diff line change
@@ -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 {} \;
3 changes: 3 additions & 0 deletions tesseract_common/include/tesseract_common/joint_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <tesseract_common/macros.h>
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <boost/serialization/export.hpp>
#include <boost/serialization/version.hpp>
#include <boost/uuid/uuid.hpp>
#include <Eigen/Core>
#include <vector>
TESSERACT_COMMON_IGNORE_WARNINGS_POP
Expand Down Expand Up @@ -81,6 +83,7 @@ class JointTrajectory
JointTrajectory(std::string description = "");
JointTrajectory(std::vector<JointState> states, std::string description = "");

boost::uuids::uuid uuid{};
std::vector<JointState> states;
std::string description;

Expand Down
4 changes: 4 additions & 0 deletions tesseract_common/src/joint_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/string.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <boost/uuid/uuid_serialize.hpp>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_common/utils.h>
Expand Down Expand Up @@ -77,6 +79,7 @@ JointTrajectory::JointTrajectory(std::vector<JointState> 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;
Expand Down Expand Up @@ -172,6 +175,7 @@ void JointTrajectory::swap(std::vector<value_type>& other) { states.swap(other);
template <class Archive>
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);
}
Expand Down
Loading