Fawkes API  Fawkes Development Version
rx28.h
1 
2 /***************************************************************************
3  * rx28.h - Class for accessing Robotis RX28 servos
4  *
5  * Created: Tue Jun 16 11:09:32 2009 (based on visca.h)
6  * Copyright 2005-2009 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef _PLUGINS_PANTILT_ROBOTIS_RX28_H_
25 #define _PLUGINS_PANTILT_ROBOTIS_RX28_H_
26 
27 #include <core/exception.h>
28 
29 #ifdef USE_TIMETRACKER
30 # warning Visca time tracker enabled
31 # include <utils/timetracker.h>
32 
33 # include <fstream>
34 #endif
35 
36 #include <cstddef>
37 #include <cstdio>
38 #include <list>
39 
40 #define RX28_CONTROL_TABLE_LENGTH 0x32
41 #define RX28_MAX_NUM_SERVOS 254
42 
44 {
45 public:
46  /** List of servo IDs. */
47  typedef std::list<unsigned char> DeviceList;
48 
49  RobotisRX28(const char *device_file, unsigned int default_timeout_ms = 30);
50  ~RobotisRX28();
51 
52  void open();
53  void close();
54 
55  bool ping(unsigned char id, unsigned int timeout_ms = 100);
56  DeviceList discover(unsigned int total_timeout_ms = 50);
57 
58  void write_table_value(unsigned char id,
59  unsigned char addr,
60  unsigned int value,
61  bool double_byte = false);
62  void write_table_values(unsigned char id,
63  unsigned char start_addr,
64  unsigned char *values,
65  unsigned int num_values);
66  void read_table_values(unsigned char id);
67  void read_table_value(unsigned char id, unsigned char addr, unsigned char read_length);
68  void start_read_table_values(unsigned char id);
70 
71  void goto_position(unsigned char id, unsigned int value);
72  void goto_positions(unsigned int num_positions, ...);
73 
74  unsigned int get_model(unsigned char id, bool refresh = false);
75  unsigned int get_position(unsigned char id, bool refresh = false);
76  unsigned char get_firmware_version(unsigned char id, bool refresh = false);
77  unsigned char get_baudrate(unsigned char id, bool refresh = false);
78  unsigned char get_delay_time(unsigned char id, bool refresh = false);
79  void get_angle_limits(unsigned char id,
80  unsigned int &cw_limit,
81  unsigned int &ccw_limit,
82  bool refresh = false);
83  unsigned char get_temperature_limit(unsigned char id, bool refresh = false);
84  void get_voltage_limits(unsigned char id,
85  unsigned char &low,
86  unsigned char &high,
87  bool refresh = false);
88  unsigned int get_max_torque(unsigned char id, bool refresh = false);
89  unsigned char get_status_return_level(unsigned char id, bool refresh = false);
90  unsigned char get_alarm_led(unsigned char id, bool refresh = false);
91  unsigned char get_alarm_shutdown(unsigned char id, bool refresh = false);
92  void get_calibration(unsigned char id,
93  unsigned int &down_calib,
94  unsigned int &up_calib,
95  bool refresh = false);
96  bool is_torque_enabled(unsigned char id, bool refresh = false);
97  bool is_led_enabled(unsigned char id, bool refresh = false);
98  void get_compliance_values(unsigned char id,
99  unsigned char &cw_margin,
100  unsigned char &cw_slope,
101  unsigned char &ccw_margin,
102  unsigned char &ccw_slope,
103  bool refresh = false);
104  unsigned int get_goal_position(unsigned char id, bool refresh = false);
105  unsigned int get_goal_speed(unsigned char id, bool refresh = false);
106  float get_max_supported_speed(unsigned char id, bool refresh = false);
107  unsigned int get_torque_limit(unsigned char id, bool refresh = false);
108  unsigned int get_speed(unsigned char id, bool refresh = false);
109  unsigned int get_load(unsigned char id, bool refresh = false);
110  unsigned char get_voltage(unsigned char id, bool refresh = false);
111  unsigned char get_temperature(unsigned char id, bool refresh = false);
112  bool is_moving(unsigned char id, bool refresh = false);
113  bool is_locked(unsigned char id, bool refresh = false);
114  unsigned int get_punch(unsigned char id, bool refresh = false);
115 
116  void set_id(unsigned char id, unsigned char new_id);
117  void set_baudrate(unsigned char id, unsigned char baudrate);
118  void set_return_delay_time(unsigned char id, unsigned char return_delay_time);
119  void set_angle_limits(unsigned char id, unsigned int cw_limit, unsigned int ccw_limit);
120  void set_temperature_limit(unsigned char id, unsigned char temp_limit);
121  void set_voltage_limits(unsigned char id, unsigned char low, unsigned char high);
122  void set_max_torque(unsigned char id, unsigned int max_torque);
123  void set_status_return_level(unsigned char id, unsigned char status_return_level);
124  void set_alarm_led(unsigned char id, unsigned char alarm_led);
125  void set_alarm_shutdown(unsigned char id, unsigned char alarm_shutdown);
126  void set_torque_enabled(unsigned char id, bool enabled);
127  void set_torques_enabled(bool enabled, unsigned int num_servos, ...);
128  void set_led_enabled(unsigned char id, bool enabled);
129  void set_compliance_values(unsigned char id,
130  unsigned char cw_margin,
131  unsigned char cw_slope,
132  unsigned char ccw_margin,
133  unsigned char ccw_slope);
134  void set_goal_speed(unsigned char id, unsigned int goal_speed);
135  void set_goal_speeds(unsigned int num_servos, ...);
136  void set_torque_limit(unsigned char id, unsigned int torque_limit);
137  void lock_config(unsigned char id);
138  void set_punch(unsigned char id, unsigned int punch);
139 
140  bool data_available();
141 
142  // Status return level
143  static const unsigned char SRL_RESPOND_NONE;
144  static const unsigned char SRL_RESPOND_READ;
145  static const unsigned char SRL_RESPOND_ALL;
146 
147  static const unsigned char BROADCAST_ID;
148  static const unsigned int MAX_POSITION;
149  static const unsigned int CENTER_POSITION;
150  static const float MAX_ANGLE_DEG;
151  static const float MAX_ANGLE_RAD;
152  static const float RAD_PER_POS_TICK;
153  static const float POS_TICKS_PER_RAD;
154  static const float SEC_PER_60DEG_12V;
155  static const float SEC_PER_60DEG_16V;
156  static const unsigned int MAX_SPEED;
157 
158  // Parameter entry offsets
159  static const unsigned char P_MODEL_NUMBER_L;
160  static const unsigned char P_MODEL_NUMBER_H;
161  static const unsigned char P_VERSION;
162  static const unsigned char P_ID;
163  static const unsigned char P_BAUD_RATE;
164  static const unsigned char P_RETURN_DELAY_TIME;
165  static const unsigned char P_CW_ANGLE_LIMIT_L;
166  static const unsigned char P_CW_ANGLE_LIMIT_H;
167  static const unsigned char P_CCW_ANGLE_LIMIT_L;
168  static const unsigned char P_CCW_ANGLE_LIMIT_H;
169  static const unsigned char P_SYSTEM_DATA2;
170  static const unsigned char P_LIMIT_TEMPERATURE;
171  static const unsigned char P_DOWN_LIMIT_VOLTAGE;
172  static const unsigned char P_UP_LIMIT_VOLTAGE;
173  static const unsigned char P_MAX_TORQUE_L;
174  static const unsigned char P_MAX_TORQUE_H;
175  static const unsigned char P_RETURN_LEVEL;
176  static const unsigned char P_ALARM_LED;
177  static const unsigned char P_ALARM_SHUTDOWN;
178  static const unsigned char P_OPERATING_MODE;
179  static const unsigned char P_DOWN_CALIBRATION_L;
180  static const unsigned char P_DOWN_CALIBRATION_H;
181  static const unsigned char P_UP_CALIBRATION_L;
182  static const unsigned char P_UP_CALIBRATION_H;
183 
184  static const unsigned char P_TORQUE_ENABLE;
185  static const unsigned char P_LED;
186  static const unsigned char P_CW_COMPLIANCE_MARGIN;
187  static const unsigned char P_CCW_COMPLIANCE_MARGIN;
188  static const unsigned char P_CW_COMPLIANCE_SLOPE;
189  static const unsigned char P_CCW_COMPLIANCE_SLOPE;
190  static const unsigned char P_GOAL_POSITION_L;
191  static const unsigned char P_GOAL_POSITION_H;
192  static const unsigned char P_GOAL_SPEED_L;
193  static const unsigned char P_GOAL_SPEED_H;
194  static const unsigned char P_TORQUE_LIMIT_L;
195  static const unsigned char P_TORQUE_LIMIT_H;
196  static const unsigned char P_PRESENT_POSITION_L;
197  static const unsigned char P_PRESENT_POSITION_H;
198  static const unsigned char P_PRESENT_SPEED_L;
199  static const unsigned char P_PRESENT_SPEED_H;
200  static const unsigned char P_PRESENT_LOAD_L;
201  static const unsigned char P_PRESENT_LOAD_H;
202  static const unsigned char P_PRESENT_VOLTAGE;
203  static const unsigned char P_PRESENT_TEMPERATURE;
204  static const unsigned char P_REGISTERED_INSTRUCTION;
205  static const unsigned char P_PAUSE_TIME;
206  static const unsigned char P_MOVING;
207  static const unsigned char P_LOCK;
208  static const unsigned char P_PUNCH_L;
209  static const unsigned char P_PUNCH_H;
210 
211 private:
212  // Instructions
213  static const unsigned char INST_PING;
214  static const unsigned char INST_READ;
215  static const unsigned char INST_WRITE;
216  static const unsigned char INST_REG_WRITE;
217  static const unsigned char INST_ACTION;
218  static const unsigned char INST_RESET;
219  static const unsigned char INST_DIGITAL_RESET;
220  static const unsigned char INST_SYSTEM_READ;
221  static const unsigned char INST_SYSTEM_WRITE;
222  static const unsigned char INST_SYNC_WRITE;
223  static const unsigned char INST_SYNC_REG_WRITE;
224 
225  // Packet offsets
226  static const unsigned char PACKET_OFFSET_ID;
227  static const unsigned char PACKET_OFFSET_LENGTH;
228  static const unsigned char PACKET_OFFSET_INST;
229  static const unsigned char PACKET_OFFSET_PARAM;
230  static const unsigned char PACKET_OFFSET_ERROR;
231 
232 private:
233  unsigned char calc_checksum(const unsigned char id,
234  const unsigned char instruction,
235  const unsigned char *params,
236  const unsigned char plength);
237  void send(const unsigned char id,
238  const unsigned char instruction,
239  const unsigned char *params,
240  const unsigned char plength);
241  void recv(const unsigned char exp_length, unsigned int timeout_ms = 0xFFFFFFFF);
242  void assert_valid_id(unsigned char id);
243  unsigned int merge_twobyte_value(unsigned int id, unsigned char ind_l, unsigned char ind_h);
244  unsigned int
245  get_value(unsigned int id, bool refresh, unsigned int ind_l, unsigned int ind_h = 0xFFFFFFFF);
246  bool inline responds_read(unsigned int id)
247  {
248  return ((control_table_[id][P_RETURN_LEVEL] == SRL_RESPOND_READ)
249  || (control_table_[id][P_RETURN_LEVEL] == SRL_RESPOND_ALL));
250  }
251 
252  bool inline responds_all(unsigned int id)
253  {
254  return (control_table_[id][P_RETURN_LEVEL] == SRL_RESPOND_ALL);
255  }
256 
257  int fd_;
258  char * device_file_;
259  unsigned int default_timeout_ms_;
260 
261  unsigned char obuffer_[260];
262  unsigned char ibuffer_[260];
263 
264  int obuffer_length_;
265  int ibuffer_length_;
266 
267  char control_table_[RX28_MAX_NUM_SERVOS][RX28_CONTROL_TABLE_LENGTH];
268 
269 #ifdef TIMETRACKER_VISCA
270  fawkes::TimeTracker *tracker;
271  std::ofstream track_file;
272  unsigned int ttcls_pantilt_get_send;
273  unsigned int ttcls_pantilt_get_read;
274  unsigned int ttcls_pantilt_get_handle;
275  unsigned int ttcls_pantilt_get_interpret;
276 #endif
277 };
278 
279 #endif
static const unsigned char P_PUNCH_L
P_PUNCH_L.
Definition: rx28.h:208
static const unsigned char P_CCW_COMPLIANCE_SLOPE
P_CCW_COMPLIANCE_SLOPE.
Definition: rx28.h:189
void read_table_value(unsigned char id, unsigned char addr, unsigned char read_length)
Read a table value.
Definition: rx28.cpp:577
std::list< unsigned char > DeviceList
List of servo IDs.
Definition: rx28.h:47
static const float MAX_ANGLE_RAD
MAX_ANGLE_RAD.
Definition: rx28.h:151
void set_torque_enabled(unsigned char id, bool enabled)
Enable or disable torque.
Definition: rx28.cpp:1183
void start_read_table_values(unsigned char id)
Start to receive table values.
Definition: rx28.cpp:537
static const unsigned char P_UP_LIMIT_VOLTAGE
P_UP_LIMIT_VOLTAGE.
Definition: rx28.h:172
static const unsigned char P_VERSION
P_VERSION.
Definition: rx28.h:161
unsigned int get_goal_speed(unsigned char id, bool refresh=false)
Get goal speed.
Definition: rx28.cpp:951
void write_table_values(unsigned char id, unsigned char start_addr, unsigned char *values, unsigned int num_values)
Write multiple table values.
Definition: rx28.cpp:647
void close()
Close port.
Definition: rx28.cpp:254
static const float SEC_PER_60DEG_12V
SEC_PER_60DEG_12V.
Definition: rx28.h:154
void set_goal_speed(unsigned char id, unsigned int goal_speed)
Set goal speed.
Definition: rx28.cpp:1258
static const unsigned char P_PRESENT_POSITION_H
P_PRESENT_POSITION_H.
Definition: rx28.h:197
static const unsigned char P_UP_CALIBRATION_L
P_UP_CALIBRATION_L.
Definition: rx28.h:181
unsigned char get_delay_time(unsigned char id, bool refresh=false)
Get time of the delay before replies are sent.
Definition: rx28.cpp:782
void get_compliance_values(unsigned char id, unsigned char &cw_margin, unsigned char &cw_slope, unsigned char &ccw_margin, unsigned char &ccw_slope, bool refresh=false)
Get compliance values.
Definition: rx28.cpp:921
unsigned char get_status_return_level(unsigned char id, bool refresh=false)
Get status return level.
Definition: rx28.cpp:847
static const unsigned char P_DOWN_LIMIT_VOLTAGE
P_DOWN_LIMIT_VOLTAGE.
Definition: rx28.h:171
static const unsigned char P_SYSTEM_DATA2
P_SYSTEM_DATA2.
Definition: rx28.h:169
void set_punch(unsigned char id, unsigned int punch)
Set punch.
Definition: rx28.cpp:1311
void set_alarm_led(unsigned char id, unsigned char alarm_led)
Set alarm LED settings.
Definition: rx28.cpp:1162
static const unsigned char P_PAUSE_TIME
P_PAUSE_TIME.
Definition: rx28.h:205
static const unsigned char P_LIMIT_TEMPERATURE
P_LIMIT_TEMPERATURE.
Definition: rx28.h:170
float get_max_supported_speed(unsigned char id, bool refresh=false)
Get maximum supported speed.
Definition: rx28.cpp:962
void set_led_enabled(unsigned char id, bool enabled)
Turn LED on or off.
Definition: rx28.cpp:1225
static const unsigned char P_PRESENT_TEMPERATURE
P_PRESENT_TEMPERATURE.
Definition: rx28.h:203
unsigned char get_temperature_limit(unsigned char id, bool refresh=false)
Get temperature limit.
Definition: rx28.cpp:809
static const unsigned char P_PRESENT_SPEED_L
P_PRESENT_SPEED_L.
Definition: rx28.h:198
unsigned int get_goal_position(unsigned char id, bool refresh=false)
Get goal position.
Definition: rx28.cpp:940
bool is_moving(unsigned char id, bool refresh=false)
Check if servo is moving.
Definition: rx28.cpp:1043
static const unsigned char P_PRESENT_LOAD_L
P_PRESENT_LOAD_L.
Definition: rx28.h:200
~RobotisRX28()
Destructor.
Definition: rx28.cpp:175
unsigned int get_punch(unsigned char id, bool refresh=false)
Get punch.
Definition: rx28.cpp:1065
void finish_read_table_values()
Finish control table receive operations.
Definition: rx28.cpp:554
void set_id(unsigned char id, unsigned char new_id)
Set ID.
Definition: rx28.cpp:1075
void set_torque_limit(unsigned char id, unsigned int torque_limit)
Set torque limit.
Definition: rx28.cpp:1301
bool is_led_enabled(unsigned char id, bool refresh=false)
Check if LED is enabled.
Definition: rx28.cpp:907
void set_max_torque(unsigned char id, unsigned int max_torque)
Set maximum torque.
Definition: rx28.cpp:1141
static const unsigned char P_REGISTERED_INSTRUCTION
P_REGISTERED_INSTRUCTION.
Definition: rx28.h:204
static const unsigned char SRL_RESPOND_NONE
SRL_RESPOND_NONE.
Definition: rx28.h:143
static const unsigned char P_PRESENT_SPEED_H
P_PRESENT_SPEED_H.
Definition: rx28.h:199
static const unsigned char P_MAX_TORQUE_H
P_MAX_TORQUE_H.
Definition: rx28.h:174
unsigned int get_load(unsigned char id, bool refresh=false)
Get current load.
Definition: rx28.cpp:1010
static const unsigned char P_GOAL_SPEED_L
P_GOAL_SPEED_L.
Definition: rx28.h:192
static const unsigned char P_CCW_COMPLIANCE_MARGIN
P_CCW_COMPLIANCE_MARGIN.
Definition: rx28.h:187
void write_table_value(unsigned char id, unsigned char addr, unsigned int value, bool double_byte=false)
Write a table value.
Definition: rx28.cpp:607
static const unsigned char P_TORQUE_ENABLE
P_TORQUE_ENABLE.
Definition: rx28.h:184
static const unsigned char P_MOVING
P_MOVING.
Definition: rx28.h:206
unsigned char get_alarm_shutdown(unsigned char id, bool refresh=false)
Get shutdown on alarm state.
Definition: rx28.cpp:869
unsigned int get_model(unsigned char id, bool refresh=false)
Get model.
Definition: rx28.cpp:738
unsigned char get_voltage(unsigned char id, bool refresh=false)
Get current voltage.
Definition: rx28.cpp:1021
bool is_torque_enabled(unsigned char id, bool refresh=false)
Check if torque is enabled.
Definition: rx28.cpp:896
void set_goal_speeds(unsigned int num_servos,...)
Set goal speeds for multiple servos.
Definition: rx28.cpp:1269
static const float SEC_PER_60DEG_16V
SEC_PER_60DEG_16V.
Definition: rx28.h:155
void get_angle_limits(unsigned char id, unsigned int &cw_limit, unsigned int &ccw_limit, bool refresh=false)
Get angle limits.
Definition: rx28.cpp:794
unsigned char get_baudrate(unsigned char id, bool refresh=false)
Get baud rate.
Definition: rx28.cpp:771
static const unsigned char P_GOAL_SPEED_H
P_GOAL_SPEED_H.
Definition: rx28.h:193
static const unsigned char P_RETURN_DELAY_TIME
P_RETURN_DELAY_TIME.
Definition: rx28.h:164
DeviceList discover(unsigned int total_timeout_ms=50)
Discover devices on the bus.
Definition: rx28.cpp:466
static const unsigned char P_DOWN_CALIBRATION_H
P_DOWN_CALIBRATION_H.
Definition: rx28.h:180
static const unsigned char SRL_RESPOND_ALL
SRL_RESPOND_ALL.
Definition: rx28.h:145
static const unsigned char P_LED
P_LED.
Definition: rx28.h:185
static const float POS_TICKS_PER_RAD
POS_TICKS_PER_RAD.
Definition: rx28.h:153
static const float MAX_ANGLE_DEG
MAX_ANGLE_DEG.
Definition: rx28.h:150
static const unsigned char P_GOAL_POSITION_L
P_GOAL_POSITION_L.
Definition: rx28.h:190
unsigned int get_speed(unsigned char id, bool refresh=false)
Get current speed.
Definition: rx28.cpp:999
unsigned char get_temperature(unsigned char id, bool refresh=false)
Get temperature.
Definition: rx28.cpp:1032
static const unsigned int MAX_SPEED
MAX_SPEED.
Definition: rx28.h:156
static const unsigned char P_RETURN_LEVEL
P_RETURN_LEVEL.
Definition: rx28.h:175
unsigned int get_position(unsigned char id, bool refresh=false)
Get current position.
Definition: rx28.cpp:749
static const unsigned char P_MODEL_NUMBER_L
P_MODEL_NUMBER_L.
Definition: rx28.h:159
static const unsigned char P_CW_ANGLE_LIMIT_L
P_CW_ANGLE_LIMIT_L.
Definition: rx28.h:165
void set_baudrate(unsigned char id, unsigned char baudrate)
Set baud rate.
Definition: rx28.cpp:1085
static const unsigned char P_CW_COMPLIANCE_SLOPE
P_CW_COMPLIANCE_SLOPE.
Definition: rx28.h:188
bool data_available()
Check data availability.
Definition: rx28.cpp:440
Time tracking utility.
Definition: tracker.h:36
static const unsigned int MAX_POSITION
MAX_POSITION.
Definition: rx28.h:148
static const unsigned char P_GOAL_POSITION_H
P_GOAL_POSITION_H.
Definition: rx28.h:191
void open()
Open serial port.
Definition: rx28.cpp:182
void goto_position(unsigned char id, unsigned int value)
Move servo to specified position.
Definition: rx28.cpp:1333
void get_voltage_limits(unsigned char id, unsigned char &low, unsigned char &high, bool refresh=false)
Get voltage limits.
Definition: rx28.cpp:821
void set_voltage_limits(unsigned char id, unsigned char low, unsigned char high)
Set voltage limits.
Definition: rx28.cpp:1128
static const unsigned char P_BAUD_RATE
P_BAUD_RATE.
Definition: rx28.h:163
static const unsigned char P_ALARM_LED
P_ALARM_LED.
Definition: rx28.h:176
void set_compliance_values(unsigned char id, unsigned char cw_margin, unsigned char cw_slope, unsigned char ccw_margin, unsigned char ccw_slope)
Set compliance values.
Definition: rx28.cpp:1238
unsigned char get_firmware_version(unsigned char id, bool refresh=false)
Get firmware version.
Definition: rx28.cpp:760
static const unsigned char P_CCW_ANGLE_LIMIT_L
P_CCW_ANGLE_LIMIT_L.
Definition: rx28.h:167
static const unsigned char P_MODEL_NUMBER_H
P_MODEL_NUMBER_H.
Definition: rx28.h:160
void set_temperature_limit(unsigned char id, unsigned char temp_limit)
Set temperature limit.
Definition: rx28.cpp:1117
static const unsigned char P_PRESENT_LOAD_H
P_PRESENT_LOAD_H.
Definition: rx28.h:201
static const unsigned char P_PRESENT_POSITION_L
P_PRESENT_POSITION_L.
Definition: rx28.h:196
Class to access a chain of Robotis RX28 servos.
Definition: rx28.h:43
static const unsigned char P_ALARM_SHUTDOWN
P_ALARM_SHUTDOWN.
Definition: rx28.h:177
static const unsigned char P_PUNCH_H
P_PUNCH_H.
Definition: rx28.h:209
void set_status_return_level(unsigned char id, unsigned char status_return_level)
Set status return level.
Definition: rx28.cpp:1152
static const unsigned char P_CW_COMPLIANCE_MARGIN
P_CW_COMPLIANCE_MARGIN.
Definition: rx28.h:186
RobotisRX28(const char *device_file, unsigned int default_timeout_ms=30)
Constructor.
Definition: rx28.cpp:152
static const unsigned int CENTER_POSITION
CENTER_POSITION.
Definition: rx28.h:149
static const unsigned char P_PRESENT_VOLTAGE
P_PRESENT_VOLTAGE.
Definition: rx28.h:202
static const unsigned char P_TORQUE_LIMIT_L
P_TORQUE_LIMIT_L.
Definition: rx28.h:194
void set_return_delay_time(unsigned char id, unsigned char return_delay_time)
Set return delay time.
Definition: rx28.cpp:1095
bool is_locked(unsigned char id, bool refresh=false)
Check is servo is locked.
Definition: rx28.cpp:1054
static const unsigned char P_CCW_ANGLE_LIMIT_H
P_CCW_ANGLE_LIMIT_H.
Definition: rx28.h:168
static const float RAD_PER_POS_TICK
RAD_PER_POS_TICK.
Definition: rx28.h:152
unsigned int get_torque_limit(unsigned char id, bool refresh=false)
Get torque limit.
Definition: rx28.cpp:988
static const unsigned char SRL_RESPOND_READ
SRL_RESPOND_READ.
Definition: rx28.h:144
static const unsigned char P_MAX_TORQUE_L
P_MAX_TORQUE_L.
Definition: rx28.h:173
static const unsigned char BROADCAST_ID
BROADCAST_ID.
Definition: rx28.h:147
static const unsigned char P_UP_CALIBRATION_H
P_UP_CALIBRATION_H.
Definition: rx28.h:182
static const unsigned char P_CW_ANGLE_LIMIT_H
P_CW_ANGLE_LIMIT_H.
Definition: rx28.h:166
void lock_config(unsigned char id)
Lock config.
Definition: rx28.cpp:1322
void set_angle_limits(unsigned char id, unsigned int cw_limit, unsigned int ccw_limit)
Set angle limits.
Definition: rx28.cpp:1106
static const unsigned char P_TORQUE_LIMIT_H
P_TORQUE_LIMIT_H.
Definition: rx28.h:195
void set_alarm_shutdown(unsigned char id, unsigned char alarm_shutdown)
Set shutdown on alarm.
Definition: rx28.cpp:1172
unsigned int get_max_torque(unsigned char id, bool refresh=false)
Get maximum torque.
Definition: rx28.cpp:836
static const unsigned char P_ID
P_ID.
Definition: rx28.h:162
void goto_positions(unsigned int num_positions,...)
Move several servos to specified positions.
Definition: rx28.cpp:1345
static const unsigned char P_OPERATING_MODE
P_OPERATING_MODE.
Definition: rx28.h:178
static const unsigned char P_LOCK
P_LOCK.
Definition: rx28.h:207
void set_torques_enabled(bool enabled, unsigned int num_servos,...)
Enable or disable torque for multiple (selected) servos at once.
Definition: rx28.cpp:1196
unsigned char get_alarm_led(unsigned char id, bool refresh=false)
Get alarm LED status.
Definition: rx28.cpp:858
static const unsigned char P_DOWN_CALIBRATION_L
P_DOWN_CALIBRATION_L.
Definition: rx28.h:179
void read_table_values(unsigned char id)
Read all table values for given servo.
Definition: rx28.cpp:523
void get_calibration(unsigned char id, unsigned int &down_calib, unsigned int &up_calib, bool refresh=false)
Get calibration data.
Definition: rx28.cpp:881
bool ping(unsigned char id, unsigned int timeout_ms=100)
Ping servo.
Definition: rx28.cpp:504