MovePlatformToLandmark.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @author Fabian Reister ( fabian dot reister at kit dot edu )
17  * @date 2021
18  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19  * GNU General Public License
20  */
21 
22 #pragma once
23 
24 #include "MovePlatformToPose.h"
25 
26 // Base Class
29 
30 #include <RobotSkillTemplates/libraries/skill_platform_control/aron/MovePlatformToLandmarkAcceptedType.aron.generated.h>
31 
32 #include "PlatformControlSkill.h"
33 
34 namespace armarx::skills
35 {
37  public PlatformControlSkill,
38  public SimpleSpecializedSkill<platform_control::arondto::MovePlatformToLandmarkAcceptedType>
39  {
40  public:
41  using ArgType = platform_control::arondto::MovePlatformToLandmarkAcceptedType;
42 
46 
47  private:
48  MainResult main(const SpecializedMainInput& in) final;
49 
51  convertLandmarkToPose(const std::string& graphName,
52  const std::string& landmarkName,
54  {
55  auto locs = memoryReader.getAllLocationsInGlobalFrame();
56  auto locId = graphName + "/" + landmarkName;
57  if (locs.count(locId) > 0)
58  {
59  auto eigen = locs.at(locId).framedPose.pose;
60  ARMARX_INFO << "Converted pose for landmark '" << locId << "is: " << eigen;
61  return eigen;
62  }
63  throw armarx::LocalException("No suitable location found for id: " + locId);
64  }
65 
66  public:
68  };
69 } // namespace armarx::skills
armarx::skills::mixin::MNSSkillMixin::mns
armem::client::MemoryNameSystem mns
Definition: MNSSkillMixin.h:11
armarx::armem::locations::client::Reader::getAllLocationsInGlobalFrame
std::map< std::string, armarx::navigation::location::arondto::Location > getAllLocationsInGlobalFrame()
Definition: Reader.cpp:71
client.h
armarx::skills
This file is part of ArmarX.
Definition: PeriodicUpdateWidget.cpp:11
armarx::skills::SkillDescription
Definition: SkillDescription.h:18
armarx::skills::MovePlatformToLandmark::MovePlatformToLandmark
MovePlatformToLandmark(armem::client::MemoryNameSystem &mns, armarx::viz::Client &arviz, PlatformControlSkillContext &context)
Definition: MovePlatformToLandmark.cpp:30
MovePlatformToPose.h
armarx::skills::mixin::ArvizSkillMixin::arviz
armarx::viz::Client arviz
Definition: ArvizSkillMixin.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
armarx::skills::PlatformControlSkill
Definition: PlatformControlSkill.h:56
armarx::skills::PlatformControlSkill::context
PlatformControlSkillContext & context
Definition: PlatformControlSkill.h:76
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
armarx::skills::MovePlatformToLandmark
Definition: MovePlatformToLandmark.h:36
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::skills::SimpleSpecializedSkill< platform_control::arondto::MovePlatformToLandmarkAcceptedType >::main
Skill::MainResult main() final
Definition: SimpleSpecializedSkill.h:71
PlatformControlSkill.h
armarx::armem::client::MemoryNameSystem
The memory name system (MNS) client.
Definition: MemoryNameSystem.h:69
Reader.h
armarx::viz::Client
Definition: Client.h:109