MovePlatformToLandmark.cpp
Go to the documentation of this file.
2 
4 
5 #include "util/PlatformUtil.h"
6 
7 namespace armarx::skills
8 {
9 
10  namespace
11  {
12  platform_control::arondto::MovePlatformToLandmarkAcceptedType
13  GetDefaultParameterization()
14  {
15  platform_control::arondto::MovePlatformToLandmarkAcceptedType ret;
16  ret.orientationalAccuracy = 0.1;
17  ret.positionalAccuracy = 100;
18  return ret;
19  }
20  } // namespace
21 
22  SkillDescription MovePlatformToLandmark::Description = skills::SkillDescription(
23  {"MovePlatformToLandmark"},
24  "Move a platform unit to target landmark. Uses a navigation memory to resolve the "
25  "landmark.",
26  GetDefaultParameterization().toAron(),
28  platform_control::arondto::MovePlatformToLandmarkAcceptedType::ToAronType());
29 
31  armarx::viz::Client& arviz,
32  PlatformControlSkillContext& context) :
33  PlatformControlSkill(mns, arviz, Description.skillId.toString(), context),
34  SimpleSpecializedSkill<ArgType>(Description)
35  {
36  }
37 
39  MovePlatformToLandmark::main(const SpecializedMainInput& in)
40  {
41  auto navigationReader = armarx::armem::locations::client::Reader();
42  navigationReader.connect(mns);
43 
44  // convert landmark
45  auto conversion =
46  convertLandmarkToPose(in.parameters.graph, in.parameters.landmark, navigationReader);
47 
48  // create params to reuse skill
49  platform_control::arondto::MovePlatformToPoseAcceptedType args;
50  args.robotName = in.parameters.robotName;
51  args.orientationalAccuracy = in.parameters.orientationalAccuracy;
52  args.positionalAccuracy = in.parameters.positionalAccuracy;
53  args.pose = conversion;
54 
56  return {prx.executeSkill(getSkillId().toString(), args.toAron()).status, nullptr};
57  }
58 } // namespace armarx::skills
armarx::skills::mixin::MNSSkillMixin::mns
armem::client::MemoryNameSystem mns
Definition: MNSSkillMixin.h:11
armarx::skills::SkillProxy::executeSkill
TerminatedSkillStatusUpdate executeSkill(const std::string &executorName, const aron::data::DictPtr &params=nullptr) const
execute a skill and block until skill terminates
Definition: SkillProxy.cpp:51
armarx::skills::Skill::manager
manager::dti::SkillManagerInterfacePrx manager
Definition: Skill.h:327
armarx::aron::ret
ReaderT::InputType T & ret
Definition: rw.h:21
armarx::skills::SkillDescription::timeout
armarx::core::time::Duration timeout
Definition: SkillDescription.h:23
armarx::skills::TerminatedSkillStatusUpdate::status
TerminatedSkillStatus status
Definition: SkillStatusUpdate.h:81
armarx::skills
This file is part of ArmarX.
Definition: PeriodicUpdateWidget.cpp:11
armarx::skills::MovePlatformToPose::Description
static SkillDescription Description
Definition: MovePlatformToPose.h:66
armarx::skills::MovePlatformToLandmark::MovePlatformToLandmark
MovePlatformToLandmark(armem::client::MemoryNameSystem &mns, armarx::viz::Client &arviz, PlatformControlSkillContext &context)
Definition: MovePlatformToLandmark.cpp:30
armarx::skills::SkillProxy
Definition: SkillProxy.h:11
armarx::skills::MovePlatformToLandmark::ArgType
platform_control::arondto::MovePlatformToLandmarkAcceptedType ArgType
Definition: MovePlatformToLandmark.h:41
armarx::skills::MovePlatformToLandmark::Description
static SkillDescription Description
Definition: MovePlatformToLandmark.h:67
armarx::armem::locations::client::Reader
Definition: Reader.h:18
FramedPose.h
armarx::skills::PlatformControlSkill
Definition: PlatformControlSkill.h:56
armarx::skills::SimpleSpecializedSkill
Definition: SimpleSpecializedSkill.h:10
armarx::skills::Skill::MainResult
A result struct for th main method of a skill.
Definition: Skill.h:48
armarx::skills::PlatformControlSkillContext
Definition: PlatformControlSkill.h:45
PlatformUtil.h
MovePlatformToLandmark.h
armarx::skills::SimpleSpecializedSkill< platform_control::arondto::MovePlatformToLandmarkAcceptedType >::main
Skill::MainResult main() final
Definition: SimpleSpecializedSkill.h:71
armarx::viz::toString
const char * toString(InteractionFeedbackType type)
Definition: Interaction.h:27
armarx::armem::client::MemoryNameSystem
The memory name system (MNS) client.
Definition: MemoryNameSystem.h:69
armarx::viz::Client
Definition: Client.h:109
armarx::skills::Skill::getSkillId
SkillID getSkillId() const
Get the id of the skill.
Definition: Skill.h:74
armarx::core::time::Duration::MilliSeconds
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition: Duration.cpp:55