ArVizDrawer.cpp
Go to the documentation of this file.
1
#include "
ArVizDrawer.h
"
2
3
#include <iomanip>
4
#include <sstream>
5
#include <string>
6
7
#include <
RobotAPI/components/ArViz/Client/Client.h
>
8
9
namespace
armarx::navigation::components::dynamic_scene_provider
10
{
11
12
ArVizDrawer::ArVizDrawer
(
armarx::viz::Client
& arviz) : arviz(arviz)
13
{
14
}
15
16
ArVizDrawer::~ArVizDrawer
()
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
46
ArVizDrawer::visualizeFoo
()
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
armarx
navigation
components
dynamic_scene_provider
ArVizDrawer.cpp
Generated on Sat Mar 29 2025 09:17:23 for armarx_documentation by
1.8.17