AutoAPMS
Resilient Robot Mission Management
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
convert.hpp
1// Copyright 2024 Robin Müller
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
17#include <string>
18#include <vector>
19#include <Eigen/Geometry>
20
21#include "behaviortree_cpp/basic_types.h"
22
24namespace BT
25{
26
27template <>
28[[nodiscard]] std::vector<uint8_t> convertFromString<std::vector<uint8_t>>(StringView str);
29
30template <>
31[[nodiscard]] std::vector<bool> convertFromString<std::vector<bool>>(StringView str);
32
33template <>
34[[nodiscard]] std::vector<int64_t> convertFromString<std::vector<int64_t>>(StringView str);
35
36template <>
37[[nodiscard]] Eigen::MatrixXd convertFromString<Eigen::MatrixXd>(StringView str);
38
39template <>
40[[nodiscard]] std::string toStr<std::vector<uint8_t>>(const std::vector<uint8_t> & value);
41
42template <>
43[[nodiscard]] std::string toStr<std::vector<bool>>(const std::vector<bool> & value);
44
45template <>
46[[nodiscard]] std::string toStr<std::vector<int64_t>>(const std::vector<int64_t> & value);
47
48template <>
49[[nodiscard]] std::string toStr<std::vector<double>>(const std::vector<double> & value);
50
51template <>
52[[nodiscard]] std::string toStr<Eigen::MatrixXd>(const Eigen::MatrixXd & value);
53
54template <>
55[[nodiscard]] std::string toStr<std::vector<std::string>>(const std::vector<std::string> & value);
56
57} // namespace BT