3 #ifndef ROBOWFLEX_IO_BAG_
4 #define ROBOWFLEX_IO_BAG_
11 #include <rosbag/bag.h>
14 #include <rosbag/view.h>
54 bag_.write(topic, ros::Time::now(), msg);
74 rosbag::View view(
bag_, rosbag::TopicQuery(topics));
75 for (
auto &msg : view)
77 typename T::ConstPtr ptr = msg.instantiate<T>();
rosbag management class to ease message saving and loading.
~Bag()
Destructor. Closes opened bag.
const std::string file_
File opened.
const Mode mode_
Mode to open file in.
Bag(const std::string &file, Mode mode=WRITE)
Constructor.
rosbag::Bag bag_
rosbag opened.
bool addMessage(const std::string &topic, const T &msg)
Adds a message to the bag under topic.
std::vector< T > getMessages(const std::vector< std::string > &topics)
Gets messages from an opened bag. Returns all messages of type T from a list of topics topics.
T emplace_back(T... args)
#define ROBOWFLEX_PUSH_DISABLE_GCC_WARNING(warning)
#define ROBOWFLEX_POP_GCC
Main namespace. Contains all library classes and functions.