MovePlatformAfterPutdown.cpp
Go to the documentation of this file.
2
5
7
9
10namespace armarx::skills
11{
12 namespace
13 {
14 grasp_object::arondto::MovePlatformAfterPutdownAcceptedType
15 GetDefaultParameterization()
16 {
17 grasp_object::arondto::MovePlatformAfterPutdownAcceptedType ret;
18 ret.orientationalAccuracy = 0.01;
19 ret.positionalAccuracy = 25;
20 return ret;
21 }
22 } // namespace
23
25 .skillId = {.skillName = "MovePlatformAfterPutdown"},
26 .description = "Move Platform after a putdown motion to ease the navigation",
27 .rootProfileDefaults = GetDefaultParameterization().toAron(),
28 .timeout = armarx::Duration::MilliSeconds(120000),
29 .parametersType = grasp_object::arondto::MovePlatformAfterPutdownAcceptedType::ToAronType(),
30 };
31
40
42 MovePlatformAfterPutdownSkill::main(const SpecializedMainInput& in)
43 {
46
47 robotReader.connect(mns);
48 objectReader.connect(mns);
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 // //////////////////////////////
64 // Exec move skill
65 // //////////////////////////////
66 auto targetPose =
68
69 platform_control::arondto::MovePlatformToPoseAcceptedType params;
70 params.pose = targetPose.platformGlobalPose;
71 params.robotName = in.parameters.robotName;
72 params.orientationalAccuracy = in.parameters.orientationalAccuracy;
73 params.positionalAccuracy = in.parameters.positionalAccuracy;
74
75 SkillProxy prx(manager, SkillID{
76 .providerId = ProviderID{.providerName = context.platformControlSkillProvider},
78 return {prx.executeSkill(in.executorName, params.toAron()).status, nullptr};
79 }
80} // 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.
void connect(armem::client::MemoryNameSystem &memoryNameSystem)
virtual void connect(armem::client::MemoryNameSystem &memoryNameSystem)
VirtualRobot::RobotPtr getSynchronizedRobot(const std::string &name, const VirtualRobot::RobotIO::RobotDescription &loadMode=VirtualRobot::RobotIO::RobotDescription::eStructure, bool blocking=true)
static DateTime Now()
Definition DateTime.cpp:51
MovePlatformAfterPutdownSkill(armem::client::MemoryNameSystem &mns, armarx::viz::Client &arviz, TwoArmGraspControlSkillContext &)
grasp_object::arondto::MovePlatformAfterPutdownAcceptedType ArgType
std::string skillName
Definition SkillID.h:41
manager::dti::SkillManagerInterfacePrx manager
Definition Skill.h:363
virtual MainResult main()
Override this method with the actual implementation.
Definition Skill.cpp:542
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
GetPlatformOffsetAfterObjectPutdownOutput GetGlobalPlatformPoseAfterObjectPutdown(const GetPlatformOffsetAfterObjectPutdownInput &in)
This file is part of ArmarX.
A result struct for th main method of a skill.
Definition Skill.h:62
armem::client::MemoryNameSystem & mns