From 213dc4ce5d62be23941660dd317177f3cdc604cc Mon Sep 17 00:00:00 2001 From: Levi Armstrong Date: Thu, 31 Oct 2024 09:21:51 -0500 Subject: [PATCH] Cleanup JointTrajectorySet and leverage JointTrajectory UUID --- .clang-format | 1 - common/include/tesseract_qt/common/joint_trajectory_set.h | 1 - common/src/joint_trajectory_set.cpp | 6 +++--- joint_trajectory/src/models/joint_trajectory_set_item.cpp | 5 +++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.clang-format b/.clang-format index 2c82a0a3..20737c63 100644 --- a/.clang-format +++ b/.clang-format @@ -8,7 +8,6 @@ AllowAllParametersOfDeclarationOnNextLine: false AllowShortFunctionsOnASingleLine: true AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false -AllowShortLoopsOnASingleLine: false AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: true BinPackArguments: false diff --git a/common/include/tesseract_qt/common/joint_trajectory_set.h b/common/include/tesseract_qt/common/joint_trajectory_set.h index a82b72b5..e667ede4 100644 --- a/common/include/tesseract_qt/common/joint_trajectory_set.h +++ b/common/include/tesseract_qt/common/joint_trajectory_set.h @@ -42,7 +42,6 @@ struct JointTrajectoryInfo { JointState joint_state; JointTrajectory joint_trajectory; - std::string description; friend class boost::serialization::access; template diff --git a/common/src/joint_trajectory_set.cpp b/common/src/joint_trajectory_set.cpp index 8406ee62..8a750dba 100644 --- a/common/src/joint_trajectory_set.cpp +++ b/common/src/joint_trajectory_set.cpp @@ -46,11 +46,10 @@ namespace tesseract_common { template -void JointTrajectoryInfo::serialize(Archive& ar, const unsigned int /*version*/) +void JointTrajectoryInfo::serialize(Archive& ar, const unsigned int version) { ar& BOOST_SERIALIZATION_NVP(joint_state); ar& BOOST_SERIALIZATION_NVP(joint_trajectory); - ar& BOOST_SERIALIZATION_NVP(description); } JointTrajectorySet::JointTrajectorySet(const std::unordered_map& initial_state, @@ -143,7 +142,8 @@ void JointTrajectorySet::appendJointTrajectory(const JointTrajectory& joint_traj JointTrajectoryInfo traj_info; traj_info.joint_state = getNewTrajectoryInitialState(); traj_info.joint_trajectory.reserve(joint_trajectory.size()); - traj_info.description = joint_trajectory.description; + traj_info.joint_trajectory.uuid = joint_trajectory.uuid; + traj_info.joint_trajectory.description = joint_trajectory.description; std::set prune_joint_names; double last_time = traj_info.joint_state.time; diff --git a/joint_trajectory/src/models/joint_trajectory_set_item.cpp b/joint_trajectory/src/models/joint_trajectory_set_item.cpp index 4a34acef..1ee80b9a 100644 --- a/joint_trajectory/src/models/joint_trajectory_set_item.cpp +++ b/joint_trajectory/src/models/joint_trajectory_set_item.cpp @@ -59,8 +59,9 @@ void JointTrajectorySetItem::ctor() for (std::size_t i = 0; i < trajectory_set.size(); ++i) { auto& traj_info = trajectory_set[i]; - QString description = traj_info.description.empty() ? QString("trajectory[%1]").arg(i) : - QString::fromStdString(traj_info.description); + QString description = traj_info.joint_trajectory.description.empty() ? + QString("trajectory[%1]").arg(i) : + QString::fromStdString(traj_info.joint_trajectory.description); QStandardItem* trajectory_item = new JointTrajectoryInfoItem(description, traj_info); appendRow(trajectory_item); }