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
28using namespace armarx;
29
30void
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
41void
43{
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 =
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
67void
71
72void
76
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
Property< PropertyType > getProperty(const std::string &name)
The FramedPose class.
Definition FramedPose.h:281
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
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...
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
std::string const GlobalFrame
Variable of the global coordinate system.
Definition FramedPose.h:65
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.