Skip to content

Commit

Permalink
Cleanup JointTrajectorySet and leverage JointTrajectory UUID
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Oct 31, 2024
1 parent 49290cb commit 6afa0c0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
Expand Down
1 change: 0 additions & 1 deletion common/include/tesseract_qt/common/joint_trajectory_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ struct JointTrajectoryInfo
{
JointState joint_state;
JointTrajectory joint_trajectory;
std::string description;

friend class boost::serialization::access;
template <class Archive>
Expand Down
6 changes: 3 additions & 3 deletions common/src/joint_trajectory_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@
namespace tesseract_common
{
template <class Archive>
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<std::string, double>& initial_state,
Expand Down Expand Up @@ -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<std::string> prune_joint_names;
double last_time = traj_info.joint_state.time;
Expand Down
5 changes: 3 additions & 2 deletions joint_trajectory/src/models/joint_trajectory_set_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 6afa0c0

Please sign in to comment.