24 #include <urdf_parser/urdf_parser.h> 25 #include <urdf_model/model.h> 41 m_canopen_controller (canopen)
58 bool rosparam_limits_ok =
true;
69 ROS_ERROR(
"robot description not found!!");
71 if(!urdf_model.
initParam(
"robot_description"))
73 ROS_ERROR(
"robot description parsing error!!");
79 for (std::size_t i = 0; i < num_nodes; ++i) {
80 std::string joint_name =
"";
81 std::string mapping_key =
"~node_mapping_" + boost::lexical_cast<std::string>(
static_cast<int>(
m_node_ids[i]));
84 ROS_DEBUG_STREAM(
"Controller Hardware interface: Loading joint with id " << static_cast<int>(
m_node_ids[i]) <<
" named " << joint_name);
88 ". You will not be able to use this device with the controller!");
107 if(!rosparam_limits_ok) {
108 ROS_ERROR_STREAM (
"Could not set the joint limits for joint " << joint_name <<
"!");
143 for (
size_t i = 0; i <
m_node_ids.size(); ++i)
171 std::stringstream commanded_positions;
173 for (
size_t i = 0; i <
m_node_ids.size(); ++i)
187 commanded_positions << pos <<
" ";
197 ROS_ERROR (
"Number of known joints and number of commanded joints do not match!");
213 sensor_msgs::JointState joint_msg;
void registerInterface(T *iface)
virtual void doSwitch(const std::list< hardware_interface::ControllerInfo > &start_list, const std::list< hardware_interface::ControllerInfo > &stop_list)
virtual void doSwitch(const std::list< ControllerInfo > &, const std::list< ControllerInfo > &)
virtual const char * what() const _GLIBCXX_USE_NOEXCEPT
sensor_msgs::JointState getJointMessage()
Creates a joint_state message from the current joint angles and returns it.
virtual void init()
Initialize the hardware interface.
ros::NodeHandle m_node_handle
data union for access to DSP 402 6041 statusword,
This class gives a device specific interface for Schunk Powerballs, as they need some "special" treat...
boost::shared_ptr< CanOpenController > m_canopen_controller
virtual bool prepareSwitch(const std::list< hardware_interface::ControllerInfo > &start_list, const std::list< hardware_interface::ControllerInfo > &stop_list)
std::vector< std::string > m_joint_names
void enforceLimits(const ros::Duration &period)
virtual bool prepareSwitch(const std::list< ControllerInfo > &start_list, const std::list< ControllerInfo > &stop_list)
This exception is thrown if a requested node or node group does not exist.
bool getJointLimits(const std::string &joint_name, const ros::NodeHandle &nh, JointLimits &limits)
hardware_interface::PositionJointInterface m_position_joint_interface
hardware_interface::JointStateInterface m_joint_state_interface
std::vector< double > m_joint_effort
joint_limits_interface::JointLimits m_joint_limits
ROSCPP_DECL bool get(const std::string &key, std::string &s)
std::vector< double > m_joint_velocity
joint_limits_interface::SoftJointLimits m_joint_soft_limits
SchunkCanopenHardwareInterface(ros::NodeHandle &nh, boost::shared_ptr< CanOpenController > &canopen)
URDF_EXPORT bool initParam(const std::string ¶m)
joint_limits_interface::PositionJointSoftLimitsInterface m_jnt_limits_interface
#define ROS_DEBUG_STREAM(args)
std::vector< bool > m_nodes_in_fault
void registerHandle(const JointStateHandle &handle)
virtual void write(ros::Time time, ros::Duration period)
write the command to the robot hardware.
JointStateHandle getHandle(const std::string &name)
std::vector< double > m_joint_position_commands_last
bool hasParam(const std::string &key) const
#define ROS_ERROR_STREAM(args)
std::vector< double > m_joint_positions
std::vector< double > m_joint_position_commands
std::vector< uint8_t > m_node_ids
virtual void read()
Read the state from the robot hardware.