28 #include <ArmarXCore/interface/observers/ConditionHandlerInterface.h>
30 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
31 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
32 #include <MemoryX/interface/observers/ObjectMemoryObserverInterface.h>
34 #include <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
46 defineRequiredProperty<std::string>(
"SceneModificationType",
"Possible modes are 'addObject', 'removeObject', and 'moveObject'. No object manipulation with 'none'.");
47 defineRequiredProperty<std::string>(
"ObjectClassName",
"Name of object class in PriorKnowledge");
48 defineRequiredProperty<std::string>(
"ObjectInstanceName",
"Name of object instance in working memory");
49 defineOptionalProperty<float>(
"PositionX", 0.0f,
"Position of object (x)");
50 defineOptionalProperty<float>(
"PositionY", 0.0f,
"Position of object (y)");
51 defineOptionalProperty<float>(
"PositionZ", 0.0f,
"Position of object (z)");
52 defineOptionalProperty<float>(
"OrientationRoll", 0.0f,
"Orientation of object (roll)");
53 defineOptionalProperty<float>(
"OrientationPitch", 0.0f,
"Orientation of object (pitch)");
54 defineOptionalProperty<float>(
"OrientationYaw", 0.0f,
"Orientation of object (yaw)");
55 defineOptionalProperty<bool>(
"StaticObject",
false,
"Specify if the object is static (fixed in the world) or dynamic (can move in the world)");
56 defineOptionalProperty<std::string>(
"WorkingMemoryName",
"WorkingMemory",
"Name of the WorkingMemory component that should be used");
57 defineOptionalProperty<std::string>(
"PriorKnowledgeName",
"PriorKnowledge",
"Name of the PriorKnowledge component that should be used");
58 defineOptionalProperty<std::string>(
"SimulatorName",
"Simulator",
"Name of the Simulator component that should be used");
61 for (
int i = 0; i < 10; i++)
63 std::stringstream ss1;
64 ss1 <<
"SceneModificationType_" << i;
65 defineOptionalProperty<std::string>(ss1.str(),
"none",
"Optional additional object. Possible modes are 'addObject', 'removeObject', and 'moveObject'. No object manipulation with 'none'.");
67 std::stringstream ss2;
68 ss2 <<
"ObjectClassName_" << i;
69 defineOptionalProperty<std::string>(ss2.str(),
"",
"Optional additional object. Name of object class in PriorKnowledge");
71 std::stringstream ss3;
72 ss3 <<
"ObjectInstanceName_" << i;
73 defineOptionalProperty<std::string>(ss3.str(),
"",
"Optional additional object. Name of object instance in working memory");
75 std::stringstream ss4;
76 ss4 <<
"PositionX_" << i;
77 defineOptionalProperty<float>(ss4.str(), 0.0f,
"Optional additional object. Position of object (x)");
79 std::stringstream ss5;
80 ss5 <<
"PositionY_" << i;
81 defineOptionalProperty<float>(ss5.str(), 0.0f,
"Optional additional object. Position of object (y)");
83 std::stringstream ss6;
84 ss6 <<
"PositionZ_" << i;
85 defineOptionalProperty<float>(ss6.str(), 0.0f,
"Optional additional object. Position of object (z)");
87 std::stringstream ss7;
88 ss7 <<
"OrientationRoll_" << i;
89 defineOptionalProperty<float>(ss7.str(), 0.0f,
"Optional additional object. Orientation of object (roll)");
91 std::stringstream ss8;
92 ss8 <<
"OrientationPitch_" << i;
93 defineOptionalProperty<float>(ss8.str(), 0.0f,
"Optional additional object. Orientation of object (pitch)");
95 std::stringstream ss9;
96 ss9 <<
"OrientationYaw_" << i;
97 defineOptionalProperty<float>(ss9.str(), 0.0f,
"Optional additional object. Orientation of object (yaw)");
99 std::stringstream ss10;
100 ss10 <<
"StaticObject_" << i;
101 defineOptionalProperty<bool>(ss10.str(),
false,
"Optional additional object. Specify if the object is static (fixed in the world) or dynamic (can move in the world)");
105 defineOptionalProperty<bool>(
"LocalizeObject",
false,
"Start localization of object. This will make the object visible in the WM gui.");
106 defineOptionalProperty<int>(
"LocalizeObject_seconds", 10,
"How long should the object be localized");
108 defineOptionalProperty<std::string>(
"AttachObjectToRobot.ObjectName",
"",
"Attach object to robot: object instance name");
109 defineOptionalProperty<std::string>(
"AttachObjectToRobot.RobotName",
"",
"Attach object to robot: name of robot");
110 defineOptionalProperty<std::string>(
"AttachObjectToRobot.RobotNodeName",
"",
"Attach object to robot: name of RobotNode (i.e. tcp)");
140 getConfigIdentifier()));
146 return "SceneModifier";
148 void onInitComponent()
override;
149 void onExitComponent()
override;
150 void onConnectComponent()
override;
152 void onDisconnectComponent()
override;
156 void addObject(
const std::string& suffix);
157 void removeObject(
const std::string& suffix);
158 void moveObject(
const std::string& suffix);
166 void localizeSingleObject(
const std::string& objClass,
int sleepS);
167 void attachObject(
const std::string& objName,
const std::string& robotName,
const std::string& robotNodeName);
168 bool checkForConfigs(
const std::string& suffix);
169 bool getStatic(
const std::string& suffix);