MovePlatformAfterGrasp.cpp
Go to the documentation of this file.
2
4#include <RobotAPI/libraries/skills/provider/SkillProxy.h>
5
7
9
10namespace armarx::skills
11{
12 namespace
13 {
14 grasp_object::arondto::MovePlatformAfterGraspAcceptedType
15 GetDefaultParameterization()
16 {
17 grasp_object::arondto::MovePlatformAfterGraspAcceptedType ret;
18 ret.orientationalAccuracy = 0.01;
19 ret.positionalAccuracy = 25;
20 return ret;
21 }
22 } // namespace
23
25 "MovePlatformAfterGrasp",
26 "Move Platform after agrasp to ease the navigation",
27 {},
29 grasp_object::arondto::MovePlatformAfterGraspAcceptedType::ToAronType(),
30 GetDefaultParameterization().toAron()};
31
40
42 MovePlatformAfterGraspSkill::main(const SpecializedMainInput& in)
43 {
45 armem::obj::instance::Reader objectReader(mns);
46
47 robotReader.connect();
48 objectReader.connect();
49
50 // //////////////////////////////
51 // get robot
52 // //////////////////////////////
53 auto robot =
54 robotReader.getSynchronizedRobot(in.parameters.robotName,
56 VirtualRobot::RobotIO::RobotDescription::eStructure);
57 if (!robot)
58 {
59 ARMARX_ERROR << "Lost robot.";
60 return {TerminatedSkillStatus::Failed, nullptr};
61 }
62
63 auto targetPose =
65
66 skills::platform_control::arondto::MovePlatformToPoseAcceptedType params;
67 params.robotName = in.parameters.robotName;
68 params.orientationalAccuracy = in.parameters.orientationalAccuracy;
69 params.positionalAccuracy = in.parameters.positionalAccuracy;
70 params.pose = targetPose.platformGlobalPose;
71
72 SkillProxy prx({manager,
73 context.platformControlSkillProvider,
75 return {
76 prx.executeFullSkill(getSkillId().toString(in.executorName), params.toAron()).status,
77 nullptr};
78 }
79} // namespace armarx::skills
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition Duration.cpp:48
The memory name system (MNS) client.
static DateTime Now()
Definition DateTime.cpp:51
grasp_object::arondto::MovePlatformAfterGraspAcceptedType ArgType
MovePlatformAfterGraspSkill(armem::client::MemoryNameSystem &mns, armarx::viz::Client &arviz, TwoArmGraspControlSkillContext &)
manager::dti::SkillManagerInterfacePrx manager
Definition Skill.h:363
virtual MainResult main()
Override this method with the actual implementation.
Definition Skill.cpp:542
SkillID getSkillId() const
Get the id of the skill.
Definition Skill.cpp:587
TwoArmGraspControlSkill(armem::client::MemoryNameSystem &mns, armarx::viz::Client &arviz, const std::string &layerName, TwoArmGraspControlSkillContext &c)
TwoArmGraspControlSkillContext & context
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
Definition Logging.h:196
GetPlatformOffsetAfterObjectGraspOutput GetGlobalPlatformPoseAfterObjectGrasp(const GetPlatformOffsetAfterObjectGraspInput &in)
This file is part of ArmarX.
const char * toString(InteractionFeedbackType type)
Definition Interaction.h:28
A result struct for th main method of a skill.
Definition Skill.h:62
armem::client::MemoryNameSystem mns