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 void
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 void
43 {
44  robotStateComponent = getProxy<RobotStateComponentInterfacePrx>(
45  getProperty<std::string>("RobotStateComponentName").getValue());
47  robotStateComponent, VirtualRobot::RobotIO::RobotDescription::eStructure);
48  if (!getProperty<std::string>("WorkingMemoryName").getValue().empty())
49  {
50  memoryx::WorkingMemoryInterfacePrx workingMemory =
51  getProxy<memoryx::WorkingMemoryInterfacePrx>(
52  getProperty<std::string>("WorkingMemoryName").getValue());
53  agentInstanceSegment = workingMemory->getAgentInstancesSegment();
54 
55  robotAgent = new memoryx::AgentInstance(robotStateComponent->getRobotName());
56  robotAgent->setSharedRobot(robotStateComponent->getSynchronizedRobot());
57  robotAgent->setName(robotStateComponent->getRobotName());
58  robotAgent->setAgentFilePath(robotStateComponent->getRobotFilename());
59  robotAgent->setPose(new FramedPose(Eigen::Matrix4f::Identity(), GlobalFrame, ""));
60 
61  std::string robotAgentId =
62  agentInstanceSegment->upsertEntityByName(robotAgent->getName(), robotAgent);
63  robotAgent->setId(robotAgentId);
64  }
65 }
66 
67 void
69 {
70 }
71 
72 void
74 {
75 }
76 
79 {
82 }
RemoteRobot.h
armarx::VariantType::FramedPose
const VariantTypeId FramedPose
Definition: FramedPose.h:36
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:512
armarx::StaticAgentReporter::onExitComponent
void onExitComponent() override
Definition: StaticAgentReporter.cpp:73
armarx::GlobalFrame
const std::string GlobalFrame
Definition: FramedPose.h:65
armarx::StaticAgentReporter::onConnectComponent
void onConnectComponent() override
Definition: StaticAgentReporter.cpp:42
cxxopts::empty
bool empty(const std::string &s)
Definition: cxxopts.hpp:234
GfxTL::Identity
void Identity(MatrixXX< N, N, T > *a)
Definition: MatrixXX.h:570
armarx::StaticAgentReporter::onDisconnectComponent
void onDisconnectComponent() override
Definition: StaticAgentReporter.cpp:68
StaticAgentReporter.h
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:79
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::StaticAgentReporterPropertyDefinitions
Definition: StaticAgentReporter.h:37
memoryx::AgentInstance
Definition: AgentInstance.h:45
armarx::StaticAgentReporter::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: StaticAgentReporter.cpp:78
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:35
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:154
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::StaticAgentReporter::onInitComponent
void onInitComponent() override
Definition: StaticAgentReporter.cpp:31