Go to the documentation of this file.
35 #ifndef ETHERCAT_HARDWARE__WG0X_H
36 #define ETHERCAT_HARDWARE__WG0X_H
45 #include <boost/shared_ptr.hpp>
142 char robot_name_[32];
143 char motor_make_[32];
144 char motor_model_[32];
237 void construct(EtherCAT_SlaveHandler *sh,
int &start_address);
243 void packCommand(
unsigned char *buffer,
bool halt,
bool reset);
244 bool unpackState(
unsigned char *this_buffer,
unsigned char *prev_buffer);
255 bool publishTrace(
const string &reason,
unsigned level,
unsigned delay);
268 static void copyActuatorInfo(ethercat_hardware::ActuatorInfo &out,
const WG0XActuatorInfo &in);
276 MODE_ENABLE = (1 << 0),
277 MODE_CURRENT = (1 << 1),
278 MODE_SAFETY_RESET = (1 << 4),
279 MODE_SAFETY_LOCKOUT = (1 << 5),
280 MODE_UNDERVOLTAGE = (1 << 6),
281 MODE_RESET = (1 << 7)
286 WG05_PRODUCT_CODE = 6805005,
287 WG06_PRODUCT_CODE = 6805006,
288 WG021_PRODUCT_CODE = 6805021
291 static string modeString(uint8_t
mode);
292 static string safetyDisableString(uint8_t
status);
303 void clearErrorFlags(
void);
306 enum {NO_CALIBRATION=0, CONTROLLER_CALIBRATION=1, SAVED_CALIBRATION=2};
323 enum AppRamStatus { APP_RAM_PRESENT=1, APP_RAM_MISSING=2, APP_RAM_NOT_APPLICABLE=3 };
325 bool readAppRam(
EthercatCom *com,
double &zero_offset);
326 bool writeAppRam(
EthercatCom *com,
double zero_offset);
330 int writeMailbox(
EthercatCom *com,
unsigned address,
void const *data,
unsigned length);
331 int readMailbox(
EthercatCom *com,
unsigned address,
void *data,
unsigned length);
337 const string &device_description,
338 double max_pwm_ratio,
339 double board_resistance,
340 bool poor_measured_motor_voltage);
342 bool initializeMotorHeatingModel(
bool allow_unprogrammed);
345 static bool timestamp_jump(uint32_t timestamp, uint32_t last_timestamp, uint32_t amount);
347 static const int PWM_MAX = 0x4000;
356 static const unsigned COMMAND_PHY_ADDR = 0x1000;
357 static const unsigned STATUS_PHY_ADDR = 0x2000;
359 static const unsigned PDO_COMMAND_SYNCMAN_NUM = 0;
360 static const unsigned PDO_STATUS_SYNCMAN_NUM = 1;
364 LIMIT_SENSOR_0_STATE = (1 << 0),
365 LIMIT_SENSOR_1_STATE = (1 << 1),
366 LIMIT_ON_TO_OFF = (1 << 2),
367 LIMIT_OFF_TO_ON = (1 << 3)
372 SAFETY_DISABLED = (1 << 0),
373 SAFETY_UNDERVOLTAGE = (1 << 1),
374 SAFETY_OVER_CURRENT = (1 << 2),
375 SAFETY_BOARD_OVER_TEMP = (1 << 3),
376 SAFETY_HBRIDGE_OVER_TEMP = (1 << 4),
377 SAFETY_OPERATIONAL = (1 << 5),
378 SAFETY_WATCHDOG = (1 << 6)
383 static const unsigned ACTUATOR_INFO_PAGE = 4095;
402 bool lockWG0XDiagnostics();
403 bool tryLockWG0XDiagnostics();
404 void unlockWG0XDiagnostics();
410 static int32_t timestampDiff(uint32_t new_timestamp, uint32_t old_timestamp);
411 static int32_t positionDiff(int32_t new_position, int32_t old_position);
413 static ros::Duration timediffToDuration(int32_t timediff_usec);
415 static double calcEncoderVelocity(int32_t new_position, uint32_t new_timestamp,
416 int32_t old_position, uint32_t old_timestamp);
418 static double convertRawTemperature(int16_t raw_temp);
422 #endif // ETHERCAT_HARDWARE__WG0X_H
static const unsigned CONFIG_INFO_BASE_ADDR
uint8_t safety_disable_status_hold_
uint8_t lowside_deadtime_
int16_t programmed_pwm_value_
uint32_t device_serial_number_
ethercat_hardware::WGEeprom eeprom_
Access to device eeprom.
uint16_t max_bridge_temperature_
bool verifyCRC(void) const
uint16_t bridge_temperature_
WG0XActuatorInfo actuator_info_
uint16_t num_encoder_errors_
uint8_t calibration_reading_
uint8_t safety_disable_status_hold_
pthread_mutex_t wg0x_diagnostics_lock_
static boost::shared_ptr< ethercat_hardware::MotorHeatingModelCommon > motor_heating_model_common_
bool verifyChecksum(void) const
uint8_t highside_deadtime_
uint16_t absolute_current_limit_
bool disable_motor_model_checking_
uint16_t board_temperature_
WG0XConfigInfo config_info_
pr2_hardware_interface::Actuator actuator_
bool timestamp_jump_detected_
int32_t last_calibration_rising_edge_
uint8_t firmware_major_revision_
MotorModel * motor_model_
WG0XDiagnostics wg0x_publish_diagnostics_
uint8_t mbx_command_irq_count_
double max_current_
min(board current limit, actuator current limit)
double encoder_reduction_
WG0XDiagnosticsInfo diagnostics_info_
int16_t config_offset_current_B_
int16_t offset_current_B_
double motor_torque_constant_
uint8_t undervoltage_count_
bool status_checksum_error_
boost::shared_ptr< ethercat_hardware::MotorHeatingModel > motor_heating_model_
bool fpga_internal_reset_detected_
static const unsigned BASE_ADDR
uint8_t operate_disable_count_
int16_t config_offset_current_A_
uint8_t safety_disable_status_
AppRamStatus
Different possible states for application ram on device.
uint32_t operate_disable_total_
uint8_t watchdog_disable_count_
uint32_t safety_disable_total_
int32_t last_calibration_falling_edge_
double cached_zero_offset_
AppRamStatus app_ram_status_
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
uint8_t bridge_over_temp_count_
ethercat_hardware::WGMailbox mailbox_
Mailbox access to device.
uint16_t supply_current_out_
pr2_hardware_interface::DigitalOut publish_motor_trace_
int16_t programmed_current_
pr2_hardware_interface::DigitalOut digital_out_
uint32_t board_over_temp_total_
uint8_t over_current_count_
uint8_t pdi_timeout_error_count_
uint16_t supply_current_in_
uint8_t firmware_minor_revision_
int32_t encoder_index_pos_
uint32_t checksum_errors_
uint8_t board_minor_
Printed circuit assembly revision.
uint8_t safety_disable_count_
ethercat_hardware::ActuatorInfo actuator_info_msg_
uint32_t over_current_total_
uint8_t pdi_checksum_error_count_
uint8_t safety_disable_count_
float nominal_current_scale_
uint32_t watchdog_disable_total_
ethercat_hardware::MotorTraceSample motor_trace_sample_
int16_t programmed_current_
ros::Duration sample_timestamp_
int max_consecutive_drops_
bool encoder_errors_detected_
ethercat_hardware::MotorHeatingModelCommon __attribute__
bool too_many_dropped_packets_
ROSCONSOLE_DECL void initialize()
uint8_t board_major_
Printed circuit board revision (for this value 0=='A', 1=='B')
int16_t measured_current_
WG0XSafetyDisableStatus safety_disable_status_
WG0XSafetyDisableCounters safety_disable_counters_
double cached_zero_offset_
uint32_t undervoltage_total_
int16_t offset_current_A_
uint32_t bridge_over_temp_total_
uint8_t safety_disable_status_
uint8_t pdo_command_irq_count_
uint32_t last_last_timestamp_
uint32_t pulses_per_revolution_
uint8_t configuration_status_
float nominal_voltage_scale_
uint8_t board_over_temp_count_
WG0XDiagnostics wg0x_collect_diagnostics_
static const unsigned SIZE
ethercat_hardware
Author(s): Rob Wheeler
, Derek King
autogenerated on Thu Sep 26 2024 02:44:04