StaticAgentReporter.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  * @package RobotComponents::ArmarXObjects::StaticAgentReporter
17  * @author Timothee Habra ( timothee dot habra at uclouvain dot be )
18  * @date 2016
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #include "StaticAgentReporter.h"
24 
26 
27 
28 using namespace armarx;
29 
30 
32 {
33 
34  usingProxy(getProperty<std::string>("RobotStateComponentName").getValue());
35  if (!getProperty<std::string>("WorkingMemoryName").getValue().empty())
36  {
37  usingProxy(getProperty<std::string>("WorkingMemoryName").getValue());
38  }
39 }
40 
41 
43 {
44  robotStateComponent = getProxy<RobotStateComponentInterfacePrx>(getProperty<std::string>("RobotStateComponentName").getValue());
45  robot = RemoteRobot::createLocalCloneFromFile(robotStateComponent, VirtualRobot::RobotIO::RobotDescription::eStructure);
46  if (!getProperty<std::string>("WorkingMemoryName").getValue().empty())
47  {
48  memoryx::WorkingMemoryInterfacePrx workingMemory = getProxy<memoryx::WorkingMemoryInterfacePrx>(getProperty<std::string>("WorkingMemoryName").getValue());
49  agentInstanceSegment = workingMemory->getAgentInstancesSegment();
50 
51  robotAgent = new memoryx::AgentInstance(robotStateComponent->getRobotName());
52  robotAgent->setSharedRobot(robotStateComponent->getSynchronizedRobot());
53  robotAgent->setName(robotStateComponent->getRobotName());
54  robotAgent->setAgentFilePath(robotStateComponent->getRobotFilename());
55  robotAgent->setPose(new FramedPose(Eigen::Matrix4f::Identity(), GlobalFrame, ""));
56 
57  std::string robotAgentId = agentInstanceSegment->upsertEntityByName(robotAgent->getName(), robotAgent);
58  robotAgent->setId(robotAgentId);
59  }
60 }
61 
62 
64 {
65 
66 }
67 
68 
70 {
71 
72 }
73 
75 {
78 }
79 
RemoteRobot.h
armarx::VariantType::FramedPose
const VariantTypeId FramedPose
Definition: FramedPose.h:37
armarx::RemoteRobot::createLocalCloneFromFile
static VirtualRobot::RobotPtr createLocalCloneFromFile(RobotStateComponentInterfacePrx robotStatePrx, VirtualRobot::RobotIO::RobotDescription loadMode=VirtualRobot::RobotIO::eFull)
This is a convenience function for createLocalClone, which automatically gets the filename from the R...
Definition: RemoteRobot.cpp:441
armarx::StaticAgentReporter::onExitComponent
void onExitComponent() override
Definition: StaticAgentReporter.cpp:69
armarx::GlobalFrame
const std::string GlobalFrame
Definition: FramedPose.h:62
armarx::StaticAgentReporter::onConnectComponent
void onConnectComponent() override
Definition: StaticAgentReporter.cpp:42
cxxopts::empty
bool empty(const std::string &s)
Definition: cxxopts.hpp:255
GfxTL::Identity
void Identity(MatrixXX< N, N, T > *a)
Definition: MatrixXX.h:523
armarx::StaticAgentReporter::onDisconnectComponent
void onDisconnectComponent() override
Definition: StaticAgentReporter.cpp:63
StaticAgentReporter.h
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::StaticAgentReporterPropertyDefinitions
Definition: StaticAgentReporter.h:37
memoryx::AgentInstance
Definition: AgentInstance.h:44
armarx::StaticAgentReporter::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: StaticAgentReporter.cpp:74
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:34
armarx::ManagedIceObject::usingProxy
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Definition: ManagedIceObject.cpp:151
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::StaticAgentReporter::onInitComponent
void onInitComponent() override
Definition: StaticAgentReporter.cpp:31