Skip to content

Commit

Permalink
Merge pull request #93 from marrts/feat/configurable_trajectory_names
Browse files Browse the repository at this point in the history
Pass description field to trajectory objects
  • Loading branch information
marrts authored Feb 19, 2024
2 parents 9fe4768 + bd74fbe commit 92e208d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tesseract_rosutils/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,8 @@ void toMsg(const tesseract_msgs::msg::EnvironmentState::SharedPtr& state_msg,

void toMsg(tesseract_msgs::msg::JointTrajectory& traj_msg, const tesseract_common::JointTrajectory& traj)
{
traj_msg.description = traj.description;

for (const auto& js : traj)
{
assert(js.joint_names.size() == static_cast<unsigned>(js.position.size()));
Expand Down Expand Up @@ -1752,6 +1754,7 @@ void toMsg(tesseract_msgs::msg::JointTrajectory& traj_msg, const tesseract_commo
tesseract_common::JointTrajectory fromMsg(const tesseract_msgs::msg::JointTrajectory& traj_msg)
{
tesseract_common::JointTrajectory trajectory;
trajectory.description = traj_msg.description;
for (const auto& js_msg : traj_msg.states)
{
assert(js_msg.joint_names.size() == static_cast<unsigned>(js_msg.position.size()));
Expand Down
6 changes: 4 additions & 2 deletions tesseract_rviz/src/joint_trajectory_monitor_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,11 @@ struct JointTrajectoryMonitorProperties::Implementation
{
tesseract_common::JointTrajectory joint_trajectory = tesseract_rosutils::fromMsg(joint_trajectory_msg);
trajectory_set.appendJointTrajectory(joint_trajectory);
tesseract_gui::events::JointTrajectoryAdd event(component_info, trajectory_set);
QApplication::sendEvent(qApp, &event);
}

trajectory_set.setDescription(msg->description);
tesseract_gui::events::JointTrajectoryAdd event(component_info, trajectory_set);
QApplication::sendEvent(qApp, &event);
}
catch (...)
{
Expand Down

0 comments on commit 92e208d

Please sign in to comment.