Visualization.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <atomic>
4
#include <mutex>
5
6
#include <Eigen/Core>
7
#include <
ArmarXCore/core/PackagePath.h
>
8
9
#include <
RobotAPI/components/ArViz/Client/Client.h
>
10
#include <
RobotAPI/components/ArViz/Client/ScopedClient.h
>
11
12
#include <
armarx/navigation/core/Trajectory.h
>
13
#include <
armarx/navigation/core/basic_types.h
>
14
15
namespace
armarx::navigation::util
16
{
17
18
class
Visualization
19
{
20
21
public
:
22
struct
Params
23
{
24
armarx::PackagePath
robotModelFileName
;
25
26
bool
enableVisualization
=
true
;
27
bool
enableTrajectoryVisualization
=
false
;
28
29
int
hideDelaySeconds
= 2;
// [s]
30
31
int
alphaValue
= 30;
32
};
33
34
Visualization
(
armarx::viz::Client
& arviz,
const
Params
& params);
35
36
Visualization
(
Visualization
&& other) noexcept :
37
params(std::move(other.params)), arviz(other.arviz), robotVis(other.robotVis)
38
{
39
}
40
41
42
void
setTarget
(
const
core::Pose
& m);
43
44
void
success
();
45
void
failed
();
46
47
48
void
visualize
(
const
core::GlobalTrajectory
& trajectory);
49
50
void
51
updateParams
(
const
Params
& params)
52
{
53
std::lock_guard g{paramsMutex};
54
this->params = params;
55
}
56
57
private
:
58
void
visualizeTrajectory(
const
core::GlobalTrajectory
& trajectory);
59
60
void
asyncHideDelayed();
61
62
std::atomic<std::int64_t> lastUpdate = 0;
63
64
// Params
65
std::mutex paramsMutex;
66
Params params;
67
68
// ArViz
69
std::mutex mutex;
70
armarx::viz::ScopedClient
arviz;
71
72
viz::Robot
robotVis{
""
};
73
};
74
75
}
// namespace armarx::navigation::util
Client.h
armarx::navigation::core::GlobalTrajectory
Definition:
Trajectory.h:68
armarx::navigation::util::Visualization::failed
void failed()
Definition:
Visualization.cpp:153
armarx::navigation::util::Visualization::Params::alphaValue
int alphaValue
Definition:
Visualization.h:31
armarx::navigation::util
This file is part of ArmarX.
Definition:
geometry.cpp:8
armarx::navigation::core::Pose
Eigen::Isometry3f Pose
Definition:
basic_types.h:31
basic_types.h
ScopedClient.h
armarx::viz::ScopedClient
viz::Client that will delete (clear) committed layers when destroyed.
Definition:
ScopedClient.h:42
armarx::navigation::util::Visualization::updateParams
void updateParams(const Params ¶ms)
Definition:
Visualization.h:51
armarx::navigation::util::Visualization::visualize
void visualize(const core::GlobalTrajectory &trajectory)
Definition:
Visualization.cpp:26
armarx::navigation::util::Visualization::setTarget
void setTarget(const core::Pose &m)
Definition:
Visualization.cpp:172
armarx::navigation::util::Visualization
Definition:
Visualization.h:18
armarx::navigation::util::Visualization::Visualization
Visualization(Visualization &&other) noexcept
Definition:
Visualization.h:36
armarx::navigation::util::Visualization::Params::hideDelaySeconds
int hideDelaySeconds
Definition:
Visualization.h:29
armarx::viz::Robot
Definition:
Robot.h:10
armarx::navigation::util::Visualization::Visualization
Visualization(armarx::viz::Client &arviz, const Params ¶ms)
Definition:
Visualization.cpp:13
armarx::navigation::util::Visualization::Params::enableTrajectoryVisualization
bool enableTrajectoryVisualization
Definition:
Visualization.h:27
armarx::navigation::util::Visualization::Params
Definition:
Visualization.h:22
Trajectory.h
armarx::viz::Client
Definition:
Client.h:109
armarx::PackagePath
Definition:
PackagePath.h:55
armarx::navigation::util::Visualization::Params::robotModelFileName
armarx::PackagePath robotModelFileName
Definition:
Visualization.h:24
armarx::navigation::util::Visualization::Params::enableVisualization
bool enableVisualization
Definition:
Visualization.h:26
armarx::navigation::util::Visualization::success
void success()
Definition:
Visualization.cpp:134
PackagePath.h
armarx
navigation
util
Visualization.h
Generated on Sat Oct 12 2024 09:14:18 for armarx_documentation by
1.8.17