28 #ifndef QB_DEVICE_HARDWARE_INTERFACE_RESOURCES_H 29 #define QB_DEVICE_HARDWARE_INTERFACE_RESOURCES_H 53 id(
std::abs(signed_id)),
108 setNumberOfJoints(joint_size);
132 inline void setJoints(
const std::vector<std::string> &joints) {
134 setNumberOfJoints(joints.size());
142 names.resize(joint_size);
144 positions.resize(joint_size);
145 velocities.resize(joint_size);
146 efforts.resize(joint_size);
147 commands.resize(joint_size);
148 limits.resize(joint_size);
149 soft_limits.resize(joint_size);
159 this->consecutive_failures = consecutive_failures;
160 this->is_reliable = consecutive_failures >= 0 && consecutive_failures <=
max_repeats;
168 std::vector<joint_limits_interface::JointLimits>
limits;
205 for (
int i=0; i<joints.
names.size(); i++) {
207 joint_state.registerHandle(joint_state_handle);
209 joint_position.registerHandle(joint_position_handle);
221 #endif // QB_DEVICE_HARDWARE_INTERFACE_RESOURCES_H void registerInterface(T *iface)
std::vector< double > efforts
void setReliability(const int &max_repeats, const int &consecutive_failures)
Compare the given consecutive failures w.r.t.
std::vector< int > encoder_resolutions
std::vector< int > position_limits
std::vector< double > positions
qbDeviceHWInterfaces()
Do nothing.
std::vector< double > commands
The qbrobotics Device HardWare Resources contains vectors of named joints.
qbDeviceHWResources()
Do nothing.
std::vector< joint_limits_interface::SoftJointLimits > soft_limits
void setNumberOfJoints(const int &joint_size)
Resize all the Resource members with the given size.
virtual ~qbDeviceHWInterfaces()
Do nothing.
qbDeviceHWResources(const int &joint_size)
Construct the Resource specifying no joint names but only the size of all the members.
hardware_interface::PositionJointInterface joint_position
qbDeviceResources(const int &signed_id)
Construct the Resource from the "signed" device ID.
std::vector< std::string > names
bool get_distinct_packages
hardware_interface::JointStateInterface joint_state
The qbrobotics Device HardWare Interfaces is a simple class aimed to group all the hardware_interface...
qbDeviceResources()
Construct the Resource with the default ID, 1.
std::vector< double > velocities
virtual ~qbDeviceResources()
Do nothing.
qbDeviceHWResources(const std::vector< std::string > &joints)
Construct the Resource with the given vector of joint names.
The qbrobotics Device Resources contains just few device information.
void setJoints(const std::vector< std::string > &joints)
Initialize the joint names of the Resource with the given vector.
std::vector< joint_limits_interface::JointLimits > limits
virtual ~qbDeviceHWResources()
Do nothing.
void initialize(hardware_interface::RobotHW *robot, qbDeviceHWResources &joints)
Initialize the joint_state and joint_position HW interfaces with the given device Resource...