Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
shadow_robot::SrMotorRobotLib< StatusType, CommandType > Class Template Referenceabstract

#include <sr_motor_robot_lib.hpp>

Inheritance diagram for shadow_robot::SrMotorRobotLib< StatusType, CommandType >:
Inheritance graph
[legend]

Public Member Functions

void add_diagnostics (std::vector< diagnostic_msgs::DiagnosticStatus > &vec, diagnostic_updater::DiagnosticStatusWrapper &d)
 
void build_command (CommandType *command)
 
void reinitialize_motors ()
 
 SrMotorRobotLib (hardware_interface::HardwareInterface *hw, ros::NodeHandle nh, ros::NodeHandle nhtilde, std::string device_id, std::string joint_prefix)
 
void update (StatusType *status_data)
 
- Public Member Functions inherited from shadow_robot::SrRobotLib< StatusType, CommandType >
void build_tactile_command (CommandType *command)
 
bool nullify_demand_callback (sr_robot_msgs::NullifyDemand::Request &request, sr_robot_msgs::NullifyDemand::Response &response)
 
void reinitialize_sensors ()
 
 SrRobotLib (hardware_interface::HardwareInterface *hw, ros::NodeHandle nh, ros::NodeHandle nhtilde, std::string device_id, std::string joint_prefix)
 
void update_tactile_info (StatusType *status)
 
virtual ~SrRobotLib ()
 

Public Attributes

operation_mode::device_update_state::DeviceUpdateState motor_current_state
 
- Public Attributes inherited from shadow_robot::SrRobotLib< StatusType, CommandType >
shadow_joints::CalibrationMap calibration_map
 The map used to calibrate each joint. More...
 
CoupledJointMapType coupled_calibration_map
 
ros_ethercat_model::RobotState * hw_
 
boost::shared_ptr< boost::mutex > lock_tactile_init_timeout_
 A mutual exclusion object to ensure that the intitialization timeout event does work without threading issues. More...
 
int main_pic_idle_time
 
int main_pic_idle_time_min
 
ros::Timer tactile_check_init_timeout_timer
 
operation_mode::device_update_state::DeviceUpdateState tactile_current_state
 
ros::Duration tactile_init_max_duration
 
boost::shared_ptr< tactiles::GenericTactiles< StatusType, CommandType > > tactiles
 
boost::shared_ptr< tactiles::GenericTactiles< StatusType, CommandType > > tactiles_init
 

Protected Types

typedef std::pair< int, std::vector< crc_unions::union16 > > ForceConfig
 

Protected Member Functions

void calibrate_joint (std::vector< shadow_joints::Joint >::iterator joint_tmp, StatusType *status_data)
 
bool change_control_parameters (int16_t control_type)
 
bool change_control_type_callback_ (sr_robot_msgs::ChangeControlType::Request &request, sr_robot_msgs::ChangeControlType::Response &response)
 
bool check_if_joint_coupled (string joint_name)
 
int find_joint_by_name (string joint_name)
 
void generate_force_control_config (int motor_index, int max_pwm, int sg_left, int sg_right, int f, int p, int i, int d, int imax, int deadband, int sign, int torque_limit, int torque_limiter_gain)
 
sr_actuator::SrMotorActuator * get_joint_actuator (std::vector< shadow_joints::Joint >::iterator joint_tmp)
 
std::vector< std::pair< std::string, bool > > humanize_flags (int flag)
 
virtual void initialize (std::vector< std::string > joint_names, std::vector< int > actuator_ids, std::vector< shadow_joints::JointToSensor > joint_to_sensors)=0
 
bool motor_system_controls_callback_ (sr_robot_msgs::ChangeMotorSystemControls::Request &request, sr_robot_msgs::ChangeMotorSystemControls::Response &response)
 
void process_position_sensor_data (std::vector< shadow_joints::Joint >::iterator joint_tmp, StatusType *status_data, double timestamp)
 
void read_additional_data (std::vector< shadow_joints::Joint >::iterator joint_tmp, StatusType *status_data)
 
- Protected Member Functions inherited from shadow_robot::SrRobotLib< StatusType, CommandType >
void checkSelfTests ()
 It is run in a separate thread and calls the checkTests() method of the self_tests_. More...
 
CoupledJointMapType read_coupled_joint_calibration ()
 
shadow_joints::CalibrationMap read_joint_calibration ()
 
std::vector< shadow_joints::JointToSensorread_joint_to_sensor_mapping ()
 
std::vector< generic_updater::UpdateConfigread_update_rate_configs (std::string base_param, int nb_data_defined, const char *human_readable_data_types[], const int32u data_types[])
 
void tactile_init_timer_callback (const ros::TimerEvent &event)
 

Protected Attributes

ros::ServiceServer change_control_type_
 
int config_index
 
sr_robot_msgs::ControlType control_type_
 
bool control_type_changed_flag_
 
int8u crc_byte
 
int8u crc_i
 
int16u crc_result
 
int index_motor_in_msg
 
boost::shared_ptr< boost::mutex > lock_command_sending_
 
boost::shared_ptr< generic_updater::MotorDataCheckermotor_data_checker
 
int motor_index_full
 
std::queue< std::vector< sr_robot_msgs::MotorSystemControls >, std::list< std::vector< sr_robot_msgs::MotorSystemControls > > > motor_system_control_flags_
 
ros::ServiceServer motor_system_control_server_
 
std::vector< generic_updater::UpdateConfigmotor_update_rate_configs_vector
 
boost::shared_ptr< generic_updater::MotorUpdater< CommandType > > motor_updater_
 
std::queue< ForceConfig, std::list< ForceConfig > > reconfig_queue
 
std::queue< int16_t, std::list< int16_t > > reset_motors_queue
 
- Protected Attributes inherited from shadow_robot::SrRobotLib< StatusType, CommandType >
std::vector< generic_updater::UpdateConfigbiotac_sensor_update_rate_configs_vector
 
boost::shared_ptr< shadow_robot::JointCalibration > calibration_tmp
 A temporary calibration for a given joint. More...
 
std::string device_id_
 Id of the ethercat device (alias) More...
 
std::vector< generic_updater::UpdateConfiggeneric_sensor_update_rate_configs_vector
 
std::string joint_prefix_
 Prefix used to access the joints. More...
 
std::vector< shadow_joints::Jointjoints_vector
 The vector containing all the robot joints. More...
 
ros::NodeHandle nh_tilde
 a ROS nodehandle (private naming, only inside the node namespace) to be able to advertise the Force PID service More...
 
ros::NodeHandle nodehandle_
 a ros nodehandle to be able to access resources out of the node namespace More...
 
bool nullify_demand_
 
ros::ServiceServer nullify_demand_server_
 
std::vector< generic_updater::UpdateConfigpst3_sensor_update_rate_configs_vector
 
boost::shared_ptr< boost::thread > self_test_thread_
 
std::vector< generic_updater::UpdateConfigubi0_sensor_update_rate_configs_vector
 

Additional Inherited Members

- Public Types inherited from shadow_robot::SrRobotLib< StatusType, CommandType >
typedef std::map< std::string, CoupledJointCoupledJointMapType
 
- Static Public Attributes inherited from shadow_robot::SrRobotLib< StatusType, CommandType >
static const double tactile_timeout = 10.0
 Timeout handling variables for UBI sensors. More...
 
- Static Protected Attributes inherited from shadow_robot::SrRobotLib< StatusType, CommandType >
static const char * human_readable_sensor_data_types []
 
static const int nb_sensor_data = 37
 
static const int32u sensor_data_types []
 

Detailed Description

template<class StatusType, class CommandType>
class shadow_robot::SrMotorRobotLib< StatusType, CommandType >

Definition at line 49 of file sr_motor_robot_lib.hpp.

Member Typedef Documentation

◆ ForceConfig

template<class StatusType, class CommandType>
typedef std::pair<int, std::vector<crc_unions::union16> > shadow_robot::SrMotorRobotLib< StatusType, CommandType >::ForceConfig
protected

Definition at line 186 of file sr_motor_robot_lib.hpp.

Constructor & Destructor Documentation

◆ SrMotorRobotLib()

template<class StatusType, class CommandType>
shadow_robot::SrMotorRobotLib< StatusType, CommandType >::SrMotorRobotLib ( hardware_interface::HardwareInterface *  hw,
ros::NodeHandle  nh,
ros::NodeHandle  nhtilde,
std::string  device_id,
std::string  joint_prefix 
)

Definition at line 61 of file sr_motor_robot_lib.cpp.

Member Function Documentation

◆ add_diagnostics()

template<class StatusType, class CommandType>
void shadow_robot::SrMotorRobotLib< StatusType, CommandType >::add_diagnostics ( std::vector< diagnostic_msgs::DiagnosticStatus > &  vec,
diagnostic_updater::DiagnosticStatusWrapper d 
)
virtual

◆ build_command()

template<class StatusType , class CommandType>
void shadow_robot::SrMotorRobotLib< StatusType, CommandType >::build_command ( CommandType *  command)
virtual

◆ calibrate_joint()

template<class StatusType, class CommandType>
void shadow_robot::SrMotorRobotLib< StatusType, CommandType >::calibrate_joint ( std::vector< shadow_joints::Joint >::iterator  joint_tmp,
StatusType *  status_data 
)
protectedvirtual

◆ change_control_parameters()

template<class StatusType , class CommandType >
bool shadow_robot::SrMotorRobotLib< StatusType, CommandType >::change_control_parameters ( int16_t  control_type)
protected

Definition at line 1220 of file sr_motor_robot_lib.cpp.

◆ change_control_type_callback_()

template<class StatusType , class CommandType >
bool shadow_robot::SrMotorRobotLib< StatusType, CommandType >::change_control_type_callback_ ( sr_robot_msgs::ChangeControlType::Request &  request,
sr_robot_msgs::ChangeControlType::Response &  response 
)
protected

Definition at line 1165 of file sr_motor_robot_lib.cpp.

◆ check_if_joint_coupled()

template<class StatusType , class CommandType >
bool shadow_robot::SrMotorRobotLib< StatusType, CommandType >::check_if_joint_coupled ( string  joint_name)
protected

Definition at line 1008 of file sr_motor_robot_lib.cpp.

◆ find_joint_by_name()

template<class StatusType , class CommandType >
int shadow_robot::SrMotorRobotLib< StatusType, CommandType >::find_joint_by_name ( string  joint_name)
protected

Definition at line 1330 of file sr_motor_robot_lib.cpp.

◆ generate_force_control_config()

template<class StatusType , class CommandType >
void shadow_robot::SrMotorRobotLib< StatusType, CommandType >::generate_force_control_config ( int  motor_index,
int  max_pwm,
int  sg_left,
int  sg_right,
int  f,
int  p,
int  i,
int  d,
int  imax,
int  deadband,
int  sign,
int  torque_limit,
int  torque_limiter_gain 
)
protected

Definition at line 1064 of file sr_motor_robot_lib.cpp.

◆ get_joint_actuator()

template<class StatusType, class CommandType>
sr_actuator::SrMotorActuator* shadow_robot::SrMotorRobotLib< StatusType, CommandType >::get_joint_actuator ( std::vector< shadow_joints::Joint >::iterator  joint_tmp)
inlineprotectedvirtual

◆ humanize_flags()

template<class StatusType , class CommandType >
vector< pair< string, bool > > shadow_robot::SrMotorRobotLib< StatusType, CommandType >::humanize_flags ( int  flag)
protected

Definition at line 1036 of file sr_motor_robot_lib.cpp.

◆ initialize()

template<class StatusType, class CommandType>
virtual void shadow_robot::SrMotorRobotLib< StatusType, CommandType >::initialize ( std::vector< std::string >  joint_names,
std::vector< int >  actuator_ids,
std::vector< shadow_joints::JointToSensor joint_to_sensors 
)
protectedpure virtual

◆ motor_system_controls_callback_()

template<class StatusType , class CommandType >
bool shadow_robot::SrMotorRobotLib< StatusType, CommandType >::motor_system_controls_callback_ ( sr_robot_msgs::ChangeMotorSystemControls::Request &  request,
sr_robot_msgs::ChangeMotorSystemControls::Response &  response 
)
protected

Definition at line 1296 of file sr_motor_robot_lib.cpp.

◆ process_position_sensor_data()

template<class StatusType, class CommandType>
void shadow_robot::SrMotorRobotLib< StatusType, CommandType >::process_position_sensor_data ( std::vector< shadow_joints::Joint >::iterator  joint_tmp,
StatusType *  status_data,
double  timestamp 
)
protected

Definition at line 1018 of file sr_motor_robot_lib.cpp.

◆ read_additional_data()

template<class StatusType, class CommandType>
void shadow_robot::SrMotorRobotLib< StatusType, CommandType >::read_additional_data ( std::vector< shadow_joints::Joint >::iterator  joint_tmp,
StatusType *  status_data 
)
protected

Definition at line 612 of file sr_motor_robot_lib.cpp.

◆ reinitialize_motors()

template<class StatusType , class CommandType >
void shadow_robot::SrMotorRobotLib< StatusType, CommandType >::reinitialize_motors ( )

Definition at line 1152 of file sr_motor_robot_lib.cpp.

◆ update()

template<class StatusType, class CommandType >
void shadow_robot::SrMotorRobotLib< StatusType, CommandType >::update ( StatusType *  status_data)
virtual

Member Data Documentation

◆ change_control_type_

template<class StatusType, class CommandType>
ros::ServiceServer shadow_robot::SrMotorRobotLib< StatusType, CommandType >::change_control_type_
protected

Definition at line 226 of file sr_motor_robot_lib.hpp.

◆ config_index

template<class StatusType, class CommandType>
int shadow_robot::SrMotorRobotLib< StatusType, CommandType >::config_index
protected

Definition at line 192 of file sr_motor_robot_lib.hpp.

◆ control_type_

template<class StatusType, class CommandType>
sr_robot_msgs::ControlType shadow_robot::SrMotorRobotLib< StatusType, CommandType >::control_type_
protected

Definition at line 215 of file sr_motor_robot_lib.hpp.

◆ control_type_changed_flag_

template<class StatusType, class CommandType>
bool shadow_robot::SrMotorRobotLib< StatusType, CommandType >::control_type_changed_flag_
protected

Definition at line 224 of file sr_motor_robot_lib.hpp.

◆ crc_byte

template<class StatusType, class CommandType>
int8u shadow_robot::SrMotorRobotLib< StatusType, CommandType >::crc_byte
protected

Definition at line 203 of file sr_motor_robot_lib.hpp.

◆ crc_i

template<class StatusType, class CommandType>
int8u shadow_robot::SrMotorRobotLib< StatusType, CommandType >::crc_i
protected

Definition at line 205 of file sr_motor_robot_lib.hpp.

◆ crc_result

template<class StatusType, class CommandType>
int16u shadow_robot::SrMotorRobotLib< StatusType, CommandType >::crc_result
protected

Definition at line 204 of file sr_motor_robot_lib.hpp.

◆ index_motor_in_msg

template<class StatusType, class CommandType>
int shadow_robot::SrMotorRobotLib< StatusType, CommandType >::index_motor_in_msg
protected

Definition at line 201 of file sr_motor_robot_lib.hpp.

◆ lock_command_sending_

template<class StatusType, class CommandType>
boost::shared_ptr<boost::mutex> shadow_robot::SrMotorRobotLib< StatusType, CommandType >::lock_command_sending_
protected

Definition at line 229 of file sr_motor_robot_lib.hpp.

◆ motor_current_state

template<class StatusType, class CommandType>
operation_mode::device_update_state::DeviceUpdateState shadow_robot::SrMotorRobotLib< StatusType, CommandType >::motor_current_state

Definition at line 88 of file sr_motor_robot_lib.hpp.

◆ motor_data_checker

template<class StatusType, class CommandType>
boost::shared_ptr<generic_updater::MotorDataChecker> shadow_robot::SrMotorRobotLib< StatusType, CommandType >::motor_data_checker
protected

Definition at line 211 of file sr_motor_robot_lib.hpp.

◆ motor_index_full

template<class StatusType, class CommandType>
int shadow_robot::SrMotorRobotLib< StatusType, CommandType >::motor_index_full
protected

Definition at line 199 of file sr_motor_robot_lib.hpp.

◆ motor_system_control_flags_

template<class StatusType, class CommandType>
std::queue<std::vector<sr_robot_msgs::MotorSystemControls>, std::list<std::vector<sr_robot_msgs::MotorSystemControls> > > shadow_robot::SrMotorRobotLib< StatusType, CommandType >::motor_system_control_flags_
protected

Definition at line 256 of file sr_motor_robot_lib.hpp.

◆ motor_system_control_server_

template<class StatusType, class CommandType>
ros::ServiceServer shadow_robot::SrMotorRobotLib< StatusType, CommandType >::motor_system_control_server_
protected

Definition at line 258 of file sr_motor_robot_lib.hpp.

◆ motor_update_rate_configs_vector

template<class StatusType, class CommandType>
std::vector<generic_updater::UpdateConfig> shadow_robot::SrMotorRobotLib< StatusType, CommandType >::motor_update_rate_configs_vector
protected

Definition at line 209 of file sr_motor_robot_lib.hpp.

◆ motor_updater_

template<class StatusType, class CommandType>
boost::shared_ptr<generic_updater::MotorUpdater<CommandType> > shadow_robot::SrMotorRobotLib< StatusType, CommandType >::motor_updater_
protected

Definition at line 178 of file sr_motor_robot_lib.hpp.

◆ reconfig_queue

template<class StatusType, class CommandType>
std::queue<ForceConfig, std::list<ForceConfig> > shadow_robot::SrMotorRobotLib< StatusType, CommandType >::reconfig_queue
protected

Definition at line 190 of file sr_motor_robot_lib.hpp.

◆ reset_motors_queue

template<class StatusType, class CommandType>
std::queue<int16_t, std::list<int16_t> > shadow_robot::SrMotorRobotLib< StatusType, CommandType >::reset_motors_queue
protected

Definition at line 195 of file sr_motor_robot_lib.hpp.


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


sr_robot_lib
Author(s): Ugo Cupcic, Toni Oliver
autogenerated on Mon Feb 28 2022 23:50:43