Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
rosbag_snapshot::Snapshotter Class Reference

#include <snapshotter.h>

Public Member Functions

int run ()
 
 Snapshotter (SnapshotterOptions const &options)
 
 ~Snapshotter ()
 

Private Types

typedef std::map< std::string, boost::shared_ptr< MessageQueue > > buffers_t
 

Private Member Functions

void clear ()
 
bool enableCB (std_srvs::SetBool::Request &req, std_srvs::SetBool::Response &res)
 
void fixTopicOptions (SnapshotterTopicOptions &options)
 
void pause ()
 
void pollTopics (ros::TimerEvent const &e, rosbag_snapshot::SnapshotterOptions *options)
 
bool postfixFilename (std::string &file)
 
void publishStatus (ros::TimerEvent const &e)
 
void resume ()
 
void subscribe (std::string const &topic, boost::shared_ptr< MessageQueue > queue)
 
std::string timeAsStr ()
 Return current local datetime as a string such as 2018-05-22-14-28-51. Used to generate bag filenames. More...
 
void topicCB (const ros::MessageEvent< topic_tools::ShapeShifter const > &msg_event, boost::shared_ptr< MessageQueue > queue)
 
bool triggerSnapshotCb (rosbag_snapshot_msgs::TriggerSnapshot::Request &req, rosbag_snapshot_msgs::TriggerSnapshot::Response &res)
 
bool writeTopic (rosbag::Bag &bag, MessageQueue &message_queue, std::string const &topic, rosbag_snapshot_msgs::TriggerSnapshot::Request &req, rosbag_snapshot_msgs::TriggerSnapshot::Response &res)
 

Private Attributes

buffers_t buffers_
 
ros::ServiceServer enable_server_
 
ros::NodeHandle nh_
 
SnapshotterOptions options_
 
ros::Timer poll_topic_timer_
 
bool recording_
 
boost::upgrade_mutex state_lock_
 
ros::Publisher status_pub_
 
ros::Timer status_timer_
 
ros::ServiceServer trigger_snapshot_server_
 
bool writing_
 

Detailed Description

Definition at line 230 of file snapshotter.h.

Member Typedef Documentation

◆ buffers_t

Definition at line 241 of file snapshotter.h.

Constructor & Destructor Documentation

◆ Snapshotter()

rosbag_snapshot::Snapshotter::Snapshotter ( SnapshotterOptions const &  options)
explicit

Definition at line 245 of file snapshotter.cpp.

◆ ~Snapshotter()

rosbag_snapshot::Snapshotter::~Snapshotter ( )

Definition at line 250 of file snapshotter.cpp.

Member Function Documentation

◆ clear()

void rosbag_snapshot::Snapshotter::clear ( )
private

Definition at line 478 of file snapshotter.cpp.

◆ enableCB()

bool rosbag_snapshot::Snapshotter::enableCB ( std_srvs::SetBool::Request &  req,
std_srvs::SetBool::Response &  res 
)
private

Definition at line 503 of file snapshotter.cpp.

◆ fixTopicOptions()

void rosbag_snapshot::Snapshotter::fixTopicOptions ( SnapshotterTopicOptions options)
private

Definition at line 260 of file snapshotter.cpp.

◆ pause()

void rosbag_snapshot::Snapshotter::pause ( )
private

Definition at line 486 of file snapshotter.cpp.

◆ pollTopics()

void rosbag_snapshot::Snapshotter::pollTopics ( ros::TimerEvent const &  e,
rosbag_snapshot::SnapshotterOptions options 
)
private

Definition at line 554 of file snapshotter.cpp.

◆ postfixFilename()

bool rosbag_snapshot::Snapshotter::postfixFilename ( std::string &  file)
private

Definition at line 270 of file snapshotter.cpp.

◆ publishStatus()

void rosbag_snapshot::Snapshotter::publishStatus ( ros::TimerEvent const &  e)
private

Definition at line 527 of file snapshotter.cpp.

◆ resume()

void rosbag_snapshot::Snapshotter::resume ( )
private

Definition at line 492 of file snapshotter.cpp.

◆ run()

int rosbag_snapshot::Snapshotter::run ( )

Definition at line 581 of file snapshotter.cpp.

◆ subscribe()

void rosbag_snapshot::Snapshotter::subscribe ( std::string const &  topic,
boost::shared_ptr< MessageQueue queue 
)
private

Definition at line 310 of file snapshotter.cpp.

◆ timeAsStr()

string rosbag_snapshot::Snapshotter::timeAsStr ( )
private

Return current local datetime as a string such as 2018-05-22-14-28-51. Used to generate bag filenames.

Definition at line 283 of file snapshotter.cpp.

◆ topicCB()

void rosbag_snapshot::Snapshotter::topicCB ( const ros::MessageEvent< topic_tools::ShapeShifter const > &  msg_event,
boost::shared_ptr< MessageQueue queue 
)
private

Definition at line 293 of file snapshotter.cpp.

◆ triggerSnapshotCb()

bool rosbag_snapshot::Snapshotter::triggerSnapshotCb ( rosbag_snapshot_msgs::TriggerSnapshot::Request &  req,
rosbag_snapshot_msgs::TriggerSnapshot::Response &  res 
)
private

Definition at line 385 of file snapshotter.cpp.

◆ writeTopic()

bool rosbag_snapshot::Snapshotter::writeTopic ( rosbag::Bag bag,
MessageQueue message_queue,
std::string const &  topic,
rosbag_snapshot_msgs::TriggerSnapshot::Request &  req,
rosbag_snapshot_msgs::TriggerSnapshot::Response &  res 
)
private

Definition at line 327 of file snapshotter.cpp.

Member Data Documentation

◆ buffers_

buffers_t rosbag_snapshot::Snapshotter::buffers_
private

Definition at line 242 of file snapshotter.h.

◆ enable_server_

ros::ServiceServer rosbag_snapshot::Snapshotter::enable_server_
private

Definition at line 251 of file snapshotter.h.

◆ nh_

ros::NodeHandle rosbag_snapshot::Snapshotter::nh_
private

Definition at line 249 of file snapshotter.h.

◆ options_

SnapshotterOptions rosbag_snapshot::Snapshotter::options_
private

Definition at line 240 of file snapshotter.h.

◆ poll_topic_timer_

ros::Timer rosbag_snapshot::Snapshotter::poll_topic_timer_
private

Definition at line 254 of file snapshotter.h.

◆ recording_

bool rosbag_snapshot::Snapshotter::recording_
private

Definition at line 246 of file snapshotter.h.

◆ state_lock_

boost::upgrade_mutex rosbag_snapshot::Snapshotter::state_lock_
private

Definition at line 244 of file snapshotter.h.

◆ status_pub_

ros::Publisher rosbag_snapshot::Snapshotter::status_pub_
private

Definition at line 252 of file snapshotter.h.

◆ status_timer_

ros::Timer rosbag_snapshot::Snapshotter::status_timer_
private

Definition at line 253 of file snapshotter.h.

◆ trigger_snapshot_server_

ros::ServiceServer rosbag_snapshot::Snapshotter::trigger_snapshot_server_
private

Definition at line 250 of file snapshotter.h.

◆ writing_

bool rosbag_snapshot::Snapshotter::writing_
private

Definition at line 248 of file snapshotter.h.


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


rosbag_snapshot
Author(s): Kevin Allen
autogenerated on Wed May 14 2025 02:13:18