Public Member Functions | Private Member Functions | Private Attributes | List of all members
generic_control_toolbox::BagManager Class Reference

#include <bag_manager.hpp>

Public Member Functions

 BagManager (const std::string &path, const std::string &default_topic)
 
template<class T >
void write (const T &msg)
 
template<class T >
void write (const std::string &topic, const T &msg)
 
 ~BagManager ()
 

Private Member Functions

int numOfFiles (const std::string &path) const
 

Private Attributes

rosbag::Bag bag_
 
std::string default_topic_
 

Detailed Description

Produces a rosbag with given message data.

Definition at line 13 of file bag_manager.hpp.

Constructor & Destructor Documentation

◆ BagManager()

generic_control_toolbox::BagManager::BagManager ( const std::string &  path,
const std::string &  default_topic 
)

Open a bag on the given path.

Parameters
pathThe path where to record the bag.
default_topicThe default topic name for the bag to record.

Definition at line 5 of file bag_manager.cpp.

◆ ~BagManager()

generic_control_toolbox::BagManager::~BagManager ( )

Definition at line 16 of file bag_manager.cpp.

Member Function Documentation

◆ numOfFiles()

int generic_control_toolbox::BagManager::numOfFiles ( const std::string &  path) const
private

Returns the number of bag files in the recording directory.

Parameters
pathPath to the recording directory.
Returns
Number of files of extension "*.bag" in the directory.

Definition at line 18 of file bag_manager.cpp.

◆ write() [1/2]

template<class T >
void generic_control_toolbox::BagManager::write ( const T &  msg)

Add a message to the bag file on the default topic.

Parameters
msgThe message to be written.

Definition at line 56 of file bag_manager.hpp.

◆ write() [2/2]

template<class T >
void generic_control_toolbox::BagManager::write ( const std::string &  topic,
const T &  msg 
)

Add a message to the bag file on a given topic.

Parameters
topicThe topic name.
msgThe message to be written.

Definition at line 62 of file bag_manager.hpp.

Member Data Documentation

◆ bag_

rosbag::Bag generic_control_toolbox::BagManager::bag_
private

Definition at line 43 of file bag_manager.hpp.

◆ default_topic_

std::string generic_control_toolbox::BagManager::default_topic_
private

Definition at line 44 of file bag_manager.hpp.


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


generic_control_toolbox
Author(s): diogo
autogenerated on Mon Feb 28 2022 22:24:38