My Project
1.0
Holistic Fusion: A Generic Framework for Multimodal Sensor Fusion
Loading...
Searching...
No Matches
read_ros_params.h
Go to the documentation of this file.
1
/*
2
Copyright 2023 by Julian Nubert & Simon Kerscher, Robotic Systems Lab, ETH Zurich.
3
All rights reserved.
4
This file is released under the "BSD-3-Clause License".
5
Please see the LICENSE file that has been included as part of this package.
6
*/
7
8
#ifndef HOLISTIC_FUSION_ROS_READ_ROS_PARAMS_H
9
#define HOLISTIC_FUSION_ROS_READ_ROS_PARAMS_H
10
11
// Workspace
12
#include "
holistic_fusion/interface/Terminal.h
"
13
14
namespace
holistic_fusion
{
15
16
template
<
typename
T>
17
inline
void
printKey
(
const
std::string& key, T value) {
18
std::cout <<
YELLOW_START
<<
"HolisticFusionRos "
<<
COLOR_END
<< key <<
" set to: "
<< value << std::endl;
19
}
20
21
template
<>
22
inline
void
printKey
(
const
std::string& key, std::vector<double> vector) {
23
std::cout <<
YELLOW_START
<<
"HolisticFusionRos "
<<
COLOR_END
<< key <<
" set to: "
;
24
for
(
const
auto
& element : vector) {
25
std::cout << element <<
","
;
26
}
27
std::cout << std::endl;
28
}
29
30
// Implementation of Templating
31
template
<
typename
T>
32
T
tryGetParam
(
const
std::string& key,
const
ros::NodeHandle& privateNode) {
33
T value;
34
if
(privateNode.getParam(key, value)) {
35
printKey
(key, value);
36
return
value;
37
}
else
if
(privateNode.getParam(
"/"
+ key, value)) {
38
printKey
(
"/"
+ key, value);
39
return
value;
40
}
else
{
41
throw
std::runtime_error(
"HolisticFusionRos - "
+ key +
" not specified."
);
42
}
43
}
44
45
}
// namespace holistic_fusion
46
47
#endif
// HOLISTIC_FUSION_ROS_READ_ROS_PARAMS_H
COLOR_END
#define COLOR_END
Definition
HolisticFusionDualGraph.h:21
YELLOW_START
#define YELLOW_START
Definition
HolisticFusionDualGraph.h:19
Terminal.h
holistic_fusion
Absolute.
Definition
AdmissibleGtsamSymbols.h:11
holistic_fusion::printKey
void printKey(const std::string &key, T value)
Definition
read_ros_params.h:17
holistic_fusion::tryGetParam
T tryGetParam(const std::string &key, const ros::NodeHandle &privateNode)
Definition
read_ros_params.h:32
ros
holistic_fusion_ros
include
holistic_fusion_ros
ros
read_ros_params.h
Generated by
1.15.0