Fixposition SDK 0.0.0-heads/main-0-g97f6014
Collection of c++ libraries and apps for use with Fixposition products on Linux
Loading...
Searching...
No Matches
fpsdk::ros1::bagwriter::BagWriter Class Reference

ROS1 bag writer helper. More...

#include <bagwriter.hpp>

Public Member Functions

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 ros::Time &time)
 Write a message to the bag.
template<typename T>
bool WriteMessage (const T &msg, const std::string &topic, const common::time::RosTime &time={})
 Write a message to the bag.
void AddMsgDef (const common::fpl::RosMsgDef &rosmsgdef)
 Add ROS message definition from .fpl.
bool WriteMessage (const common::fpl::RosMsgBin &rosmsgbin)
 Write message from .fpl.

Detailed Description

ROS1 bag writer helper.

Definition at line 48 of file bagwriter.hpp.

Member Function Documentation

◆ Open()

bool fpsdk::ros1::bagwriter::BagWriter::Open ( const std::string & path,
const int compress = 0 )

Open bag for writing.

Parameters
[in]pathPath/filename of the bag file
[in]compressCompress bag, 0 = no compression, 1 = LZ4, 2+ = BZ2
Returns
true if bag was sucessfully opened

◆ WriteMessage() [1/3]

template<typename T>
bool fpsdk::ros1::bagwriter::BagWriter::WriteMessage ( const T & msg,
const std::string & topic,
const ros::Time & time )
inline

Write a message to the bag.

Template Parameters
TROS message type
Parameters
[in]msgThe message
[in]topicTopic name
[in]timeBag record time
Returns
true if message was added, false otherwise (message definition missing)

Definition at line 80 of file bagwriter.hpp.

References WARNING.

◆ WriteMessage() [2/3]

template<typename T>
bool fpsdk::ros1::bagwriter::BagWriter::WriteMessage ( const T & msg,
const std::string & topic,
const common::time::RosTime & time = {} )
inline

Write a message to the bag.

Template Parameters
TROS message type
Parameters
[in]msgThe message
[in]topicTopic name
[in]timeBag record time
Returns
true if message was added, false otherwise (message definition missing)

Definition at line 105 of file bagwriter.hpp.

◆ AddMsgDef()

void fpsdk::ros1::bagwriter::BagWriter::AddMsgDef ( const common::fpl::RosMsgDef & rosmsgdef)

Add ROS message definition from .fpl.

Note
No checks on the provided data are done!
Parameters
[in]rosmsgdefThe message definition

◆ WriteMessage() [3/3]

bool fpsdk::ros1::bagwriter::BagWriter::WriteMessage ( const common::fpl::RosMsgBin & rosmsgbin)

Write message from .fpl.

Note
No checks on the provided data are done!
Parameters
[in]rosmsgbinThe recorded message
Returns
true if message was added, false otherwise (message definition missing)

The documentation for this class was generated from the following file: