Joint Level Control
extend_joint.h
1 #ifndef EXTEND_JOINT_H
2 #define EXTEND_JOINT_H
3 
4 
5 #include <string>
6 
7 #include <hardware_interface/joint_command_interface.h>
8 #include <hardware_interface/joint_state_interface.h>
9 #include <hardware_interface/robot_hw.h>
10 
11 #include <joint_limits_interface/joint_limits.h>
12 #include <joint_limits_interface/joint_limits_interface.h>
13 //#include <joint_limits_interface/joint_limits_urdf.h>
14 #include <joint_limits_interface/joint_limits_rosparam.h>
15 
16 #include "joint_level_control/motor/motor.h"
17 #include "joint_level_control/rotary_encoder/rotary_encoder.h"
18 
25 class ExtendJoint : public hardware_interface::RobotHW
26 {
27 public:
28  ExtendJoint(const std::string& joint_name, const std::string& spi_device, uint8_t spi_cs_id, uint8_t spi_mode, uint8_t spi_bits, uint32_t spi_speed, uint16_t spi_delay, const std::string& can_name, uint8_t can_id);
29  ~ExtendJoint();
30 
31  void read();
32  void write();
33 
34 private:
35  hardware_interface::JointStateInterface joint_state_interface_;
36  hardware_interface::EffortJointInterface effort_joint_interface_;
37 
38  joint_limits_interface::JointLimits limits;
39  joint_limits_interface::EffortJointSaturationInterface effortJointSaturationInterface;
40  joint_limits_interface::PositionJointSaturationInterface positionJointSaturationInterface;
41 
42  double position_;
43  double velocity_;
44  double effort_;
45  double command_position_;
46 
47  Motor motor_;
48  RotaryEncoder rotary_encoder_;
49 
50  ros::NodeHandle nh_;
51 };
52 
53 
54 #endif
This Packages the RotaryEncoder class and Motor class together into a Hardware Interface.
Definition: extend_joint.h:26
This class abstracts the communication with the motorcontrollers (currently Hacker Herkules 5 BLDC).
Definition: motor.h:15
This class abstracts the communication with Sensors of the Extendjoints (currently a E6A2-C rotary en...
Definition: rotary_encoder.h:23