35 #ifndef ETHERCAT_HARDWARE_WG06_H 36 #define ETHERCAT_HARDWARE_WG06_H 42 #include <pr2_msgs/PressureState.h> 43 #include <pr2_msgs/AccelerometerState.h> 44 #include <ethercat_hardware/RawFTData.h> 45 #include <geometry_msgs/WrenchStamped.h> 72 static const unsigned SIZE=61;
82 static const unsigned SIZE=16;
91 const double &
calibration_coeff(
unsigned row,
unsigned col)
const {
return calibration_coeff_[row*6 + col];}
92 double &
calibration_coeff(
unsigned row,
unsigned col) {
return calibration_coeff_[row*6 + col];}
94 const double &
offset(
unsigned ch_num)
const {
return offsets_[ch_num];}
95 double &
offset(
unsigned ch_num) {
return offsets_[ch_num];}
97 const double &
gain(
unsigned ch_num)
const {
return gains_[ch_num];}
98 double &
gain(
unsigned ch_num) {
return gains_[ch_num];}
103 bool getDoubleArray(
XmlRpc::XmlRpcValue params,
const char* name,
double *results,
unsigned len);
104 double calibration_coeff_[36];
138 static const unsigned SIZE=129;
158 static const unsigned SIZE=513;
169 void construct(EtherCAT_SlaveHandler *sh,
int &start_address);
170 void packCommand(
unsigned char *buffer,
bool halt,
bool reset);
171 bool unpackState(
unsigned char *this_buffer,
unsigned char *prev_buffer);
173 virtual void multiDiagnostics(vector<diagnostic_msgs::DiagnosticStatus> &vec,
unsigned char *buffer);
176 PRODUCT_CODE = 6805006
180 static const unsigned PRESSURE_PHY_ADDR = 0x2200;
181 static const unsigned BIG_PRESSURE_PHY_ADDR = 0x2600;
189 bool initializeSoftProcessor();
191 bool unpackPressure(
unsigned char* pressure_buf);
212 static const unsigned NUM_PRESSURE_REGIONS = 22;
217 void convertFTDataSampleToWrench(
const FTDataSample &sample, geometry_msgs::Wrench &wrench);
218 static const unsigned MAX_FT_SAMPLES = 4;
219 static const unsigned NUM_FT_CHANNELS = 6;
220 static const int FT_VHALF_IDEAL = 32768;
221 static const int FT_VHALF_RANGE = 300;
realtime_tools::RealtimePublisher< geometry_msgs::WrenchStamped > * ft_publisher_
WGSoftProcessor soft_processor_
realtime_tools::RealtimePublisher< ethercat_hardware::RawFTData > * raw_ft_publisher_
Realtime Publisher of RAW F/T data.
const double & offset(unsigned ch_num) const
unsigned pressure_size_
Size in bytes of pressure data region.
double & gain(unsigned ch_num)
ROSCONSOLE_DECL void initialize()
const double & gain(unsigned ch_num) const
bool pressure_checksum_error_
Set true where checksum error on pressure data is detected, cleared on reset.
bool ft_vhalf_error_
error with Vhalf reference voltage
ros::Time last_publish_time_
Time diagnostics was last published.
uint16_t bridge_temperature_
realtime_tools::RealtimePublisher< pr2_msgs::PressureState > * pressure_publisher_
int32_t encoder_index_pos_
int ft_overload_limit_
Limit on raw range of F/T input.
unsigned accelerometer_samples_
Number of accelerometer samples since last publish cycle.
uint64_t ft_sample_count_
Counts number of ft sensor samples.
bool enable_pressure_sensor_
uint16_t bridge_temperature_
unsigned accelerometer_missed_samples_
Total of accelerometer samples that were missed.
unsigned pressure_checksum_error_count_
debugging
ROSCONSOLE_DECL void print(FilterBase *filter, void *logger, Level level, const char *file, int line, const char *function, const char *fmt,...) ROSCONSOLE_PRINTF_ATTRIBUTE(7
static const unsigned SIZE
FTParamsInternal ft_params_
pr2_hardware_interface::ForceTorque force_torque_
Provides F/T data to controllers.
const double & calibration_coeff(unsigned row, unsigned col) const
class FTParamsInternal __attribute__
int16_t programmed_current_
uint64_t ft_missed_samples_
Counts number of ft sensor samples that were missed.
pr2_hardware_interface::AnalogIn ft_raw_analog_in_
bool ft_disconnected_
f/t sensor may be disconnected
uint64_t diag_last_ft_sample_count_
F/T Sample count last time diagnostics was published.
int32_t encoder_index_pos_
uint16_t num_encoder_errors_
int16_t measured_current_
pr2_hardware_interface::Accelerometer accelerometer_
int16_t programmed_pwm_value_
uint16_t board_temperature_
bool has_accel_and_ft_
True if device has accelerometer and force/torque sensor.
int16_t programmed_pwm_value_
realtime_tools::RealtimePublisher< pr2_msgs::AccelerometerState > * accel_publisher_
uint16_t r_finger_tip_[22]
uint8_t ft_overload_flags_
Bits 0-5 set to true if raw FT input goes beyond limit.
uint16_t num_encoder_errors_
uint16_t l_finger_tip_[22]
int16_t programmed_current_
double & calibration_coeff(unsigned row, unsigned col)
int16_t measured_current_
FTDataSample ft_samples_[4]
uint16_t board_temperature_
double & offset(unsigned ch_num)
bool enable_soft_processor_access_
bool ft_sampling_rate_error_
True if FT sampling rate was incorrect.
uint32_t last_pressure_time_