34 #include <std_msgs/Float64.h> 55 max_force_demand(1023.),
57 max_force_factor_(1.0)
80 j1[j1.size() - 1] =
'1';
81 j2[j2.size() - 1] =
'2';
105 joint_name[joint_name.size() - 1] =
'1';
106 std::string j1 = joint_name;
107 joint_name[joint_name.size() - 1] =
'2';
108 std::string j2 = joint_name;
113 min_ = joint1->limits->lower + joint2->limits->lower;
114 max_ = joint1->limits->upper + joint2->limits->upper;
115 vel_max_ = joint1->limits->velocity + joint2->limits->velocity;
117 eff_max_ = joint1->limits->effort + joint2->limits->effort;
124 min_ = joint->limits->lower;
125 max_ = joint->limits->upper;
153 if ((msg->data >= 0.0) && (msg->data <= 1.0))
159 ROS_ERROR(
"Max force factor must be between 0.0 and 1.0. Discarding received value: %f", msg->data);
void get_min_max(urdf::Model model, std::string joint_name)
ros_ethercat_model::JointState * joint_state_
ros::Subscriber sub_max_force_factor_
double eff_min_
Min and max range of the effort, used to clamp the command.
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
A generic controller for the Shadow Robot EtherCAT hand's joints.
ros_ethercat_model::JointState * joint_state_2
void maxForceFactorCB(const std_msgs::Float64ConstPtr &msg)
double clamp_command(double cmd, double min_cmd, double max_cmd)
ros::Subscriber sub_command_
ros_ethercat_model::RobotState * robot_
double min_
Min and max range of the joint, used to clamp the command.
std::string getJointName()
double vel_min_
Min and max range of the velocity, used to clamp the command.
#define ROS_DEBUG_STREAM(args)
void get_joints_states_1_2()
virtual void setCommandCB(const std_msgs::Float64ConstPtr &msg)
set the command from a topic
void after_init()
call this function at the end of the init function in the inheriting classes.