14 params(params), arviz(arviz)
29 std::lock_guard g{paramsMutex};
36 if (trajectory.
poses().size() < 2)
38 ARMARX_WARNING <<
"Unable to visualize path with less than two segments";
58 visualizeTrajectory(trajectory);
74 robotLayer.
add(robotVis);
76 const auto resampledTrajectory = trajectory.
resample(10);
79 const float speedup = 1.0;
83 const auto points = resampledTrajectory.points();
84 for (
size_t i = 0; i < (points.size() - 1); i++)
86 const auto& wp = points.at(i);
87 robotVis.
pose(wp.waypoint.pose.matrix());
89 std::lock_guard<std::mutex> lock(mutex);
90 arviz.
commit({robotLayer});
93 (wp.waypoint.pose.translation() - points.at(i + 1).waypoint.pose.translation())
97 const float velocity = 200;
98 const int dt =
static_cast<int>(speedup *
distance / velocity);
100 std::this_thread::sleep_for(std::chrono::milliseconds(
dt));
107 std::lock_guard<std::mutex> lock(mutex);
108 arviz.
commit({robotLayer});
113 Visualization::asyncHideDelayed()
120 std::lock_guard<std::mutex> lock(mutex);
137 std::lock_guard g{paramsMutex};
146 std::lock_guard<std::mutex> lock(mutex);
156 std::lock_guard g{paramsMutex};
164 std::lock_guard<std::mutex> lock(mutex);
175 std::lock_guard g{paramsMutex};
184 robotVis.
pose(m.matrix());
186 std::lock_guard<std::mutex> lock(mutex);