Fixposition SDK 0.0.0-heads/main-0-g7b59b93
Collection of c++ libraries and apps for use with Fixposition products
Loading...
Searching...
No Matches
utils.hpp
Go to the documentation of this file.
1/**
2 * \verbatim
3 * ___ ___
4 * \ \ / /
5 * \ \/ / Copyright (c) Fixposition AG
6 * / /\ \ License: see the LICENSE file
7 * /__/ \__\
8 * \endverbatim
9 *
10 * @file
11 * @brief Fixposition SDK: ROS1 utilities
12 *
13 * @page FPSDK_ROS1_UTILS ROS1 utilities
14 *
15 * **API**: fpsdk_ros1/utils.hpp and fpsdk::ros1::utils
16 *
17 */
18#ifndef __FPSDK_ROS1_UTILS_HPP__
19#define __FPSDK_ROS1_UTILS_HPP__
20
21/* LIBC/STL */
22#include <cstring>
23
24/* EXTERNAL */
25
26/* Fixposition SDK */
27
28/* PACKAGE */
29
30namespace fpsdk {
31namespace ros1 {
32/**
33 * @brief ROS1 utilities
34 */
35namespace utils {
36/* ****************************************************************************************************************** */
37
38/**
39 * @brief Redirect fp:common::logging to ROS console
40 *
41 * This configures the fpsdk::common::logging facility to output via the ROS console. This does *not* configure the ROS
42 * console (logger level, logger name, etc.).
43 *
44 * The mapping of fpsdk::common::logging::LoggingLevel to ros::console::levels is as follows:
45 *
46 * - TRACE and DEBUG --> DEBUG
47 * - INFO and NOTICE --> INFO
48 * - WARNING --> WARN
49 * - ERROR --> ERROR
50 * - FATAL --> FATAL
51 */
53
54/**
55 * @brief Loads a parameter from the ROS parameter server (int)
56 *
57 * @param[in] name The parameter name
58 * @param[out] value The value
59 *
60 * @returns true if parameter found and loaded, false otherwise
61 */
62bool LoadRosParam(const std::string& name, int& value);
63
64/**
65 * @brief Loads a parameter from the ROS parameter server (string)
66 *
67 * @param[in] name The parameter name
68 * @param[out] value The value
69 *
70 * @returns true if parameter found and loaded, false otherwise
71 */
72bool LoadRosParam(const std::string& name, std::string& value);
73
74/**
75 * @brief Loads a parameter from the ROS parameter server (bool)
76 *
77 * @param[in] name The parameter name
78 * @param[out] value The value
79 *
80 * @returns true if parameter found and loaded, false otherwise
81 */
82bool LoadRosParam(const std::string& name, bool& value);
83
84/**
85 * @brief Loads a parameter from the ROS parameter server (float)
86 *
87 * @param[in] name The parameter name
88 * @param[out] value The value
89 *
90 * @returns true if parameter found and loaded, false otherwise
91 */
92bool LoadRosParam(const std::string& name, float& value);
93
94/**
95 * @brief Loads a parameter from the ROS parameter server (double)
96 *
97 * @param[in] name The parameter name
98 * @param[out] value The value
99 *
100 * @returns true if parameter found and loaded, false otherwise
101 */
102bool LoadRosParam(const std::string& name, double& value);
103
104/* ****************************************************************************************************************** */
105} // namespace utils
106} // namespace ros1
107} // namespace fpsdk
108#endif // __FPSDK_ROS1_UTILS_HPP__
bool LoadRosParam(const std::string &name, int &value)
Loads a parameter from the ROS parameter server (int)
void RedirectLoggingToRosConsole()
Redirect fp:common::logging to ROS console.
Fixposition SDK.
Definition fpsdk_doc.hpp:20