48 : name_(
"generic_hw_interface")
50 , use_rosparam_joint_limits_(false)
51 , use_soft_limits_if_available_(false)
54 if (urdf_model == NULL)
61 std::size_t error = 0;
87 for (std::size_t joint_id = 0; joint_id <
num_joints_; ++joint_id)
110 registerJointLimits(joint_handle_position, joint_handle_velocity, joint_handle_effort, joint_id);
124 std::size_t joint_id)
135 bool has_joint_limits =
false;
136 bool has_soft_limits =
false;
149 if (urdf_joint == NULL)
158 has_joint_limits =
true;
168 if (urdf_joint->type != urdf::Joint::CONTINUOUS)
178 has_joint_limits =
true;
180 "Joint " <<
joint_names_[joint_id] <<
" has rosparam position limits [" 184 <<
" has rosparam velocity limit [" 194 has_soft_limits =
true;
205 if (!has_joint_limits)
214 joint_limits.
min_position += std::numeric_limits<double>::epsilon();
215 joint_limits.
max_position -= std::numeric_limits<double>::epsilon();
237 joint_limits, soft_limits);
240 joint_limits, soft_limits);
278 std::stringstream ss;
279 std::cout.precision(15);
292 std::stringstream ss;
293 std::cout.precision(15);
294 ss <<
" position velocity effort \n";
306 std::string urdf_string;
310 while (urdf_string.empty() &&
ros::ok())
312 std::string search_param_name;
317 nh.
getParam(search_param_name, urdf_string);
323 nh.
getParam(param_name, urdf_string);
void registerInterface(T *iface)
hardware_interface::EffortJointInterface effort_joint_interface_
std::vector< double > joint_position_command_
#define ROS_DEBUG_STREAM_NAMED(name, args)
#define ROS_ERROR_STREAM_NAMED(name, args)
URDF_EXPORT bool initString(const std::string &xmlstring)
hardware_interface::JointStateInterface joint_state_interface_
#define ROS_INFO_STREAM_THROTTLE(period, args)
bool use_rosparam_joint_limits_
virtual void loadURDF(ros::NodeHandle &nh, std::string param_name)
Get the URDF XML from the parameter server.
std::vector< double > joint_position_lower_limits_
bool use_soft_limits_if_available_
std::vector< double > joint_effort_limits_
#define ROS_INFO_STREAM_NAMED(name, args)
joint_limits_interface::EffortJointSaturationInterface eff_jnt_sat_interface_
virtual void init()
Initialize the hardware interface.
std::vector< double > joint_velocity_
std::vector< double > joint_velocity_command_
std::vector< double > joint_effort_
virtual void registerJointLimits(const hardware_interface::JointHandle &joint_handle_position, const hardware_interface::JointHandle &joint_handle_velocity, const hardware_interface::JointHandle &joint_handle_effort, std::size_t joint_id)
Register the limits of the joint specified by joint_id and joint_handle. The limits are retrieved fro...
joint_limits_interface::VelocityJointSaturationInterface vel_jnt_sat_interface_
bool getSoftJointLimits(urdf::JointConstSharedPtr urdf_joint, SoftJointLimits &soft_limits)
bool searchParam(const std::string &key, std::string &result) const
virtual void printState()
Helper for debugging a joint's state.
hardware_interface::VelocityJointInterface velocity_joint_interface_
joint_limits_interface::EffortJointSoftLimitsInterface eff_jnt_soft_limits_
std::vector< std::string > joint_names_
joint_limits_interface::PositionJointSoftLimitsInterface pos_jnt_soft_limits_
const std::string & getNamespace() const
virtual void reset()
Set all members to default values.
std::string printCommandHelper()
Helper for debugging a joint's command.
std::vector< double > joint_position_upper_limits_
void registerHandle(const JointStateHandle &handle)
std::vector< double > joint_effort_command_
JointStateHandle getHandle(const std::string &name)
void shutdownIfError(const std::string &parent_name, std::size_t error_count)
std::string printStateHelper()
urdf::Model * urdf_model_
bool getParam(const std::string &key, std::string &s) const
bool getJointLimits(urdf::JointConstSharedPtr urdf_joint, JointLimits &limits)
std::vector< double > joint_velocity_limits_
joint_limits_interface::VelocityJointSoftLimitsInterface vel_jnt_soft_limits_
std::vector< double > joint_position_
GenericHWInterface(ros::NodeHandle &nh, urdf::Model *urdf_model=NULL)
Constructor.
bool get(const std::string &parent_name, const ros::NodeHandle &nh, const std::string ¶m_name, bool &value)
hardware_interface::PositionJointInterface position_joint_interface_
joint_limits_interface::PositionJointSaturationInterface pos_jnt_sat_interface_
#define ROS_WARN_STREAM_NAMED(name, args)