launch_properties_provider.h
Go to the documentation of this file.
1 #ifndef SLAM_CTOR_ROS_LAUNCH_PROPERTIES_PROVIDER
2 #define SLAM_CTOR_ROS_LAUNCH_PROPERTIES_PROVIDER
3 
4 #include <string>
5 #include <ros/ros.h>
6 #include <cassert>
7 
8 #include "../utils/properties_providers.h"
9 
11 public:
12 
13  int get_int(const std::string &id, int dflt) const override {
14  return launch_param<int>(id, dflt);
15  }
16 
17  double get_dbl(const std::string &id, double dflt) const override {
18  return launch_param<double>(id, dflt);
19  }
20 
21  str get_str(const std::string &id, const str &dflt) const override {
22  return launch_param<str>(id, dflt);
23  }
24 
25  unsigned get_uint(const std::string &id, unsigned dflt) const override {
26  int v = launch_param<int>(id, dflt);
27  assert(0 <= v);
28  return v;
29  }
30 
31  bool get_bool(const std::string &id, bool dflt) const override {
32  return launch_param<bool>(id, dflt);
33  }
34 
35 private:
36 
37  template <typename T>
38  T launch_param(const std::string &id, const T &default_value) const {
39  T value;
40  ros::param::param<T>("~" + id, value, default_value);
41  return value;
42  }
43 };
44 
45 #endif
double get_dbl(const std::string &id, double dflt) const override
str get_str(const std::string &id, const str &dflt) const override
unsigned get_uint(const std::string &id, unsigned dflt) const override
int get_int(const std::string &id, int dflt) const override
T launch_param(const std::string &id, const T &default_value) const
bool get_bool(const std::string &id, bool dflt) const override


slam_constructor
Author(s): JetBrains Research, OSLL team
autogenerated on Mon Jun 10 2019 15:08:25