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 
27 
32 #include <RobotAPI/libraries/armem_laser_scans/aron/LaserScan.aron.generated.h>
33 
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  return defs;
57  }
58 
59 
60  std::string
62  {
63  return "LaserScansMemory";
64  }
65 
66 
67  void
69  {
70  const auto& coreSegment = workingMemory().addCoreSegment(
71  "LaserScans", armarx::armem::laser_scans::arondto::LaserScanStamped::ToAronType());
72 
73  commonVisu.init(&coreSegment, &virtualRobotReaderPlugin->get());
74  }
75 
76 
77  void
79  {
80  commonVisu.connect(getArvizClient(), debugObserver->getDebugObserver());
81  }
82 
83 
84  void
86  {
87  }
88 
89 
90  void
92  {
93  }
94 
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
armarx::armem::server::laser_scans::LaserScansMemory::onExitComponent
void onExitComponent() override
Definition: LaserScansMemory.cpp:91
armarx::ArVizComponentPluginUser::getArvizClient
armarx::viz::Client & getArvizClient()
Definition: ArVizComponentPlugin.h:45
armarx::armem::server::laser_scans::LaserScansMemory::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: LaserScansMemory.cpp:44
armarx::armem::server::laser_scans::Visu::init
void init(const wm::CoreSegment *coreSegment, armem::robot_state::VirtualRobotReader *virtualRobotReader)
Definition: Visu.cpp:57
armarx::armem::server::laser_scans::LaserScansMemory::onInitComponent
void onInitComponent() override
Definition: LaserScansMemory.cpp:68
armarx::armem::base::MemoryBase::name
std::string & name()
Definition: MemoryBase.h:92
armarx::ManagedIceObject::addPlugin
PluginT * addPlugin(const std::string prefix="", ParamsT &&...params)
Definition: ManagedIceObject.h:182
armarx::armem::server::laser_scans::LaserScansMemory::addSegments
armem::data::AddSegmentsResult addSegments(const armem::data::AddSegmentsInput &input, const Ice::Current &) override
Definition: LaserScansMemory.cpp:97
armarx::armem::server::plugins::ReadWritePluginUser::workingMemory
server::wm::Memory & workingMemory()
Definition: ReadWritePluginUser.cpp:106
armarx::armem::server::laser_scans
This file is part of ArmarX.
Definition: LaserScansMemory.cpp:35
armarx::armem::server::laser_scans::Visu::connect
void connect(const viz::Client &arviz, DebugObserverInterfacePrx debugObserver=nullptr)
Definition: Visu.cpp:65
LaserScansMemory.h
constants.h
armarx::armem::server::laser_scans::LaserScansMemory::LaserScansMemory
LaserScansMemory()
Definition: LaserScansMemory.cpp:37
armarx::DebugObserverHelper::getDebugObserver
const DebugObserverInterfacePrx & getDebugObserver() const
Definition: DebugObserverHelper.cpp:149
armarx::armem::server::laser_scans::Visu::defineProperties
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="visu.")
Definition: Visu.cpp:43
armarx::armem::server::plugins::ReadWritePluginUser::addSegments
virtual data::AddSegmentsResult addSegments(const data::AddSegmentsInput &input, const Ice::Current &=Ice::emptyCurrent) override
Definition: ReadWritePluginUser.cpp:32
MemoryRemoteGui.h
armarx::aron::input
ReaderT::InputType & input
Definition: rw.h:19
error.h
armarx::armem::server::laser_scans::LaserScansMemory::onConnectComponent
void onConnectComponent() override
Definition: LaserScansMemory.cpp:78
armarx::armem::server::laser_scans::LaserScansMemory::getDefaultName
std::string getDefaultName() const override
Definition: LaserScansMemory.cpp:61
armarx::armem::base::MemoryBase::addCoreSegment
CoreSegmentT & addCoreSegment(const std::string &name, aron::type::ObjectPtr coreSegmentType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
Add an empty core segment with the given name, type and prediction engines.
Definition: MemoryBase.h:259
armarx::armem::server::laser_scans::LaserScansMemory::onDisconnectComponent
void onDisconnectComponent() override
Definition: LaserScansMemory.cpp:85
MemoryToIceAdapter.h
armarx::armem::client::plugins::ReaderWriterPlugin::get
T & get()
Definition: ReaderWriterPlugin.h:87
ExpressionException.h
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
IceUtil::Handle< class PropertyDefinitionContainer >