Visu.h
Go to the documentation of this file.
1 #pragma once
2 
3 
6 
8 
10 #include <RobotAPI/interface/objectpose/ObjectPoseStorageInterface.h>
13 
14 
15 namespace armarx
16 {
17  class ObjectFinder;
18 }
20 {
21 
22  /**
23  * @brief Models decay of object localizations by decreasing the confidence
24  * the longer the object was not localized.
25  */
26  class Visu : public armarx::Logging
27  {
28  public:
29 
30  void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string& prefix = "visu.");
31 
32  std::vector<viz::Layer> visualizeCommit(
33  const std::map<std::string, objpose::ObjectPoseSeq>& objectPoses,
34  const std::map<std::string, std::vector<std::map<DateTime, objpose::ObjectPose>>>&
35  poseHistories,
36  const ObjectFinder& objectFinder) const;
37 
38  /// Visualize the given object poses, with one layer per provider.
39  std::vector<viz::Layer> visualizeCommit(
40  const objpose::ObjectPoseSeq& objectPoses,
41  const std::vector<std::map<DateTime, objpose::ObjectPose>>& poseHistories,
42  const ObjectFinder& objectFinder
43  ) const;
44  std::vector<viz::Layer> visualizeCommit(
45  const objpose::ObjectPoseMap& objectPoses,
46  const std::map<ObjectID, std::map<DateTime, objpose::ObjectPose>>& poseHistories,
47  const ObjectFinder& objectFinder
48  ) const;
49 
51  const std::string& providerName,
52  const objpose::ObjectPoseSeq& objectPoses,
53  const std::vector<std::map<DateTime, objpose::ObjectPose>>& poseHistories,
54  const ObjectFinder& objectFinder
55  ) const;
56 
57 
59  viz::Layer& layer,
60  const objpose::ObjectPose& objectPose,
61  const std::map<DateTime, objpose::ObjectPose>& poseHistory,
62  const ObjectFinder& objectFinder
63  ) const;
64 
65 
66  private:
67 
68  viz::Layer& getLayer(const std::string& providerName, std::map<std::string, viz::Layer>& stage) const;
69 
70 
71  public:
72 
74 
75  bool enabled = true;
76  float frequencyHz = 25;
77 
78  bool inGlobalFrame = true;
79  float minConfidence = -1;
80  float alpha = 1.0;
81  bool alphaByConfidence = false;
82  bool oobbs = false;
83 
84  bool objectFrames = false;
85  float objectFramesScale = 1.0;
86 
87  struct Gaussians
88  {
89  bool position = true;
90  float positionScale = 1.0;
91  bool orientation = false;
92  float orientationScale = 100;
93  bool orientationDisplaced = false;
94 
95  void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string& prefix);
96 
97  bool showAny() const;
98  void draw(viz::Layer& layer,
99  const objpose::ObjectPose& objectPose,
100  bool inGlobalFrame) const;
101  };
103 
104  /// Prefer articulated models if available.
105  bool useArticulatedModels = true;
106 
107  /// Linear predictions for objects.
109 
111 
112  struct RemoteGui
113  {
115 
117 
122 
125 
126  struct Gaussians
127  {
130 
134 
136 
137  void setup(const Visu& data);
138  void update(Visu::Gaussians& data);
139  };
141 
143 
145 
146  void setup(const Visu& visu);
147  void update(Visu& visu);
148  };
149 
150  };
151 
152 }
armarx::armem::server::obj::instance::Visu::Gaussians::draw
void draw(viz::Layer &layer, const objpose::ObjectPose &objectPose, bool inGlobalFrame) const
Definition: Visu.cpp:258
armarx::armem::server::obj::instance::Visu::useArticulatedModels
bool useArticulatedModels
Prefer articulated models if available.
Definition: Visu.h:105
Client.h
armarx::armem::server::obj::instance::Visu::RemoteGui::objectFrames
armarx::RemoteGui::Client::CheckBox objectFrames
Definition: Visu.h:123
armarx::ObjectID
A known object ID of the form "Dataset/ClassName" or "Dataset/ClassName/InstanceName".
Definition: ObjectID.h:11
armarx::armem::server::obj::instance::Visu::enabled
bool enabled
Definition: Visu.h:75
armarx::armem::server::obj::instance::Visu::RemoteGui
Definition: Visu.h:112
armarx::objpose::ObjectPoseSeq
std::vector< ObjectPose > ObjectPoseSeq
Definition: forward_declarations.h:20
armarx::armem::server::obj::instance::Visu::RemoteGui::Gaussians::update
void update(Visu::Gaussians &data)
Definition: Visu.cpp:414
armarx::armem::server::obj::instance::Visu::RemoteGui::group
armarx::RemoteGui::Client::GroupBox group
Definition: Visu.h:114
LinearPredictionsVisu.h
armarx::armem::server::obj::instance::visu::LinearPredictions::RemoteGui
Definition: LinearPredictionsVisu.h:39
armarx::armem::server::obj::instance::Visu::RemoteGui::Gaussians::positionScale
armarx::RemoteGui::Client::FloatSpinBox positionScale
Definition: Visu.h:129
armarx::armem::server::obj::instance::Visu::RemoteGui::Gaussians::setup
void setup(const Visu &data)
Definition: Visu.cpp:392
armarx::armem::server::obj::instance::Visu::visualizeObjectPose
void visualizeObjectPose(viz::Layer &layer, const objpose::ObjectPose &objectPose, const std::map< DateTime, objpose::ObjectPose > &poseHistory, const ObjectFinder &objectFinder) const
Definition: Visu.cpp:168
armarx::armem::server::obj::instance::Visu::RemoteGui::Gaussians::orientationDisplaced
armarx::RemoteGui::Client::CheckBox orientationDisplaced
Definition: Visu.h:133
armarx::armem::server::obj::instance::Visu::frequencyHz
float frequencyHz
Definition: Visu.h:76
armarx::armem::server::obj::instance::Visu::RemoteGui::linearPredictions
visu::LinearPredictions::RemoteGui linearPredictions
Definition: Visu.h:144
armarx::armem::server::obj::instance::Visu::linearPredictions
visu::LinearPredictions linearPredictions
Linear predictions for objects.
Definition: Visu.h:108
armarx::armem::server::obj::instance
Definition: ArticulatedObjectVisu.cpp:16
armarx::armem::server::obj::instance::Visu::Gaussians
Definition: Visu.h:87
armarx::ObjectFinder
Used to find objects in the ArmarX objects repository [1] (formerly [2]).
Definition: ObjectFinder.h:23
armarx::armem::server::obj::instance::Visu::objectFramesScale
float objectFramesScale
Definition: Visu.h:85
armarx::RemoteGui::Client::FloatSlider
Definition: Widgets.h:107
armarx::armem::server::obj::instance::Visu::minConfidence
float minConfidence
Definition: Visu.h:79
armarx::armem::server::obj::instance::Visu::visualizeCommit
std::vector< viz::Layer > visualizeCommit(const std::map< std::string, objpose::ObjectPoseSeq > &objectPoses, const std::map< std::string, std::vector< std::map< DateTime, objpose::ObjectPose >>> &poseHistories, const ObjectFinder &objectFinder) const
Definition: Visu.cpp:64
armarx::armem::server::obj::instance::Visu::RemoteGui::Gaussians::orientationScale
armarx::RemoteGui::Client::FloatSpinBox orientationScale
Definition: Visu.h:132
armarx::armem::server::obj::instance::Visu::defineProperties
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="visu.")
Definition: Visu.cpp:18
armarx::armem::server::obj::instance::Visu::RemoteGui::inGlobalFrame
armarx::RemoteGui::Client::CheckBox inGlobalFrame
Definition: Visu.h:118
armarx::armem::server::obj::instance::Visu
Models decay of object localizations by decreasing the confidence the longer the object was not local...
Definition: Visu.h:26
armarx::armem::server::obj::instance::Visu::RemoteGui::setup
void setup(const Visu &visu)
Definition: Visu.cpp:326
armarx::armem::server::obj::instance::Visu::alpha
float alpha
Definition: Visu.h:80
armarx::armem::server::obj::instance::Visu::Gaussians::showAny
bool showAny() const
Definition: Visu.cpp:253
armarx::armem::server::obj::instance::Visu::RemoteGui::Gaussians::group
armarx::RemoteGui::Client::GroupBox group
Definition: Visu.h:135
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::armem::server::obj::instance::Visu::RemoteGui::useArticulatedModels
armarx::RemoteGui::Client::CheckBox useArticulatedModels
Definition: Visu.h:142
armarx::armem::server::obj::instance::Visu::RemoteGui::enabled
armarx::RemoteGui::Client::CheckBox enabled
Definition: Visu.h:116
armarx::armem::server::obj::instance::Visu::Gaussians::orientation
bool orientation
Definition: Visu.h:91
armarx::RemoteGui::Client::GroupBox
Definition: Widgets.h:193
ObjectPose.h
armarx::armem::server::obj::instance::Visu::Gaussians::orientationScale
float orientationScale
Definition: Visu.h:92
armarx::armem::server::obj::instance::Visu::RemoteGui::alpha
armarx::RemoteGui::Client::FloatSlider alpha
Definition: Visu.h:119
TaskUtil.h
armarx::armem::server::obj::instance::Visu::RemoteGui::Gaussians::orientation
armarx::RemoteGui::Client::CheckBox orientation
Definition: Visu.h:131
armarx::armem::server::obj::instance::Visu::arviz
viz::Client arviz
Definition: Visu.h:73
armarx::armem::server::obj::instance::Visu::alphaByConfidence
bool alphaByConfidence
Definition: Visu.h:81
armarx::armem::server::obj::instance::Visu::RemoteGui::update
void update(Visu &visu)
Definition: Visu.cpp:425
armarx::Logging
Base Class for all Logging classes.
Definition: Logging.h:232
armarx::armem::server::obj::instance::Visu::Gaussians::orientationDisplaced
bool orientationDisplaced
Definition: Visu.h:93
armarx::armem::server::obj::instance::visu::LinearPredictions
Visualization control for linear predictions for objects.
Definition: LinearPredictionsVisu.h:18
armarx::armem::server::obj::instance::Visu::RemoteGui::Gaussians::position
armarx::RemoteGui::Client::CheckBox position
Definition: Visu.h:128
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::armem::server::obj::instance::Visu::gaussians
Gaussians gaussians
Definition: Visu.h:102
armarx::armem::server::obj::instance::Visu::objectFrames
bool objectFrames
Definition: Visu.h:84
armarx::armem::server::obj::instance::Visu::oobbs
bool oobbs
Definition: Visu.h:82
armarx::RemoteGui::Client::CheckBox
Definition: Widgets.h:129
Widgets.h
armarx::armem::server::obj::instance::Visu::RemoteGui::gaussians
Gaussians gaussians
Definition: Visu.h:140
armarx::armem::server::obj::instance::Visu::RemoteGui::oobbs
armarx::RemoteGui::Client::CheckBox oobbs
Definition: Visu.h:121
armarx::armem::server::obj::instance::Visu::Gaussians::defineProperties
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix)
Definition: Visu.cpp:47
Logging.h
armarx::armem::server::obj::instance::Visu::RemoteGui::Gaussians
Definition: Visu.h:126
armarx::armem::server::obj::instance::Visu::Gaussians::position
bool position
Definition: Visu.h:89
armarx::armem::server::obj::instance::Visu::inGlobalFrame
bool inGlobalFrame
Definition: Visu.h:78
armarx::armem::server::obj::instance::Visu::visualizeProvider
viz::Layer visualizeProvider(const std::string &providerName, const objpose::ObjectPoseSeq &objectPoses, const std::vector< std::map< DateTime, objpose::ObjectPose >> &poseHistories, const ObjectFinder &objectFinder) const
Definition: Visu.cpp:154
armarx::armem::server::obj::instance::Visu::RemoteGui::alphaByConfidence
armarx::RemoteGui::Client::CheckBox alphaByConfidence
Definition: Visu.h:120
armarx::armem::server::obj::instance::Visu::updateTask
SimpleRunningTask ::pointer_type updateTask
Definition: Visu.h:110
armarx::viz::Client
Definition: Client.h:109
armarx::viz::Layer
Definition: Layer.h:12
armarx::RemoteGui::Client::FloatSpinBox
Definition: Widgets.h:93
armarx::armem::server::obj::instance::Visu::RemoteGui::objectFramesScale
armarx::RemoteGui::Client::FloatSpinBox objectFramesScale
Definition: Visu.h:124
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::armem::server::obj::instance::Visu::Gaussians::positionScale
float positionScale
Definition: Visu.h:90
armarx::objpose::ObjectPose
An object pose as stored by the ObjectPoseStorage.
Definition: ObjectPose.h:36
armarx::objpose::ObjectPoseMap
std::map< ObjectID, ObjectPose > ObjectPoseMap
Definition: forward_declarations.h:21