35 #ifndef ROSBAG_RECORDER_H 36 #define ROSBAG_RECORDER_H 39 #if !defined(_MSC_VER) 50 #include <boost/thread/condition.hpp> 51 #include <boost/thread/mutex.hpp> 52 #include <boost/regex.hpp> 57 #include <std_msgs/Empty.h> 58 #include <std_msgs/String.h> 86 OutgoingQueue(std::string _filename, std::shared_ptr<std::queue<OutgoingMessage>> _queue,
ros::Time _time);
89 std::shared_ptr<std::queue<OutgoingMessage>>
queue;
98 bool record_all {
false};
100 bool do_exclude {
false};
102 bool append_date {
true};
103 bool snapshot {
false};
104 bool verbose {
false};
105 bool publish {
false};
107 std::string prefix {
""};
108 std::string name {
""};
109 boost::regex exclude_regex {};
110 uint32_t buffer_size {1048576 * 256};
111 uint32_t chunk_size {1024 * 768};
114 uint64_t max_size {0};
115 uint32_t max_splits {0};
117 std::string node {
""};
118 uint64_t min_space {1024 * 1024 * 1024};
119 std::string min_space_str {
"1G"};
132 bool IsSubscribed(std::string
const& topic)
const;
141 void UpdateFilenames();
146 bool ScheduledCheckDisk();
149 void SnapshotTrigger(std_msgs::Empty::ConstPtr trigger);
152 std::string
const& topic,
156 void CheckNumSplits();
159 void DoRecordSnapshotter();
162 bool ShouldSubscribeToTopic(std::string
const& topic,
bool from_node =
false);
165 static std::string TimeToStr(T ros_t);
184 std::shared_ptr<std::queue<OutgoingMessage>>
queue_;
ros::WallTime check_disk_next_
uint64_t split_count_
split count
topic_tools::ShapeShifter::ConstPtr msg
std::list< std::string > current_files_
std::shared_ptr< std::queue< OutgoingMessage > > queue
int exit_code_
eventual exit code
std::string target_filename_
std::string write_filename_
boost::mutex queue_mutex_
mutex for queue
ros::Time last_buffer_warn_
std::set< std::string > currently_recording_
set of currenly recording topics
boost::condition_variable_any queue_condition_
conditional variable for queue
uint64_t queue_size_
queue size
std::queue< OutgoingQueue > queue_queue_
queue of queues to be used by the snapshot recorders
std::vector< boost::shared_ptr< ros::Subscriber > > subscribers_
ros::Publisher pub_begin_write_
std::shared_ptr< std::queue< OutgoingMessage > > queue_
queue for storing
boost::mutex check_disk_mutex_
std::vector< std::string > topics
boost::shared_ptr< ros::M_string > connection_header
ros::TransportHints transport_hints