ArVizDrawer.cpp
Go to the documentation of this file.
1
#include "
ArVizDrawer.h
"
2
3
#include <iomanip>
4
#include <sstream>
5
6
#include <
ArmarXCore/core/logging/Logging.h
>
7
8
9
#include <
RobotAPI/components/ArViz/Client/Client.h
>
10
#include <
RobotAPI/components/ArViz/Client/Elements.h
>
11
#include <
RobotAPI/components/ArViz/Client/Layer.h
>
12
#include <
RobotAPI/components/ArViz/Client/elements/Color.h
>
13
#include <
RobotAPI/components/ArViz/Client/elements/Mesh.h
>
14
#include <
RobotAPI/components/ArViz/Client/elements/PointCloud.h
>
15
16
namespace
armarx::navigation::components::dynamic_scene_provider
17
{
18
19
ArVizDrawer::ArVizDrawer
(
armarx::viz::Client
& arviz) :
20
arviz(arviz)
21
{
22
}
23
24
ArVizDrawer::~ArVizDrawer
()
25
{
26
// make sure, the Arviz Ice calls are handled.
27
// {
28
// std::unique_lock g{layerMtx};
29
// g.lock();
30
// }
31
}
32
33
inline
std::string
34
nameWithId
(
const
std::string& name,
const
int
id
,
const
unsigned
int
idWidth = 6)
35
{
36
std::stringstream ss;
37
ss << name <<
"_"
<< std::setw(
static_cast<
int
>
(idWidth)) << std::setfill(
'0'
) << id;
38
return
ss.str();
39
}
40
41
inline
std::string
nameWithIds
(
const
std::string& name,
42
const
int
id
,
43
const
int
subId,
44
const
unsigned
int
idWidth = 6)
45
{
46
std::stringstream ss;
47
ss << name <<
"_"
<< std::setw(
static_cast<
int
>
(idWidth)) << std::setfill(
'0'
) <<
id
<<
"_"
48
<< std::setw(
static_cast<
int
>
(idWidth)) << std::setfill(
'0'
) << subId;
49
return
ss.str();
50
}
51
52
void
ArVizDrawer::visualizeFoo
()
53
{
54
auto
layer = arviz.
layer
(
"my_layer_name"
);
55
56
// TODO: populate layer, e.g.
57
// odomLayer.add(viz::Pose("odom").pose(odomPose.translation() * 1000, odomPose.linear()));
58
59
arviz.
commit
(layer);
60
}
61
62
}
// namespace armarx::navigation::components::dynamic_scene_provider
Client.h
armarx::viz::Client::commit
CommitResult commit(StagedCommit const &commit)
Definition:
Client.cpp:80
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:41
Layer.h
armarx::navigation::components::dynamic_scene_provider::ArVizDrawer::ArVizDrawer
ArVizDrawer(armarx::viz::Client &arviz)
Definition:
ArVizDrawer.cpp:19
Elements.h
Color.h
armarx::navigation::components::dynamic_scene_provider::ArVizDrawer::~ArVizDrawer
virtual ~ArVizDrawer()
Definition:
ArVizDrawer.cpp:24
armarx::navigation::components::dynamic_scene_provider
Definition:
ArVizDrawer.cpp:16
Mesh.h
Logging.h
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:34
armarx::viz::Client::layer
Layer layer(std::string const &name) const
Definition:
Client.cpp:73
armarx::viz::Client
Definition:
Client.h:109
ArVizDrawer.h
PointCloud.h
armarx::navigation::components::dynamic_scene_provider::ArVizDrawer::visualizeFoo
void visualizeFoo()
Definition:
ArVizDrawer.cpp:52
armarx
navigation
components
dynamic_scene_provider
ArVizDrawer.cpp
Generated on Sat Oct 12 2024 09:14:04 for armarx_documentation by
1.8.17