LaserScansMemory.cpp
Go to the documentation of this file.
1/**
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @author Fabian Reister ( fabian dot reister at kit dot edu )
17 * @date 2022
18 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19 * GNU General Public License
20 */
21
22#include "LaserScansMemory.h"
23
24#include <SimoxUtility/algorithm/string.h>
25
28
33#include <RobotAPI/libraries/armem_laser_scans/aron/LaserScan.aron.generated.h>
34
36
38 "LaserScansMemory");
39
41{
43 {
44 addPlugin(virtualRobotReaderPlugin);
45 addPlugin(debugObserver);
46 }
47
50 {
53
54 workingMemory().name() = "LaserScans";
55
56 {
57 const std::string prefix = "";
58 commonVisu.defineProperties(defs, prefix + "visu.");
59 }
60
61 defs->optional(properties_.coreSeg.laserScans.maxHistorySize,
62 "LaserScans.CoreMaxHistorySize",
63 "Max history size of the " + QUOTED("LaserScans") + " core segment.");
64
65 return defs;
66 }
67
68 std::string
70 {
71 return "LaserScansMemory";
72 }
73
74 void
76 {
77 auto& coreSegment = workingMemory().addCoreSegment(
78 "LaserScans", armarx::armem::laser_scans::arondto::LaserScanStamped::ToAronType());
79
80 coreSegment.setMaxHistorySize(properties_.coreSeg.laserScans.maxHistorySize);
81
82 commonVisu.init(&coreSegment, &virtualRobotReaderPlugin->get());
83 }
84
85 void
87 {
88 commonVisu.connect(getArvizClient(), debugObserver->getDebugObserver());
89 commonVisu.connectRemoteGui(this, "Laser Scanner Calibration");
91 }
92
93 void
95 {
96 commonVisu.remoteGuiUpdate();
97 }
98
99 void
103
104 void
108
109 armem::data::AddSegmentsResult
110 LaserScansMemory::addSegments(const armem::data::AddSegmentsInput& input, const Ice::Current&)
111 {
112 // Allowing adding core segments.
113 armem::data::AddSegmentsResult result =
114 ReadWritePluginUser::addSegments(input, addCoreSegmentOnUsage);
115 return result;
116 }
117
118} // namespace armarx::armem::server::laser_scans
#define ARMARX_REGISTER_COMPONENT_EXECUTABLE(ComponentT, applicationName)
Definition Decoupled.h:29
#define QUOTED(x)
armarx::viz::Client & getArvizClient()
Default component property definition container.
Definition Component.h:70
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
PluginT * addPlugin(const std::string prefix="", ParamsT &&... params)
virtual data::AddSegmentsResult addSegments(const data::AddSegmentsInput &input, const Ice::Current &=Ice::emptyCurrent) override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
armem::data::AddSegmentsResult addSegments(const armem::data::AddSegmentsInput &input, const Ice::Current &) override
CoreSegment & addCoreSegment(const std::string &name, Args... args)
void setMaxHistorySize(long maxSize)
Sets the maximum history size of entities in this container.
This file is part of ArmarX.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.