![]() |
Fixposition SDK 0.0.0-heads/main-0-g75e6614
Collection of c++ libraries and apps for use with Fixposition products on Linux
|
ROS1 bag (rosbag) writer. More...
#include <ros1.hpp>
Public Member Functions | |
| BagWriter (const BagWriter &)=delete | |
| No copy. | |
| BagWriter & | operator= (const BagWriter &)=delete |
| No copy. | |
| bool | Open (const std::string &path, const int compress=0) |
| Open bag for writing. | |
| void | Close () |
| Close bag. | |
| template<typename T> | |
| bool | WriteMessage (const T &msg, const std::string &topic, const time::RosTime &time={}) |
| Write a message to the bag. | |
| template<typename T> | |
| bool | WriteMessage (const T &msg, const std::string &topic, const ros::Time &time) |
| Write a message to the bag. | |
| void | AddMsgDef (const fpl::RosMsgDef &rosmsgdef) |
| Add ROS message definition from .fpl. | |
| bool | WriteMessage (const fpl::RosMsgBin &rosmsgbin) |
| Write message from .fpl. | |
ROS1 bag (rosbag) writer.
This writes ROS1 bag files (rosbag format version 2.0). Unlike the rosbag library from ROS1 this does not need ROS and therefore it works in all builds of the SDK (with ROS1, with ROS2, and without any ROS). Messages can either be given as ROS1 message objects (see WriteMessage()) or as already serialised data from a .fpl logfile (see AddMsgDef() and WriteMessage()).
Compared to the original rosbag library this implementation has some limitations:
The resulting bags are valid rosbag version 2.0 files and can be read by any ROS1 tool (rosbag info, rosbag play, rqt_bag, ...) as well as other tools that understand the format.
| bool fpsdk::common::ros1::BagWriter::Open | ( | const std::string & | path, |
| const int | compress = 0 ) |
Open bag for writing.
| [in] | path | Path/filename of the bag file (an existing file is overwritten) |
| [in] | compress | Compress bag, 0 = no compression, 1+ = BZ2 (if compiled in) |
| void fpsdk::common::ros1::BagWriter::Close | ( | ) |
Close bag.
|
inline |
Write a message to the bag.
| T | ROS message type |
| [in] | msg | The message |
| [in] | topic | Topic name |
| [in] | time | Bag record time |
Definition at line 214 of file ros1.hpp.
Referenced by WriteMessage().
|
inline |
Write a message to the bag.
| T | ROS message type |
| [in] | msg | The message |
| [in] | topic | Topic name |
| [in] | time | Bag record time |
Definition at line 237 of file ros1.hpp.
References WriteMessage().
| void fpsdk::common::ros1::BagWriter::AddMsgDef | ( | const fpl::RosMsgDef & | rosmsgdef | ) |
Add ROS message definition from .fpl.
| [in] | rosmsgdef | The message definition |
| bool fpsdk::common::ros1::BagWriter::WriteMessage | ( | const fpl::RosMsgBin & | rosmsgbin | ) |
Write message from .fpl.
| [in] | rosmsgbin | The recorded message |