36 def->topic<PlatformUnitListener>(
"Armar6PlatformUnit",
"PlatformUnitName");
37 def->optional(frequency,
"UpdateFrequency",
"Frequency of updates in Hz");
44 return "SimpleEpisodicMemoryPlatformUnitConnector";
50 timestampLastUpdateInMs_pose(0),
51 updated_target(false),
52 timestampLastUpdateInMs_target(0)
68 &SimpleEpisodicMemoryPlatformUnitConnector::checkAndSendToMemory,
69 (1.0f / frequency * 1000));
70 periodic_task->start();
76 periodic_task->stop();
85 SimpleEpisodicMemoryPlatformUnitConnector::checkAndSendToMemory()
87 std::lock_guard l(platformPose_mutex);
88 std::lock_guard ll(platformTarget_mutex);
89 std::lock_guard lll(platformAcceleration_mutex);
92 std::lock_guard u(updatedMutex_pose);
93 if (updated_pose && timestampLastUpdateInMs_pose != 0)
95 memoryx::PlatformUnitEvent event;
96 event.receivedInMs = timestampLastUpdateInMs_pose;
103 event.acc_rot = acc_rot;
107 updated_pose =
false;
108 timestampLastUpdateInMs_pose = 0;
113 std::lock_guard u(updatedMutex_target);
114 if (updated_target && timestampLastUpdateInMs_target != 0)
116 memoryx::PlatformUnitTargetEvent event;
117 event.receivedInMs = timestampLastUpdateInMs_target;
119 event.target_x = goal_x;
120 event.target_y = goal_y;
121 event.target_rot = goal_rot;
125 updated_target =
false;
126 timestampLastUpdateInMs_target = 0;
135 std::lock_guard l(platformPose_mutex);
136 std::lock_guard u(updatedMutex_pose);
137 double received = IceUtil::Time::now().toMilliSecondsDouble();
140 rot = pose.rotationAroundZ;
142 timestampLastUpdateInMs_pose = received;
151 std::lock_guard l(platformTarget_mutex);
152 std::lock_guard u(updatedMutex_target);
153 double received = IceUtil::Time::now().toMilliSecondsDouble();
157 updated_target =
true;
158 timestampLastUpdateInMs_target = received;
167 std::lock_guard l(platformAcceleration_mutex);
168 std::lock_guard u(updatedMutex_pose);
169 double received = IceUtil::Time::now().toMilliSecondsDouble();
174 timestampLastUpdateInMs_pose = received;
#define ARMARX_REGISTER_COMPONENT_EXECUTABLE(ComponentT, applicationName)
Default component property definition container.
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
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)
The periodic task executes one thread method repeatedly using the time period specified in the constr...
std::string m_simple_episodic_memory_proxy_name
memoryx::SimpleEpisodicMemoryInterface::ProxyType m_simple_episodic_memory
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.