ObjectPoseProviderPlugin.cpp
Go to the documentation of this file.
2 
4 
5 namespace armarx::plugins
6 {
7 
8  void
10  {
11  if (!properties->hasDefinition(makePropertyName(PROPERTY_NAME)))
12  {
13  properties->defineOptionalProperty<std::string>(
14  makePropertyName(PROPERTY_NAME), "ObjectMemory", "Name of the object memory.");
15  }
16  }
17 
18  void
20  {
21  parent<Component>().usingProxyFromProperty(makePropertyName(PROPERTY_NAME));
22  }
23 
24  void
26  {
27  parent<ObjectPoseProviderPluginUser>().objectPoseTopic =
28  parent<Component>().getProxyFromProperty<objpose::ObjectPoseStorageInterfacePrx>(
29  makePropertyName(PROPERTY_NAME));
30  }
31 
32  void
34  {
35  auto& parent = this->parent<ObjectPoseProviderPluginUser>();
36  if (parent.objectPoseTopic)
37  {
38  objpose::ProviderInfo info = parent.getProviderInfo();
39  if (!info.proxy)
40  {
41  info.proxy =
42  ::armarx::objpose::ObjectPoseProviderPrx::checkedCast(parent.getProxy());
43  }
44 
45  ARMARX_INFO << "Reporting provider `" << parent.getName() << "` availability.";
46  parent.objectPoseTopic->reportProviderAvailable(parent.getName(), info);
47  }
48  else
49  {
50  ARMARX_ERROR << "Object pose topic not ready.";
51  }
52  }
53 
54 } // namespace armarx::plugins
55 
56 namespace armarx
57 {
58 
60  {
61  addPlugin(plugin);
62  }
63 
64  objpose::provider::RequestObjectsOutput
66  const objpose::provider::RequestObjectsInput& input,
67  const Ice::Current&)
68  {
69  // ARMARX_INFO << "Requested " << input.objectIDs.size() << " objects for " << input.relativeTimeoutMS << " ms.";
70  objpose::provider::RequestObjectsOutput output;
71  for (const auto& id : input.objectIDs)
72  {
73  output.results[id].success = false;
74  }
75  return output;
76  }
77 
78 
79 } // namespace armarx
ObjectPoseProviderPlugin.h
armarx::ObjectPoseStorageInterfacePrx
::IceInternal::ProxyHandle<::IceProxy::armarx::objpose::ObjectPoseStorageInterface > ObjectPoseStorageInterfacePrx
Definition: ObjectPoseClientWidget.h:57
armarx::ManagedIceObjectPlugin::parent
ManagedIceObject & parent()
Definition: ManagedIceObjectPlugin.cpp:72
armarx::ManagedIceObject::addPlugin
PluginT * addPlugin(const std::string prefix="", ParamsT &&... params)
Definition: ManagedIceObject.h:186
armarx::plugins::ObjectPoseProviderPlugin::preOnInitComponent
void preOnInitComponent() override
Definition: ObjectPoseProviderPlugin.cpp:19
armarx::plugins
This file is part of ArmarX.
Definition: DebugObserverComponentPlugin.cpp:27
armarx::ObjectPoseProviderPluginUser::ObjectPoseProviderPluginUser
ObjectPoseProviderPluginUser()
Definition: ObjectPoseProviderPlugin.cpp:59
armarx::aron::input
ReaderT::InputType & input
Definition: rw.h:12
armarx::plugins::ObjectPoseProviderPlugin::postOnConnectComponent
void postOnConnectComponent() override
Definition: ObjectPoseProviderPlugin.cpp:33
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:196
Component.h
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:181
armarx::plugins::ObjectPoseProviderPlugin::postCreatePropertyDefinitions
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
Definition: ObjectPoseProviderPlugin.cpp:9
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::ObjectPoseProviderPluginUser::requestObjects
objpose::provider::RequestObjectsOutput requestObjects(const objpose::provider::RequestObjectsInput &input, const Ice::Current &) override
Implement to process object requests (empty default implementation).
Definition: ObjectPoseProviderPlugin.cpp:65
armarx::ManagedIceObjectPlugin::makePropertyName
std::string makePropertyName(const std::string &name)
Definition: ManagedIceObjectPlugin.cpp:56
armarx::ManagedIceObject::getName
std::string getName() const
Retrieve name of object.
Definition: ManagedIceObject.cpp:108
armarx::ManagedIceObject::getProxy
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
Definition: ManagedIceObject.cpp:407
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::plugins::ObjectPoseProviderPlugin::preOnConnectComponent
void preOnConnectComponent() override
Definition: ObjectPoseProviderPlugin.cpp:25