3 #ifndef ETHERCAT_HARDWARE_MOTOR_MODEL_H 4 #define ETHERCAT_HARDWARE_MOTOR_MODEL_H 10 #include <ethercat_hardware/MotorTraceSample.h> 11 #include <ethercat_hardware/MotorTrace.h> 12 #include <ethercat_hardware/ActuatorInfo.h> 13 #include <ethercat_hardware/BoardInfo.h> 17 #include <boost/utility.hpp> 18 #include <boost/thread/mutex.hpp> 24 bool initialize(
const ethercat_hardware::ActuatorInfo &actuator_info,
25 const ethercat_hardware::BoardInfo &board_info);
26 void flagPublish(
const std::string &reason,
int level,
int delay);
29 void sample(
const ethercat_hardware::MotorTraceSample &
s);
55 void sample(
double value,
double filter_coefficient);
66 Filter(
double filter_coefficient);
69 double filter_max()
const {
return max_filtered_value_; }
boost::mutex diagnostics_mutex_
bool verify()
Check for errors between sample data and motor model.
double current_error_limit_
void sample(double value, double filter_coefficient)
Updates filter with newly sampled value.
double max_filtered_value_
Filter abs_position_delta_
Filter abs_measured_voltage_error_
ethercat_hardware::BoardInfo board_info_
unsigned published_traces_
Filter motor_voltage_error_
double filter_max() const
Filter abs_measured_current_
void diagnostics(diagnostic_updater::DiagnosticStatusWrapper &d)
Collects and publishes device diagnostics.
SimpleFilter motor_resistance_
realtime_tools::RealtimePublisher< ethercat_hardware::MotorTrace > * publisher_
double filter_coefficient_
std::string diagnostics_reason_
Filter measured_voltage_error_
void sample(const ethercat_hardware::MotorTraceSample &s)
Call for each update.
bool initialize(const ethercat_hardware::ActuatorInfo &actuator_info, const ethercat_hardware::BoardInfo &board_info)
Initializes motor trace publisher.
Filter abs_board_voltage_
Filter abs_motor_voltage_error_
std::vector< ethercat_hardware::MotorTraceSample > trace_buffer_
bool previous_pwm_saturated_
void checkPublish()
Publishes motor trace if delay time is up.
void flagPublish(const std::string &reason, int level, int delay)
flags delayed publish of motor trace.
std::string publish_reason_
ethercat_hardware::ActuatorInfo actuator_info_
MotorModel(unsigned trace_size)
Filter abs_current_error_