BringObjectToHuman.cpp
Go to the documentation of this file.
2
3namespace armarx::skills
4{
6 SkillDescription{"BringObjectToHuman",
7 "Bring an object to some location",
8 {},
10 nullptr};
11
12 /*BringObjectToHuman::BringObjectToHuman(armem::client::MemoryNameSystem& mns, armarx::viz::Client& arviz, GraspControlSkillContext& context) :
13 Skill(BringObjectToHumanDesc),
14 mns(mns),
15 arviz(arviz),
16 context(context),
17 graspObject(mns, arviz, context),
18 handoverObject(mns, arviz, context),
19 movePlatformToLandmark(mns, arviz, context.platformControlSkillContext)
20 {
21 }
22
23 void BringObjectToHuman::_reset()
24 {
25 graspObject.reset();
26 handoverObject.reset();
27 movePlatformToLandmark.reset();
28 Skill::_reset();
29 }
30
31 void BringObjectToHuman::_notifyStopped()
32 {
33 graspObject.notifyStopped();
34 handoverObject.notifyStopped();
35 movePlatformToLandmark.notifyStopped();
36 Skill::_notifyStopped();
37 }
38
39 void BringObjectToHuman::_notifyTimeoutReached()
40 {
41 graspObject.notifyTimeoutReached();
42 handoverObject.notifyTimeoutReached();
43 movePlatformToLandmark.notifyTimeoutReached();
44 Skill::_notifyTimeoutReached();
45 }
46
47 Skill::Status BringObjectToHuman::_execute(const aron::data::DictPtr& in, const CallbackT& callback)
48 {
49 std::string objName = "Kitchen/green-cup/0";
50 std::string objLandmarkName = "sideboard";
51 std::string targetLandmarkName = "delivernode";
52 std::string graspSetName = "TCP L";
53 std::string kinematicChainName = "LeftArm";
54 std::string otherKinematicChainName = "RightArm";
55 std::string robot = "Armar3";
56
57 Skill::Status ret = Skill::Status::Succeeded;
58
59 // move to landmark1
60 {
61 platform_control::arondto::MovePlatformToLandmarkAcceptedType args;
62 args.landmark = objLandmarkName;
63 args.orientationalAccuracy = 0.1;
64 args.positionalAccuracy = 20;
65
66 ret = movePlatformToLandmark._execute(args, callback);
67 }
68
69 if (ret != Skill::Status::Succeeded)
70 {
71 return ret;
72 }
73
74 // grasp Object
75 {
76 grasp_object::arondto::GraspObjectAcceptedType args;
77 args.graspSetName = graspSetName;
78 args.kinematicChainNames = "LeftArm";
79 args.objectEntityId = objName;
80 args.orientationalAccuracy = 0.1;
81 args.positionalAccuracy = 20;
82 args.robot = robot;
83
84 ret = graspObject._execute(args, callback);
85 }
86
87 if (ret != Skill::Status::Succeeded)
88 {
89 return ret;
90 }
91
92 // Move to target landmark
93 {
94 platform_control::arondto::MovePlatformToLandmarkAcceptedType args;
95 args.landmark = targetLandmarkName;
96 args.orientationalAccuracy = 0.1;
97 args.positionalAccuracy = 20;
98
99 ret = movePlatformToLandmark._execute(args, callback);
100 }
101
102 if (ret != Skill::Status::Succeeded)
103 {
104 return ret;
105 }
106
107 // putdown object
108 {
109 grasp_object::arondto::PutdownObjectAcceptedType args;
110 args.kinematicChainName = kinematicChainName;
111 args.objectEntityId = objName;
112 args.orientationalAccuracy = 0.1;
113 args.otherArmKinematicChainName = otherKinematicChainName;
114 args.positionalAccuracy = 20;
115 args.robot = robot;
116
117 ret = handoverObject._execute(args, callback);
118 }
119
120 return ret;
121 }*/
122} // namespace armarx::skills
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition Duration.cpp:48
This file is part of ArmarX.
const SkillDescription BringObjectToHumanDesc