ArVizDrawer.cpp
Go to the documentation of this file.
1 #include "ArVizDrawer.h"
2 
3 #include <iomanip>
4 #include <sstream>
5 #include <string>
6 
8 
10 {
11 
13  {
14  }
15 
17  {
18  // make sure, the Arviz Ice calls are handled.
19  // {
20  // std::unique_lock g{layerMtx};
21  // g.lock();
22  // }
23  }
24 
25  inline std::string
26  nameWithId(const std::string& name, const int id, const unsigned int idWidth = 6)
27  {
28  std::stringstream ss;
29  ss << name << "_" << std::setw(static_cast<int>(idWidth)) << std::setfill('0') << id;
30  return ss.str();
31  }
32 
33  inline std::string
34  nameWithIds(const std::string& name,
35  const int id,
36  const int subId,
37  const unsigned int idWidth = 6)
38  {
39  std::stringstream ss;
40  ss << name << "_" << std::setw(static_cast<int>(idWidth)) << std::setfill('0') << id << "_"
41  << std::setw(static_cast<int>(idWidth)) << std::setfill('0') << subId;
42  return ss.str();
43  }
44 
45  void
47  {
48  auto layer = arviz.layer("my_layer_name");
49 
50  // TODO: populate layer, e.g.
51  // odomLayer.add(viz::Pose("odom").pose(odomPose.translation() * 1000, odomPose.linear()));
52 
53  arviz.commit(layer);
54  }
55 
56 } // namespace armarx::navigation::components::dynamic_scene_provider
Client.h
armarx::viz::Client::commit
CommitResult commit(StagedCommit const &commit)
Definition: Client.cpp:89
armarx::navigation::components::dynamic_scene_provider::nameWithIds
std::string nameWithIds(const std::string &name, const int id, const int subId, const unsigned int idWidth=6)
Definition: ArVizDrawer.cpp:34
armarx::navigation::components::dynamic_scene_provider::ArVizDrawer::ArVizDrawer
ArVizDrawer(armarx::viz::Client &arviz)
Definition: ArVizDrawer.cpp:12
armarx::navigation::components::dynamic_scene_provider::ArVizDrawer::~ArVizDrawer
virtual ~ArVizDrawer()
Definition: ArVizDrawer.cpp:16
armarx::navigation::components::dynamic_scene_provider
Definition: ArVizDrawer.cpp:9
armarx::navigation::components::dynamic_scene_provider::nameWithId
std::string nameWithId(const std::string &name, const int id, const unsigned int idWidth=6)
Definition: ArVizDrawer.cpp:26
armarx::viz::Client::layer
Layer layer(std::string const &name) const
Definition: Client.cpp:80
armarx::viz::Client
Definition: Client.h:117
ArVizDrawer.h
armarx::navigation::components::dynamic_scene_provider::ArVizDrawer::visualizeFoo
void visualizeFoo()
Definition: ArVizDrawer.cpp:46