LocationUtils.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 Tobias Gröger ( tobias dot groeger at student dot kit dot edu )
17  * @date 2023
18  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19  * GNU General Public License
20  */
21 
22 #pragma once
23 
24 #include <optional>
25 #include <string>
26 #include <vector>
27 
32 
34 
36 {
37 
39  {
40  std::optional<Pose> pose;
41  std::string errorMsg; // error message in case the pose is not set
42 
44  {
45  }
46 
47  ResolvedLocation(const std::string& errorMsg) : errorMsg(errorMsg)
48  {
49  }
50  };
51 
52  /*!
53  * \brief Resolve the FramedPose of a location to a global pose.
54  * \param instanceID instance to use if the location is relative to an object class
55  *
56  * When the location is relative to a specific instance the parameter instanceID is ignored.
57  * Otherwise (the location is relative to a object class) it is set as the instance of that class.
58  * The object pose and info is fetched through a network call.
59  * For a cached version see below.
60  */
61  ResolvedLocation resolveLocation(const objpose::ObjectPoseClient& client,
62  const FramedPose& framedPose,
63  const std::string& instanceID = "");
64 
65  /*!
66  * \brief Resolve the FramedPose of a location to a global pose.
67  * \param instanceID instance to use if the location is relative to an object class
68  *
69  * When the location is relative to a specific instance the parameter instanceID is ignored.
70  * Otherwise (the location is relative to a object class) it is set as the instance of that class.
71  */
72  ResolvedLocation resolveLocation(const objpose::ObjectPoseMap& objects,
73  const std::vector<ObjectInfo>& info,
74  const FramedPose& framedPose,
75  const std::string& instanceID = "");
76 
77 } // namespace armarx::navigation::core
armarx::navigation::core::ResolvedLocation::ResolvedLocation
ResolvedLocation(const std::string &errorMsg)
Definition: LocationUtils.h:47
armarx::navigation::core::ResolvedLocation::errorMsg
std::string errorMsg
Definition: LocationUtils.h:41
armarx::navigation::core::resolveLocation
void resolveLocation(Graph::Vertex &vertex, const aron::data::DictPtr &locationData)
Definition: Graph.cpp:250
armarx::navigation::core::Pose
Eigen::Isometry3f Pose
Definition: basic_types.h:31
basic_types.h
armarx::FramedPose
The FramedPose class.
Definition: FramedPose.h:280
armarx::navigation::core
This file is part of ArmarX.
Definition: aron_conversions.cpp:19
armarx::objpose::ObjectPoseClient
Provides access to the armarx::objpose::ObjectPoseStorageInterface (aka the object memory).
Definition: ObjectPoseClient.h:17
armarx::navigation::core::ResolvedLocation::ResolvedLocation
ResolvedLocation(const Pose &pose)
Definition: LocationUtils.h:43
armarx::navigation::core::ResolvedLocation
Definition: LocationUtils.h:38
FramedPose.h
armarx::navigation::core::ResolvedLocation::pose
std::optional< Pose > pose
Definition: LocationUtils.h:40
ObjectPoseClient.h
ObjectInfo.h
forward_declarations.h
armarx::objpose::ObjectPoseMap
std::map< ObjectID, ObjectPose > ObjectPoseMap
Definition: forward_declarations.h:21