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 {
39 addPlugin(virtualRobotReaderPlugin);
40 addPlugin(debugObserver);
41 }
42
45 {
48
49 workingMemory().name() = "LaserScans";
50
51 {
52 const std::string prefix = "";
53 commonVisu.defineProperties(defs, prefix + "visu.");
54 }
55
56 defs->optional(properties_.coreSeg.laserScans.maxHistorySize,
57 "LaserScans.CoreMaxHistorySize",
58 "Max history size of the " + QUOTED("LaserScans") + " core segment.");
59
60 return defs;
61 }
62
63 std::string
65 {
66 return "LaserScansMemory";
67 }
68
69 void
71 {
72 auto& coreSegment = workingMemory().addCoreSegment(
73 "LaserScans", armarx::armem::laser_scans::arondto::LaserScanStamped::ToAronType());
74
75 coreSegment.setMaxHistorySize(properties_.coreSeg.laserScans.maxHistorySize);
76
77 commonVisu.init(&coreSegment, &virtualRobotReaderPlugin->get());
78 }
79
80 void
82 {
83 commonVisu.connect(getArvizClient(), debugObserver->getDebugObserver());
84 }
85
86 void
90
91 void
95
96 armem::data::AddSegmentsResult
97 LaserScansMemory::addSegments(const armem::data::AddSegmentsInput& input, const Ice::Current&)
98 {
99 // Allowing adding core segments.
100 armem::data::AddSegmentsResult result =
101 ReadWritePluginUser::addSegments(input, addCoreSegmentOnUsage);
102 return result;
103 }
104
105} // namespace armarx::armem::server::laser_scans
#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.