Fixposition SDK 0.0.0-heads/main-0-g90a51ff
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: ROS2 utilities
12 *
13 * @page FPSDK_ROS2_UTILS ROS2 utilities
14 *
15 * **API**: fpsdk_ros2/utils.hpp and fpsdk::ros2::utils
16 *
17 */
18#ifndef __FPSDK_ROS2_UTILS_HPP__
19#define __FPSDK_ROS2_UTILS_HPP__
20
21/* LIBC/STL */
22
23/* EXTERNAL */
24#include <fpsdk_ros2/ext/rclcpp.hpp>
25
26/* Fixposition SDK */
27#include <fpsdk_common/time.hpp>
28
29/* PACKAGE */
30
31namespace fpsdk {
32namespace ros2 {
33/**
34 * @brief ROS2 utilities
35 */
36namespace utils {
37/* ****************************************************************************************************************** */
38
39/**
40 * @brief Redirect fp:common::logging to ROS console
41 *
42 * This configures the fpsdk::common::logging facility to output via the ROS console. This does *not* configure the ROS
43 * console (logger level, logger name, etc.).
44 *
45 * The mapping of fpsdk::common::logging::LoggingLevel to rclcpp levels is as follows:
46 *
47 * - TRACE and DEBUG --> DEBUG
48 * - INFO and NOTICE --> INFO
49 * - WARNING --> WARN
50 * - ERROR --> ERROR
51 * - FATAL --> FATAL
52 *
53 * @param[in] logger_name The name of the logger. The recommended value is node->get_logger().get_name()
54 */
55void RedirectLoggingToRosConsole(const char* logger_name = "fpsdk_ros2");
56
57/**
58 * @brief Convert to ROS time (atomic -> POSIX)
59 *
60 * @param[in] time The Time object (atomic)
61 *
62 * @returns the ROS time object (POSIX)
63 */
64rclcpp::Time ConvTime(const fpsdk::common::time::Time& time);
65
66/**
67 * @brief Convert from ROS time (POSIX -> atomic)
68 *
69 * @param[in] time The ROS time object (POSIX)
70 *
71 * @returns the Time object (atomic)
72 */
73fpsdk::common::time::Time ConvTime(const rclcpp::Time& time);
74
75/* ****************************************************************************************************************** */
76} // namespace utils
77} // namespace ros2
78} // namespace fpsdk
79#endif // __FPSDK_ROS2_UTILS_HPP__
rclcpp::Time ConvTime(const fpsdk::common::time::Time &time)
Convert to ROS time (atomic -> POSIX)
void RedirectLoggingToRosConsole(const char *logger_name="fpsdk_ros2")
Redirect fp:common::logging to ROS console.
Fixposition SDK.
Fixposition SDK: Time utilities.