34 def->topic<PlatformUnitListener>(
"Armar6PlatformUnit",
"PlatformUnitName");
35 def->optional(frequency,
"UpdateFrequency",
"Frequency of updates in Hz");
42 return "SimpleEpisodicMemoryPlatformUnitConnector";
48 timestampLastUpdateInMs_pose(0),
49 updated_target(false),
50 timestampLastUpdateInMs_target(0)
66 &SimpleEpisodicMemoryPlatformUnitConnector::checkAndSendToMemory,
67 (1.0f / frequency * 1000));
68 periodic_task->start();
74 periodic_task->stop();
83 SimpleEpisodicMemoryPlatformUnitConnector::checkAndSendToMemory()
85 std::lock_guard l(platformPose_mutex);
86 std::lock_guard ll(platformTarget_mutex);
87 std::lock_guard lll(platformAcceleration_mutex);
90 std::lock_guard u(updatedMutex_pose);
91 if (updated_pose && timestampLastUpdateInMs_pose != 0)
93 memoryx::PlatformUnitEvent event;
94 event.receivedInMs = timestampLastUpdateInMs_pose;
101 event.acc_rot = acc_rot;
105 updated_pose =
false;
106 timestampLastUpdateInMs_pose = 0;
111 std::lock_guard u(updatedMutex_target);
112 if (updated_target && timestampLastUpdateInMs_target != 0)
114 memoryx::PlatformUnitTargetEvent event;
115 event.receivedInMs = timestampLastUpdateInMs_target;
117 event.target_x = goal_x;
118 event.target_y = goal_y;
119 event.target_rot = goal_rot;
123 updated_target =
false;
124 timestampLastUpdateInMs_target = 0;
133 std::lock_guard l(platformPose_mutex);
134 std::lock_guard u(updatedMutex_pose);
135 double received = IceUtil::Time::now().toMilliSecondsDouble();
138 rot = pose.rotationAroundZ;
140 timestampLastUpdateInMs_pose = received;
149 std::lock_guard l(platformTarget_mutex);
150 std::lock_guard u(updatedMutex_target);
151 double received = IceUtil::Time::now().toMilliSecondsDouble();
155 updated_target =
true;
156 timestampLastUpdateInMs_target = received;
165 std::lock_guard l(platformAcceleration_mutex);
166 std::lock_guard u(updatedMutex_pose);
167 double received = IceUtil::Time::now().toMilliSecondsDouble();
172 timestampLastUpdateInMs_pose = received;
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.