ObjectPoseProviderPlugin.cpp
Go to the documentation of this file.
2
4
5namespace 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 {
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
56namespace armarx
57{
58
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
std::string makePropertyName(const std::string &name)
PluginT * addPlugin(const std::string prefix="", ParamsT &&... params)
objpose::provider::RequestObjectsOutput requestObjects(const objpose::provider::RequestObjectsInput &input, const Ice::Current &) override
Implement to process object requests (empty default implementation).
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
#define ARMARX_INFO
The normal logging level.
Definition Logging.h:181
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
Definition Logging.h:196
This file is part of ArmarX.
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.