Public Member Functions | Protected Attributes | List of all members
sr_edc_ethercat_drivers::MotorTraceBuffer Class Reference

Class to buffer and publish previous 1-second of motor data. More...

#include <motor_trace_buffer.h>

Inheritance diagram for sr_edc_ethercat_drivers::MotorTraceBuffer:
Inheritance graph
[legend]

Public Member Functions

void checkPublish ()
 Publishes motor trace if delay time is up. More...
 
void flagPublish (const std::string &reason, int level, int delay)
 flags delayed publish of motor trace. More...
 
bool initialize (const sr_edc_ethercat_drivers::ActuatorInfo &actuator_info)
 Initializes motor trace publisher. More...
 
 MotorTraceBuffer (unsigned trace_size)
 
void reset ()
 
void sample (const sr_edc_ethercat_drivers::MotorTraceSample &s)
 Adds sample to motor trace. More...
 

Protected Attributes

int publish_delay_
 
int publish_level_
 
std::string publish_reason_
 
unsigned published_traces_
 
realtime_tools::RealtimePublisher< sr_edc_ethercat_drivers::MotorTrace > * publisher_
 
std::vector< sr_edc_ethercat_drivers::MotorTraceSample > trace_buffer_
 
unsigned trace_index_
 
unsigned trace_size_
 

Detailed Description

Class to buffer and publish previous 1-second of motor data.

Data is sampled with each cycle of realtime loop so that there is too much data to be published continuouly. Instead of continuously publishing data, the trace buffers the previous X seconds of samples. Publishing can be triggered as result of event or request.

Definition at line 49 of file motor_trace_buffer.h.

Constructor & Destructor Documentation

◆ MotorTraceBuffer()

sr_edc_ethercat_drivers::MotorTraceBuffer::MotorTraceBuffer ( unsigned  trace_size)
explicit

Definition at line 35 of file motor_trace_buffer.cpp.

Member Function Documentation

◆ checkPublish()

void sr_edc_ethercat_drivers::MotorTraceBuffer::checkPublish ( )

Publishes motor trace if delay time is up.

Definition at line 79 of file motor_trace_buffer.cpp.

◆ flagPublish()

void sr_edc_ethercat_drivers::MotorTraceBuffer::flagPublish ( const std::string &  reason,
int  level,
int  delay 
)

flags delayed publish of motor trace.

New publish will only take precedence of previous publish iff level is higher than previous level

Definition at line 125 of file motor_trace_buffer.cpp.

◆ initialize()

bool sr_edc_ethercat_drivers::MotorTraceBuffer::initialize ( const sr_edc_ethercat_drivers::ActuatorInfo &  actuator_info)

Initializes motor trace publisher.

Definition at line 55 of file motor_trace_buffer.cpp.

◆ reset()

void sr_edc_ethercat_drivers::MotorTraceBuffer::reset ( )

Definition at line 45 of file motor_trace_buffer.cpp.

◆ sample()

void sr_edc_ethercat_drivers::MotorTraceBuffer::sample ( const sr_edc_ethercat_drivers::MotorTraceSample &  s)

Adds sample to motor trace.

Definition at line 146 of file motor_trace_buffer.cpp.

Member Data Documentation

◆ publish_delay_

int sr_edc_ethercat_drivers::MotorTraceBuffer::publish_delay_
protected

Definition at line 71 of file motor_trace_buffer.h.

◆ publish_level_

int sr_edc_ethercat_drivers::MotorTraceBuffer::publish_level_
protected

Definition at line 72 of file motor_trace_buffer.h.

◆ publish_reason_

std::string sr_edc_ethercat_drivers::MotorTraceBuffer::publish_reason_
protected

Definition at line 73 of file motor_trace_buffer.h.

◆ published_traces_

unsigned sr_edc_ethercat_drivers::MotorTraceBuffer::published_traces_
protected

Definition at line 68 of file motor_trace_buffer.h.

◆ publisher_

realtime_tools::RealtimePublisher<sr_edc_ethercat_drivers::MotorTrace>* sr_edc_ethercat_drivers::MotorTraceBuffer::publisher_
protected

Definition at line 70 of file motor_trace_buffer.h.

◆ trace_buffer_

std::vector<sr_edc_ethercat_drivers::MotorTraceSample> sr_edc_ethercat_drivers::MotorTraceBuffer::trace_buffer_
protected

Definition at line 69 of file motor_trace_buffer.h.

◆ trace_index_

unsigned sr_edc_ethercat_drivers::MotorTraceBuffer::trace_index_
protected

Definition at line 67 of file motor_trace_buffer.h.

◆ trace_size_

unsigned sr_edc_ethercat_drivers::MotorTraceBuffer::trace_size_
protected

Definition at line 66 of file motor_trace_buffer.h.


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


sr_edc_ethercat_drivers
Author(s): Ugo Cupcic, Yann Sionneau, Toni Oliver
autogenerated on Mon Feb 28 2022 23:50:53