26 #ifndef SR_EDC_ETHERCAT_DRIVERS_SR09_H 27 #define SR_EDC_ETHERCAT_DRIVERS_SR09_H 29 #include <ros_ethercat_hardware/ethercat_hardware.h> 30 #include <ros_ethercat_model/robot_state.hpp> 33 #include <std_msgs/Int16.h> 34 #include <std_msgs/Float64MultiArray.h> 35 #include <sr_robot_msgs/SetImuScale.h> 36 #include <sr_robot_msgs/SimpleMotorFlasher.h> 39 #include <boost/smart_ptr.hpp> 42 #include <boost/assign.hpp> 43 #include <boost/algorithm/string.hpp> 44 #include <boost/algorithm/string/find_iterator.hpp> 48 #include <sr_robot_msgs/EthercatDebug.h> 63 virtual void construct(EtherCAT_SlaveHandler *sh,
int &start_address);
65 virtual int initialize(hardware_interface::HardwareInterface *hw,
bool allow_unprogrammed =
true);
67 virtual void multiDiagnostics(vector<diagnostic_msgs::DiagnosticStatus> &vec,
unsigned char *buffer);
69 virtual void packCommand(
unsigned char *buffer,
bool halt,
bool reset);
71 virtual bool unpackState(
unsigned char *this_buffer,
unsigned char *prev_buffer);
94 sr_robot_msgs::SetImuScale::Response &response,
const char *which);
107 ros_ethercat_model::RobotState *
hw_;
122 void readImu(ETHERCAT_DATA_STRUCTURE_0240_PALM_EDC_STATUS * status);
136 #endif // SR_EDC_ETHERCAT_DRIVERS_SR09_H
realtime_tools::RealtimePublisher< std_msgs::Int16 > rt_pub_int16_t
ros::ServiceServer imu_gyr_scale_server_
boost::shared_ptr< shadow_robot::SrMotorHandLib< ETHERCAT_DATA_STRUCTURE_0240_PALM_EDC_STATUS, ETHERCAT_DATA_STRUCTURE_0240_PALM_EDC_COMMAND > > sr_hand_lib
virtual void construct(EtherCAT_SlaveHandler *sh, int &start_address)
Construct function, run at startup to set SyncManagers and FMMUs.
unsigned int zero_buffer_read
ros_ethercat_model::RobotState * hw_
std::vector< boost::shared_ptr< rt_pub_int16_t > > realtime_pub_
ros::ServiceServer imu_acc_scale_server_
virtual void packCommand(unsigned char *buffer, bool halt, bool reset)
packs the commands before sending them to the EtherCAT bus
virtual void multiDiagnostics(vector< diagnostic_msgs::DiagnosticStatus > &vec, unsigned char *buffer)
This function gives some diagnostics data.
virtual void reinitialize_boards()
This function will call the reinitialization function for the boards attached to the CAN bus...
virtual void get_board_id_and_can_bus(int board_id, int *can_bus, unsigned int *board_can_id)
boost::shared_ptr< realtime_tools::RealtimePublisher< sr_robot_msgs::EthercatDebug > > debug_publisher
Debug real time publisher: publishes the raw ethercat data.
virtual bool unpackState(unsigned char *this_buffer, unsigned char *prev_buffer)
This functions receives data from the EtherCAT bus.
virtual int initialize(hardware_interface::HardwareInterface *hw, bool allow_unprogrammed=true)
SR09()
Constructor of the SR09 driver.
void readImu(ETHERCAT_DATA_STRUCTURE_0240_PALM_EDC_STATUS *status)
This funcion reads the ethercat status and fills the imu_state with the relevant values.
ros_ethercat_model::ImuState * imu_state_
boost::shared_ptr< realtime_tools::RealtimePublisher< std_msgs::Float64MultiArray > > extra_analog_inputs_publisher
Extra analog inputs real time publisher (+ accelerometer and gyroscope)
This is a parent class for the ROS drivers for any Shadow Robot EtherCAT Dual CAN Slave...
bool imu_scale_callback_(sr_robot_msgs::SetImuScale::Request &request, sr_robot_msgs::SetImuScale::Response &response, const char *which)