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
33
34namespace armarx::skills
35{
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
50 Eigen::Matrix4f
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
The memory name system (MNS) client.
std::map< std::string, armarx::navigation::location::arondto::Location > getAllLocationsInGlobalFrame()
Definition Reader.cpp:73
platform_control::arondto::MovePlatformToLandmarkAcceptedType ArgType
MovePlatformToLandmark(armem::client::MemoryNameSystem &mns, armarx::viz::Client &arviz, PlatformControlSkillContext &context)
PlatformControlSkillContext & context
PlatformControlSkill(armem::client::MemoryNameSystem &mns, armarx::viz::Client &arviz, const std::string &layerName, PlatformControlSkillContext &c)
#define ARMARX_INFO
The normal logging level.
Definition Logging.h:181
This file is part of ArmarX.
A result struct for th main method of a skill.
Definition Skill.h:62
armem::client::MemoryNameSystem mns