Fixposition SDK 0.0.0-heads/main-0-g75e6614
Collection of c++ libraries and apps for use with Fixposition products on Linux
Loading...
Searching...
No Matches
fpsdk::common::ros2 Namespace Reference

ROS2 types and utils. More...

Classes

class  BagWriter
 ROS2 bag writer helper. More...

Functions

void RedirectLoggingToRosConsole (const char *logger_name="fpsdk_common")
 Redirect fp:common::logging to ROS console.
rclcpp::Time ConvTime (const fpsdk::common::time::Time &time, rcl_clock_type_t clock_type=RCL_ROS_TIME)
 Convert to ROS time (atomic -> POSIX).
fpsdk::common::time::Time ConvTime (const rclcpp::Time &time)
 Convert from ROS time (POSIX -> atomic).
template<typename Ros1MsgT, typename Ros2MsgT>
void Ros1ToRos2 (Ros1MsgT &ros1, Ros2MsgT &ros2)
 Convert ROS1 message to ROS2 message.

Detailed Description

ROS2 types and utils.

Function Documentation

◆ RedirectLoggingToRosConsole()

void fpsdk::common::ros2::RedirectLoggingToRosConsole ( const char * logger_name = "fpsdk_common")

Redirect fp:common::logging to ROS console.

This configures the fpsdk::common::logging facility to output via the ROS console. This does not configure the ROS console (logger level, logger name, etc.).

The mapping of fpsdk::common::logging::LoggingLevel to rclcpp levels is as follows:

  • TRACE and DEBUG --> DEBUG
  • INFO and NOTICE --> INFO
  • WARNING --> WARN
  • ERROR --> ERROR
  • FATAL --> FATAL
Parameters
[in]logger_nameThe name of the logger. The recommended value is node->get_logger().get_name()

◆ ConvTime() [1/2]

rclcpp::Time fpsdk::common::ros2::ConvTime ( const fpsdk::common::time::Time & time,
rcl_clock_type_t clock_type = RCL_ROS_TIME )

Convert to ROS time (atomic -> POSIX).

Parameters
[in]timeThe Time object (atomic)
[in]clock_typeThe clock to use (to assume)
Returns
the ROS time object (POSIX)

◆ ConvTime() [2/2]

fpsdk::common::time::Time fpsdk::common::ros2::ConvTime ( const rclcpp::Time & time)

Convert from ROS time (POSIX -> atomic).

Parameters
[in]timeThe ROS time object (POSIX)
Returns
the Time object (atomic)

◆ Ros1ToRos2()

template<typename Ros1MsgT, typename Ros2MsgT>
void fpsdk::common::ros2::Ros1ToRos2 ( Ros1MsgT & ros1,
Ros2MsgT & ros2 )

Convert ROS1 message to ROS2 message.

Several conversions in this form are implemented. See the source code for details.

Template Parameters
Ros1MsgTROS1 message type
Ros2MsgTROS2 message type
Parameters
[in]ros1ROS1 message
[out]ros2ROS2 message