@@ -47,6 +47,18 @@ class Hardware {
4747 bool get_position (const uint8_t id, double & position);
4848 bool get_position (const std::string& joint_name, double & position);
4949 bool get_positions (const std::string& group_name, std::vector<double >& positions);
50+ bool get_velocity (const uint8_t id, double & velocity);
51+ bool get_velocity (const std::string& joint_name, double & velocity);
52+ bool get_velocities (const std::string& group_name, std::vector<double >& velocities);
53+ bool get_current (const uint8_t id, double & current);
54+ bool get_current (const std::string& joint_name, double & current);
55+ bool get_currents (const std::string& group_name, std::vector<double >& currents);
56+ bool get_voltage (const uint8_t id, double & voltage);
57+ bool get_voltage (const std::string& joint_name, double & voltage);
58+ bool get_voltages (const std::string& group_name, std::vector<double >& voltages);
59+ bool get_temperature (const uint8_t id, int8_t & temperature);
60+ bool get_temperature (const std::string& joint_name, int8_t & temperature);
61+ bool get_temperatures (const std::string& group_name, std::vector<int8_t >& temperatures);
5062 bool set_position (const uint8_t id, const double position);
5163 bool set_position (const std::string& joint_name, const double position);
5264 bool set_positions (const std::string& group_name, std::vector<double >& positions);
@@ -86,6 +98,9 @@ class Hardware {
8698 const int dxl_comm_result, const uint8_t dxl_packet_error);
8799 bool parse_dxl_error (const std::string& func_name, const int dxl_comm_result);
88100 double dxl_pos_to_radian (const int32_t position);
101+ double dxl_velocity_to_rps (const int32_t velocity) const ;
102+ double dxl_current_to_ampere (const int16_t current) const ;
103+ double dxl_voltage_to_volt (const int16_t voltage) const ;
89104 uint32_t radian_to_dxl_pos (const double position);
90105 uint32_t to_dxl_acceleration (const double acceleration_rpss);
91106 uint32_t to_dxl_velocity (const double velocity_rps);
@@ -97,7 +112,11 @@ class Hardware {
97112 std::map<uint8_t , std::shared_ptr<joint::Joint>> all_joints_ref_from_id_;
98113 std::map<JointGroupName, std::shared_ptr<dynamixel::GroupSyncRead>> sync_read_groups_;
99114 std::map<JointGroupName, std::shared_ptr<dynamixel::GroupSyncWrite>> sync_write_groups_;
100- std::map<JointGroupName, uint16_t > address_indirect_present_position_;
115+ std::map<JointGroupName, uint16_t > addr_sync_read_position_;
116+ std::map<JointGroupName, uint16_t > addr_sync_read_velocity_;
117+ std::map<JointGroupName, uint16_t > addr_sync_read_current_;
118+ std::map<JointGroupName, uint16_t > addr_sync_read_voltage_;
119+ std::map<JointGroupName, uint16_t > addr_sync_read_temperature_;
101120 std::map<JointGroupName, uint16_t > address_indirect_goal_position_;
102121 bool thread_enable_;
103122 std::shared_ptr<std::thread> read_write_thread_;
0 commit comments