mia_hand_ros_control
rel 1.0.0
|
Go to the documentation of this file.
10 #ifndef MIA_HW_INTERFACE_H
11 #define MIA_HW_INTERFACE_H
19 #include <hardware_interface/joint_state_interface.h>
20 #include <hardware_interface/joint_command_interface.h>
21 #include <hardware_interface/robot_hw.h>
22 #include <joint_limits_interface/joint_limits.h>
23 #include <joint_limits_interface/joint_limits_interface.h>
24 #include <joint_limits_interface/joint_limits_rosparam.h>
25 #include <joint_limits_interface/joint_limits_urdf.h>
26 #include <controller_manager/controller_manager.h>
27 #include <boost/scoped_ptr.hpp>
33 #include <urdf/model.h>
37 #include <transmission_interface/transmission_parser.h>
38 #include <transmission_interface/transmission_info.h>
39 #include <transmission_interface/transmission_interface.h>
45 #include "mia_hand_driver/cpp_driver.h"
48 #include "mia_hand_description/mia_thumb_opp_passivejoints.h"
95 bool init(ros::NodeHandle& root_nh, ros::NodeHandle& mia_hw_nh)
override;
100 void update(
const ros::TimerEvent& e);
108 void read(
const ros::Time& time,
const ros::Duration& duration)
override;
116 void write(
const ros::Time& time,
const ros::Duration& duration)
override;
145 const std::vector<hardware_interface::JointHandle>& joint_handle,
146 const std::vector<ControlMethod> ctrl_method,
147 const ros::NodeHandle& joint_limit_nh,
148 const urdf::Model *
const urdf_model,
149 int *
const joint_type,
double *
const lower_limit,
150 double *
const upper_limit,
double *
const effort_limit);
198 std::string
getURDF(std::string param_name)
const;
328 transmission_interface::JointData
j_cmd_data[3];
std::vector< double > joint_position_command_
Actual position joint command for the Mia hardware.
enum ControlMethod SelectCtrMethod(enum ControlMethod last_joint_control_methods_, const double last_joint_velocity_command_, const double joint_velocity_command_, const double last_joint_position_command_, const double joint_position_command_)
Select the control method to move the real mia hardware.
transmission_interface::MiaMrlTransmission MrlTrans
Transmissions class implemented for the Mia hand mrl flexion joint.
int n_dof_sim_
Number of degree of freedom.
void read(const ros::Time &time, const ros::Duration &duration) override
Read state data from the real robot hardware.
std::vector< double > act_effort_state_
Useless.
hardware_interface::VelocityJointInterface vj_interface_
Interface for the real Mia joint velocity commands.
joint_limits_interface::VelocityJointSaturationInterface vj_sat_interface_
Interface for the real Mia joint velocity saturation limit.
Implementation of the linear Mia mrl Transmission mapping the positions and velocity from the joint s...
transmission_interface::MiaActuatorToJointPositionInterface index_act_to_jnt_pos_state
Transmission interface for propagating current actuator position state of the Mia index to joint spac...
std::vector< double > act_velocity_command_
Actual velocity actuator command for the Mia hardware.
unsigned int write_counter
Counter of the write method.
std::vector< double > joint_effort_limits_
Effort limit of the joints of the Mia hardware specified in the URDF (fake).
Struct to store the indexes of each joints in the MiaHWInterface Class Index of each joint depends on...
transmission_interface::MiaJointToActuatorVelocityInterface index_jnt_to_act_vel
Transmission interface for propagating joint velocity commands to actuator space.
MiaHWInterface()
Class constructor.
joint_limits_interface::PositionJointSaturationInterface pj_sat_interface_
Interface for the real Mia joint position saturation limit.
transmission_interface::ActuatorData a_cmd_data[3]
Actuator command data (one for transmission).
CppDriver mia_
Low level driver of the Mia hand.
Implementation of the no-linear Mia Index Transmission.
bool init(ros::NodeHandle &root_nh, ros::NodeHandle &mia_hw_nh) override
Initialize the class hardware interface and the robot hardware.
std::vector< ControlMethod > last_joint_control_methods_
Last control method used for the joints of the Mia hardware.
std::vector< double > joint_velocity_state_
Actual velocity state of the joints of the Mia hardware.
std::vector< double > act_position_command_
Actual position actuator command for the Mia hardware.
std::vector< double > joint_position_state_
Actual position state of the joints of the Mia hardware.
transmission_interface::ActuatorToJointVelocityInterface act_to_jnt_vel_state
Transmission interface for propagating current velocity actuator state to joint space.
std::vector< double > act_effort_command_
Useless.
std::string robot_description_
Generic name of the URDF to look for with #getURDF(std::string param_name).
std::vector< ControlMethod > joint_control_methods_
Actual control method for the joints of the Mia hardware.
transmission_interface::MiaThfleTransmission ThfleTrans
Transmissions class implemented for the Mia hand thumb flexion joint.
std::vector< double > act_velocity_state_
Actual velocity state of the actuators of the Mia hardware.
hardware_interface::EffortJointInterface ej_interface_
unused
int COM_number_
Number of the COM in which the Mia hand is plugged.
void write(const ros::Time &time, const ros::Duration &duration) override
Write data command to the real robot hardware.
joint_limits_interface::EffortJointSaturationInterface ej_sat_interface_
unused
hardware_interface::PositionJointInterface pj_interface_
Interface for the real Mia joint position commands.
std::vector< double > joint_effort_state_
Useless.
std::vector< double > joint_effort_command_
Useless.
joint_limits_interface::PositionJointSoftLimitsInterface pj_limits_interface_
Interface for the real joint position soft limit.
std::vector< std::vector< ControlMethod > > List_joint_control_methods_
List of control method available for the joints of the Mia hardware.
transmission_interface::JointToActuatorVelocityInterface jnt_to_act_vel
Transmission interface for propagating joint velocity commands to actuator space Transmission interfa...
transmission_interface::JointData j_cmd_data[3]
joint command data (one for transmission).
joint_limits_interface::VelocityJointSoftLimitsInterface vj_limits_interface_
Interface for the real Mia joint velocity software limit.
mia_hand::thumb_opp_passive_joint MyTh_opp_passiveJoint
Class used to evaluate the target position of the Mia simulated thumb opposition joint.
std::vector< double > joint_lower_limits_
Lower position limits of the joints of the Mia hardware (as specified in the URDF)
Class hardware interface of the real Mia hand.
joint_limits_interface::EffortJointSoftLimitsInterface ej_limits_interface_
unused
hardware_interface::JointStateInterface js_interface_
Interface for the real Mia joint state.
std::vector< double > joint_upper_limits_
Upper position limits of the joints of the Mia hardware (as specified in the URDF).
std::vector< double > last_joint_velocity_command_
Last joint velocity command received for the Mia hardware.
~MiaHWInterface()
Class distructor.
void registerJointLimits(const std::string &joint_name, const std::vector< hardware_interface::JointHandle > &joint_handle, const std::vector< ControlMethod > ctrl_method, const ros::NodeHandle &joint_limit_nh, const urdf::Model *const urdf_model, int *const joint_type, double *const lower_limit, double *const upper_limit, double *const effort_limit)
Register the joint limits of the real mia hardware.
int read_counter
Counter for the read() funtion.
std::vector< std::string > trasmission_names_
Actual transmissions name.
void update(const ros::TimerEvent &e)
Initialize the class hardware interface and the robot hardware.
transmission_interface::MiaActuatorToJointVelocityInterface index_act_to_jnt_vel_state
Transmission interface for propagating current actuator velocity state of the Mia index to joint spac...
std::vector< double > last_joint_position_command_
Last joint position command received for the Mia hardware.
ros::NodeHandle nh_
ROS node handle.
std::vector< transmission_interface::Transmission * > MiaTrasmissions
Transmissions vector to handle the transmissions implemented for the real Mia hand.
transmission_interface::MiaJointToActuatorPositionInterface index_jnt_to_act_pos
Transmission interface for propagating joint position commands to actuator space.
transmission_interface::ActuatorData a_state_data[3]
Actuator state data (one for transmission).
std::vector< double > act_position_state_
Actual position state of the actuators of the Mia hardware.
transmission_interface::MiaIndexTransmission IndexTrans
Transmissions class implemented for the Mia hand mrl flexion joint.
std::vector< std::string > joint_names_
Name of the joints as specified in the URDF.
std::vector< int > joint_types_
Type of the joints specified in the URDF.
std::vector< transmission_interface::TransmissionInfo > URDFtransmissions_
Transmissions declared in the URDF.
Joint_index_mapping joints_ii
Joint_index_mapping struct.
transmission_interface::ActuatorToJointPositionInterface act_to_jnt_pos_state
Transmission interface for propagating current actuator position state to joint space.
std::vector< double > old_act_position_state_
Last position state of the actuator returned by the Mia hardware in the read() funtion.
void InitBkLastCommands()
Initialization of the arrays saving the last command received.
std::vector< double > joint_velocity_command_
Actual velocity joint command for the Mia hardware.
double GetThumbOppPosition()
Evaluate the position of the Mia thumb opposition joint.
transmission_interface::JointToActuatorPositionInterface jnt_to_act_pos
Transmission interface for propagating joint position commands to actuator space.
Implementation of the linear Mia thumb flexion transmission mapping the positions and velocity from t...
transmission_interface::JointData j_state_data[3]
Joint state data (one for transmission).
std::string getURDF(std::string param_name) const
Get the name of the URDF.
bool parseTransmissionsFromURDF(const std::string &urdf_string)
Get the transmission names and type from the loaded URDF Get the trasnsmission names specified in the...
ControlMethod
Joints control methods.