18#ifndef __FPSDK_ROS2_BAGWRITER_HPP__
19#define __FPSDK_ROS2_BAGWRITER_HPP__
24#include "fpsdk_ros2/ext/rosbag2_cpp_writer.hpp"
58 bool Open(
const std::string& path,
const int compress = 0);
76 bool WriteMessage(
const T& msg,
const std::string& topic,
const rclcpp::Time& time)
81 bag_->write(msg, topic, time);
84 }
catch (
const std::exception& ex) {
85 WARNING(
"BagWriter: write fail: %s", ex.what());
125 std::unique_ptr<rosbag2_cpp::Writer> bag_;
126 std::map<std::string, common::fpl::RosMsgDef> defs_;
bool WriteMessage(const T &msg, const std::string &topic, const common::time::RosTime &time)
Write a message to the bag.
bool WriteMessage(const common::fpl::RosMsgBin &rosmsgbin)
Write message from .fpl.
void AddMsgDef(const common::fpl::RosMsgDef &rosmsgdef)
Add ROS message definition from .fpl.
bool WriteMessage(const T &msg, const std::string &topic, const rclcpp::Time &time)
Write a message to the bag.
bool Open(const std::string &path, const int compress=0)
Open bag for writing.
Fixposition SDK: .fpl utilities.
#define WARNING(...)
Print a warning message.
Fixposition SDK: ROS2 library.
Helper for extracting a serialised ROS message.
Helper for extracting ROS message definition (the relevant fields from the "connection header")
Minimal ros::Time() / rplcpp::Time implementation (that doesn't throw)
uint32_t nsec_
Nanoseconds part of time (should be in range 0-999999999)
uint32_t sec_
Seconds part of time.
Fixposition SDK: Time utilities.