TAMSVIZ
Visualization and annotation tool for ROS
frame.cpp
1 // TAMSVIZ
2 // (c) 2020 Philipp Ruppel
3 
4 #include "frame.h"
5 
6 #include "../core/log.h"
7 #include "../core/transformer.h"
8 #include "../core/workspace.h"
9 
10 void FrameDisplayMixin::renderSyncRecursiveImpl(
11  const RenderSyncContext &context, Display *display, Frame &frame,
12  const Pose &transform) {
13  RenderSyncContext c = context;
14  // LOG_DEBUG("a");
15  if (!frame.empty()) {
16  if (auto transformer = LockScope()->document()->display()->transformer) {
17  if (auto f = frame.pose(transformer)) {
18  c.pose = Eigen::Affine3d(*f);
19  // LOG_DEBUG(c.pose.translation());
20  } else {
21  LOG_WARN_THROTTLE(1, "frame not found: " << frame.name());
22  }
23  } else {
24  LOG_ERROR("no transformer");
25  }
26  }
27  _frame_pose = c.pose;
28  c.pose = c.pose * transform.toIsometry3d();
29  display->renderSync(c);
30  if (auto *group = dynamic_cast<DisplayGroupBase *>(display)) {
31  for (auto &display2 : group->displays()) {
32  display2->renderSyncRecursive(c);
33  }
34  }
35 }
36 
37 std::vector<std::string> FrameDisplay_listFrames(const Property &) {
38  auto ret = LockScope()->document()->display()->transformer->list();
39  std::sort(ret.begin(), ret.end());
40  return ret;
41 }
Definition: document.h:83