|
15 | 15 | #ifndef RT_MANIPULATORS_LIB_INCLUDE_DYNAMIXEL_XM_HPP_ |
16 | 16 | #define RT_MANIPULATORS_LIB_INCLUDE_DYNAMIXEL_XM_HPP_ |
17 | 17 |
|
| 18 | +#include <string> |
| 19 | +#include <vector> |
| 20 | + |
18 | 21 | #include "dynamixel_base.hpp" |
19 | 22 |
|
20 | 23 | namespace dynamixel_xm { |
@@ -52,8 +55,74 @@ class DynamixelXM : public dynamixel_base::DynamixelBase { |
52 | 55 | unsigned int from_velocity_rps(const double velocity_rps); |
53 | 56 | unsigned int from_current_ampere(const double current_ampere); |
54 | 57 |
|
55 | | - private: |
| 58 | + bool auto_set_indirect_address_of_present_position(const dynamixel_base::comm_t & comm); |
| 59 | + bool auto_set_indirect_address_of_present_velocity(const dynamixel_base::comm_t & comm); |
| 60 | + bool auto_set_indirect_address_of_present_current(const dynamixel_base::comm_t & comm); |
| 61 | + bool auto_set_indirect_address_of_present_input_voltage(const dynamixel_base::comm_t & comm); |
| 62 | + bool auto_set_indirect_address_of_present_temperature(const dynamixel_base::comm_t & comm); |
| 63 | + bool auto_set_indirect_address_of_goal_position(const dynamixel_base::comm_t & comm); |
| 64 | + bool auto_set_indirect_address_of_goal_velocity(const dynamixel_base::comm_t & comm); |
| 65 | + bool auto_set_indirect_address_of_goal_current(const dynamixel_base::comm_t & comm); |
| 66 | + |
| 67 | + unsigned int indirect_addr_of_present_position(void); |
| 68 | + unsigned int indirect_addr_of_present_velocity(void); |
| 69 | + unsigned int indirect_addr_of_present_current(void); |
| 70 | + unsigned int indirect_addr_of_present_input_voltage(void); |
| 71 | + unsigned int indirect_addr_of_present_temperature(void); |
| 72 | + unsigned int indirect_addr_of_goal_position(void); |
| 73 | + unsigned int indirect_addr_of_goal_velocity(void); |
| 74 | + unsigned int indirect_addr_of_goal_current(void); |
| 75 | + |
| 76 | + unsigned int start_address_for_indirect_read(void); |
| 77 | + unsigned int length_of_indirect_data_read(void); |
| 78 | + unsigned int next_indirect_addr_read(void) const; |
| 79 | + |
| 80 | + unsigned int start_address_for_indirect_write(void); |
| 81 | + unsigned int length_of_indirect_data_write(void); |
| 82 | + unsigned int next_indirect_addr_write(void) const; |
| 83 | + |
| 84 | + bool extract_present_position_from_sync_read( |
| 85 | + const dynamixel_base::comm_t & comm, const std::string & group_name, |
| 86 | + double & position_rad); |
| 87 | + bool extract_present_velocity_from_sync_read( |
| 88 | + const dynamixel_base::comm_t & comm, const std::string & group_name, |
| 89 | + double & velocity_rps); |
| 90 | + bool extract_present_current_from_sync_read( |
| 91 | + const dynamixel_base::comm_t & comm, const std::string & group_name, |
| 92 | + double & current_ampere); |
| 93 | + bool extract_present_input_voltage_from_sync_read( |
| 94 | + const dynamixel_base::comm_t & comm, const std::string & group_name, |
| 95 | + double & voltage_volt); |
| 96 | + bool extract_present_temperature_from_sync_read( |
| 97 | + const dynamixel_base::comm_t & comm, const std::string & group_name, |
| 98 | + int & temperature_deg); |
| 99 | + |
| 100 | + void push_back_position_for_sync_write( |
| 101 | + const double position_rad, std::vector<uint8_t> & write_data); |
| 102 | + void push_back_velocity_for_sync_write( |
| 103 | + const double velocity_rps, std::vector<uint8_t> & write_data); |
| 104 | + void push_back_current_for_sync_write( |
| 105 | + const double current_ampere, std::vector<uint8_t> & write_data); |
| 106 | + |
| 107 | + protected: |
56 | 108 | int HOME_POSITION_; |
| 109 | + unsigned int total_length_of_indirect_addr_read_; |
| 110 | + unsigned int total_length_of_indirect_addr_write_; |
| 111 | + uint16_t indirect_addr_of_present_position_; |
| 112 | + uint16_t indirect_addr_of_present_velocity_; |
| 113 | + uint16_t indirect_addr_of_present_current_; |
| 114 | + uint16_t indirect_addr_of_present_input_voltage_; |
| 115 | + uint16_t indirect_addr_of_present_temperature_; |
| 116 | + uint16_t indirect_addr_of_goal_position_; |
| 117 | + uint16_t indirect_addr_of_goal_velocity_; |
| 118 | + uint16_t indirect_addr_of_goal_current_; |
| 119 | + |
| 120 | + bool set_indirect_address_read( |
| 121 | + const dynamixel_base::comm_t & comm, const uint16_t addr, const uint16_t len, |
| 122 | + uint16_t & indirect_addr); |
| 123 | + bool set_indirect_address_write( |
| 124 | + const dynamixel_base::comm_t & comm, const uint16_t addr, const uint16_t len, |
| 125 | + uint16_t & indirect_addr); |
57 | 126 | }; |
58 | 127 |
|
59 | 128 | } // namespace dynamixel_xm |
|
0 commit comments