18 #ifndef BASIC_EVENT_RECORDER_HPP
19 #define BASIC_EVENT_RECORDER_HPP
25 #include "../helpers/recorder_helpers.hpp"
51 inline std::string
topic()
const
71 virtual void write(
const T& msg)
73 if (!msg.header.stamp.isZero()) {
74 gr_->write(
topic_, msg, msg.header.stamp);
83 boost::mutex::scoped_lock lock_write_buffer(
mutex_ );
85 typename std::list<T>::iterator it;
88 if (!it->header.stamp.isZero()) {
89 gr_->write(
topic_, *it, it->header.stamp);
99 boost::mutex::scoped_lock lock_bufferize(
mutex_ );
100 typename std::list<T>::iterator it;
106 virtual void reset(boost::shared_ptr<GlobalRecorder> gr,
float conv_frequency)
114 boost::mutex::scoped_lock lock_bufferize(
mutex_ );
121 ros::Duration d( ros::Time::now() - msg.header.stamp );
131 ros::Duration d( time - msg.header.stamp );
165 boost::shared_ptr<naoqi::recorder::GlobalRecorder>
gr_;
void subscribe(bool state)
Definition: basic_event.hpp:61
virtual void writeDump(const ros::Time &time)
Definition: basic_event.hpp:81
bool isTooOld(const T &msg)
Definition: basic_event.hpp:119
BasicEventRecorder(const std::string &topic)
Definition: basic_event.hpp:42
bool is_initialized_
Definition: basic_event.hpp:162
boost::mutex mutex_
Definition: basic_event.hpp:160
boost::shared_ptr< naoqi::recorder::GlobalRecorder > gr_
Definition: basic_event.hpp:165
virtual void write(const T &msg)
Definition: basic_event.hpp:71
bool isInitialized() const
Definition: basic_event.hpp:56
bool isOlderThan(const T &msg, const ros::Time &time)
Definition: basic_event.hpp:129
virtual void reset(boost::shared_ptr< GlobalRecorder > gr, float conv_frequency)
Definition: basic_event.hpp:106
std::list< T > buffer_
Definition: basic_event.hpp:158
std::string topic_
Definition: basic_event.hpp:156
float buffer_duration_
Definition: basic_event.hpp:159
std::string topic() const
Definition: basic_event.hpp:51
bool is_subscribed_
Definition: basic_event.hpp:163
Definition: basic_event.hpp:38
bool isSubscribed() const
Definition: basic_event.hpp:66
virtual void bufferize(const T &msg)
Definition: basic_event.hpp:97
static const float bufferDefaultDuration
Definition: recorder_helpers.hpp:29
void removeOld()
Definition: basic_event.hpp:139
void removeOlderThan(const ros::Time &time)
Definition: basic_event.hpp:147
virtual ~BasicEventRecorder()
Definition: basic_event.hpp:49
virtual void setBufferDuration(float duration)
Definition: basic_event.hpp:112