ice_conversions.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 <iosfwd>
25#include <optional>
26#include <string>
27#include <vector>
28
30
31#include <armarx/navigation/client/ice/NavigatorInterface.h>
35
37{
38
39 // TODO move type out of this header (e.g. to types.h)
41 {
42 std::optional<std::string> locationId = std::nullopt;
43 std::optional<core::Pose> pose = std::nullopt;
44
46
47 //client::Config config;
48 };
49
50 inline std::ostream&
51 operator<<(std::ostream& str, const WaypointTarget& res)
52 {
53 str << "WaypointTarget { ";
54
55 if (res.locationId.has_value() and not res.locationId->empty())
56 {
57 str << "location: " << res.locationId.value();
58 }
59 else if (res.pose.has_value())
60 {
61 str << "pose :" << res.pose->matrix();
62 }
63
64 str << "}";
65
66 return str;
67 }
68
69 // TODO move to util file
70 inline void
71 validate(const std::vector<WaypointTarget>& path)
72 {
73 std::for_each(path.begin(),
74 path.end(),
75 [](const WaypointTarget& wpTarget)
76 {
77 ARMARX_CHECK(wpTarget.locationId.has_value() or wpTarget.pose.has_value())
78 << "Either `locationId` or `pose` has to be provided.";
79 });
80 }
81
82 using WaypointTargets = std::vector<WaypointTarget>;
83
87
89 std::vector<core::TargetAlternative>
91
95
98 freeze(const std::vector<core::TargetAlternative>& alternatives);
99
100
101} // namespace armarx::navigation::client
std::string str(const T &t)
Brief description of class targets.
Definition targets.h:39
sequence< TargetAlternative > TargetAlternatives
This file is part of ArmarX.
client::detail::GlobalPlanningStrategy freeze(const client::GlobalPlanningStrategy &strategy)
client::GlobalPlanningStrategy defrost(const client::detail::GlobalPlanningStrategy &strategy)
std::vector< WaypointTarget > WaypointTargets
std::ostream & operator<<(std::ostream &str, const WaypointTarget &res)
void validate(const std::vector< WaypointTarget > &path)
client::GlobalPlanningStrategy strategy
std::optional< std::string > locationId