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 # include <fstream>
33 #endif
34 
35 #include <list>
36 #include <cstddef>
37 #include <cstdio>
38 
39 #define RX28_CONTROL_TABLE_LENGTH 0x32
40 #define RX28_MAX_NUM_SERVOS 254
41 
43 {
44  public:
45  /** List of servo IDs. */
46  typedef std::list<unsigned char> DeviceList;
47 
48  RobotisRX28(const char *device_file, unsigned int default_timeout_ms = 30);
49  ~RobotisRX28();
50 
51  void open();
52  void close();
53 
54  bool ping(unsigned char id, unsigned int timeout_ms = 100);
55  DeviceList discover(unsigned int total_timeout_ms = 50);
56 
57 
58  void write_table_value(unsigned char id, unsigned char addr,
59  unsigned int value, bool double_byte = false);
60  void write_table_values(unsigned char id, unsigned char start_addr,
61  unsigned char *values, unsigned int num_values);
62  void read_table_values(unsigned char id);
63  void read_table_value(unsigned char id,
64  unsigned char addr, unsigned char read_length);
65  void start_read_table_values(unsigned char id);
67 
68  void goto_position(unsigned char id, unsigned int value);
69  void goto_positions(unsigned int num_positions, ...);
70 
71  unsigned int get_model(unsigned char id, bool refresh = false);
72  unsigned int get_position(unsigned char id, bool refresh = false);
73  unsigned char get_firmware_version(unsigned char id, bool refresh = false);
74  unsigned char get_baudrate(unsigned char id, bool refresh = false);
75  unsigned char get_delay_time(unsigned char id, bool refresh = false);
76  void get_angle_limits(unsigned char id,
77  unsigned int &cw_limit, unsigned int &ccw_limit,
78  bool refresh = false);
79  unsigned char get_temperature_limit(unsigned char id, bool refresh = false);
80  void get_voltage_limits(unsigned char id,
81  unsigned char &low, unsigned char &high,
82  bool refresh = false);
83  unsigned int get_max_torque(unsigned char id, bool refresh = false);
84  unsigned char get_status_return_level(unsigned char id, bool refresh = false);
85  unsigned char get_alarm_led(unsigned char id, bool refresh = false);
86  unsigned char get_alarm_shutdown(unsigned char id, bool refresh = false);
87  void get_calibration(unsigned char id,
88  unsigned int &down_calib, unsigned int &up_calib,
89  bool refresh = false);
90  bool is_torque_enabled(unsigned char id, bool refresh = false);
91  bool is_led_enabled(unsigned char id, bool refresh = false);
92  void get_compliance_values(unsigned char id,
93  unsigned char &cw_margin, unsigned char &cw_slope,
94  unsigned char &ccw_margin, unsigned char &ccw_slope,
95  bool refresh = false);
96  unsigned int get_goal_position(unsigned char id, bool refresh = false);
97  unsigned int get_goal_speed(unsigned char id, bool refresh = false);
98  float get_max_supported_speed(unsigned char id, bool refresh = false);
99  unsigned int get_torque_limit(unsigned char id, bool refresh = false);
100  unsigned int get_speed(unsigned char id, bool refresh = false);
101  unsigned int get_load(unsigned char id, bool refresh = false);
102  unsigned char get_voltage(unsigned char id, bool refresh = false);
103  unsigned char get_temperature(unsigned char id, bool refresh = false);
104  bool is_moving(unsigned char id, bool refresh = false);
105  bool is_locked(unsigned char id, bool refresh = false);
106  unsigned int get_punch(unsigned char id, bool refresh = false);
107 
108  void set_id(unsigned char id, unsigned char new_id);
109  void set_baudrate(unsigned char id, unsigned char baudrate);
110  void set_return_delay_time(unsigned char id, unsigned char return_delay_time);
111  void set_angle_limits(unsigned char id,
112  unsigned int cw_limit, unsigned int ccw_limit);
113  void set_temperature_limit(unsigned char id, unsigned char temp_limit);
114  void set_voltage_limits(unsigned char id, unsigned char low, unsigned char high);
115  void set_max_torque(unsigned char id, unsigned int max_torque);
116  void set_status_return_level(unsigned char id, unsigned char status_return_level);
117  void set_alarm_led(unsigned char id, unsigned char alarm_led);
118  void set_alarm_shutdown(unsigned char id, unsigned char alarm_shutdown);
119  void set_torque_enabled(unsigned char id, bool enabled);
120  void set_torques_enabled(bool enabled, unsigned char num_servos, ...);
121  void set_led_enabled(unsigned char id, bool enabled);
122  void set_compliance_values(unsigned char id,
123  unsigned char cw_margin, unsigned char cw_slope,
124  unsigned char ccw_margin, unsigned char ccw_slope);
125  void set_goal_speed(unsigned char id, unsigned int goal_speed);
126  void set_goal_speeds(unsigned int num_servos, ...);
127  void set_torque_limit(unsigned char id, unsigned int torque_limit);
128  void lock_config(unsigned char id);
129  void set_punch(unsigned char id, unsigned int punch);
130 
131  bool data_available();
132 
133  // Status return level
134  static const unsigned char SRL_RESPOND_NONE;
135  static const unsigned char SRL_RESPOND_READ;
136  static const unsigned char SRL_RESPOND_ALL;
137 
138  static const unsigned char BROADCAST_ID;
139  static const unsigned int MAX_POSITION;
140  static const unsigned int CENTER_POSITION;
141  static const float MAX_ANGLE_DEG;
142  static const float MAX_ANGLE_RAD;
143  static const float RAD_PER_POS_TICK;
144  static const float POS_TICKS_PER_RAD;
145  static const float SEC_PER_60DEG_12V;
146  static const float SEC_PER_60DEG_16V;
147  static const unsigned int MAX_SPEED;
148 
149  // Parameter entry offsets
150  static const unsigned char P_MODEL_NUMBER_L;
151  static const unsigned char P_MODEL_NUMBER_H;
152  static const unsigned char P_VERSION;
153  static const unsigned char P_ID;
154  static const unsigned char P_BAUD_RATE;
155  static const unsigned char P_RETURN_DELAY_TIME;
156  static const unsigned char P_CW_ANGLE_LIMIT_L;
157  static const unsigned char P_CW_ANGLE_LIMIT_H;
158  static const unsigned char P_CCW_ANGLE_LIMIT_L;
159  static const unsigned char P_CCW_ANGLE_LIMIT_H;
160  static const unsigned char P_SYSTEM_DATA2;
161  static const unsigned char P_LIMIT_TEMPERATURE;
162  static const unsigned char P_DOWN_LIMIT_VOLTAGE;
163  static const unsigned char P_UP_LIMIT_VOLTAGE;
164  static const unsigned char P_MAX_TORQUE_L;
165  static const unsigned char P_MAX_TORQUE_H;
166  static const unsigned char P_RETURN_LEVEL;
167  static const unsigned char P_ALARM_LED;
168  static const unsigned char P_ALARM_SHUTDOWN;
169  static const unsigned char P_OPERATING_MODE;
170  static const unsigned char P_DOWN_CALIBRATION_L;
171  static const unsigned char P_DOWN_CALIBRATION_H;
172  static const unsigned char P_UP_CALIBRATION_L;
173  static const unsigned char P_UP_CALIBRATION_H;
174 
175  static const unsigned char P_TORQUE_ENABLE;
176  static const unsigned char P_LED;
177  static const unsigned char P_CW_COMPLIANCE_MARGIN;
178  static const unsigned char P_CCW_COMPLIANCE_MARGIN;
179  static const unsigned char P_CW_COMPLIANCE_SLOPE;
180  static const unsigned char P_CCW_COMPLIANCE_SLOPE;
181  static const unsigned char P_GOAL_POSITION_L;
182  static const unsigned char P_GOAL_POSITION_H;
183  static const unsigned char P_GOAL_SPEED_L;
184  static const unsigned char P_GOAL_SPEED_H;
185  static const unsigned char P_TORQUE_LIMIT_L;
186  static const unsigned char P_TORQUE_LIMIT_H;
187  static const unsigned char P_PRESENT_POSITION_L;
188  static const unsigned char P_PRESENT_POSITION_H;
189  static const unsigned char P_PRESENT_SPEED_L;
190  static const unsigned char P_PRESENT_SPEED_H;
191  static const unsigned char P_PRESENT_LOAD_L;
192  static const unsigned char P_PRESENT_LOAD_H;
193  static const unsigned char P_PRESENT_VOLTAGE;
194  static const unsigned char P_PRESENT_TEMPERATURE;
195  static const unsigned char P_REGISTERED_INSTRUCTION;
196  static const unsigned char P_PAUSE_TIME;
197  static const unsigned char P_MOVING;
198  static const unsigned char P_LOCK;
199  static const unsigned char P_PUNCH_L;
200  static const unsigned char P_PUNCH_H;
201 
202  private:
203  // Instructions
204  static const unsigned char INST_PING;
205  static const unsigned char INST_READ;
206  static const unsigned char INST_WRITE;
207  static const unsigned char INST_REG_WRITE;
208  static const unsigned char INST_ACTION;
209  static const unsigned char INST_RESET;
210  static const unsigned char INST_DIGITAL_RESET;
211  static const unsigned char INST_SYSTEM_READ;
212  static const unsigned char INST_SYSTEM_WRITE;
213  static const unsigned char INST_SYNC_WRITE;
214  static const unsigned char INST_SYNC_REG_WRITE;
215 
216  // Packet offsets
217  static const unsigned char PACKET_OFFSET_ID;
218  static const unsigned char PACKET_OFFSET_LENGTH;
219  static const unsigned char PACKET_OFFSET_INST;
220  static const unsigned char PACKET_OFFSET_PARAM;
221  static const unsigned char PACKET_OFFSET_ERROR;
222 
223  private:
224  unsigned char calc_checksum(const unsigned char id, const unsigned char instruction,
225  const unsigned char *params, const unsigned char plength);
226  void send(const unsigned char id, const unsigned char instruction,
227  const unsigned char *params, const unsigned char plength);
228  void recv(const unsigned char exp_length, unsigned int timeout_ms = 0xFFFFFFFF);
229  void assert_valid_id(unsigned char id);
230  unsigned int merge_twobyte_value(unsigned int id,
231  unsigned char ind_l, unsigned char ind_h);
232  unsigned int get_value(unsigned int id, bool refresh,
233  unsigned int ind_l, unsigned int ind_h = 0xFFFFFFFF);
234  bool inline responds_read(unsigned int id)
235  {
236 
237  return ((__control_table[id][P_RETURN_LEVEL] == SRL_RESPOND_READ) ||
238  (__control_table[id][P_RETURN_LEVEL] == SRL_RESPOND_ALL));
239  }
240 
241  bool inline responds_all(unsigned int id)
242  {
243  return (__control_table[id][P_RETURN_LEVEL] == SRL_RESPOND_ALL);
244  }
245 
246  int __fd;
247  char *__device_file;
248  unsigned int __default_timeout_ms;
249 
250  unsigned char __obuffer[260];
251  unsigned char __ibuffer[260];
252 
253  int __obuffer_length;
254  int __ibuffer_length;
255 
256  char __control_table[RX28_MAX_NUM_SERVOS][RX28_CONTROL_TABLE_LENGTH];
257 
258 #ifdef TIMETRACKER_VISCA
259  fawkes::TimeTracker *tracker;
260  std::ofstream track_file;
261  unsigned int ttcls_pantilt_get_send;
262  unsigned int ttcls_pantilt_get_read;
263  unsigned int ttcls_pantilt_get_handle;
264  unsigned int ttcls_pantilt_get_interpret;
265 #endif
266 
267 };
268 
269 
270 
271 #endif
static const unsigned char P_PUNCH_L
P_PUNCH_L.
Definition: rx28.h:199
static const unsigned char P_CCW_COMPLIANCE_SLOPE
P_CCW_COMPLIANCE_SLOPE.
Definition: rx28.h:180
void read_table_value(unsigned char id, unsigned char addr, unsigned char read_length)
Read a table value.
Definition: rx28.cpp:570
std::list< unsigned char > DeviceList
List of servo IDs.
Definition: rx28.h:46
static const float MAX_ANGLE_RAD
MAX_ANGLE_RAD.
Definition: rx28.h:142
void set_torque_enabled(unsigned char id, bool enabled)
Enable or disable torque.
Definition: rx28.cpp:1207
void start_read_table_values(unsigned char id)
Start to receive table values.
Definition: rx28.cpp:532
static const unsigned char P_UP_LIMIT_VOLTAGE
P_UP_LIMIT_VOLTAGE.
Definition: rx28.h:163
static const unsigned char P_VERSION
P_VERSION.
Definition: rx28.h:152
unsigned int get_goal_speed(unsigned char id, bool refresh=false)
Get goal speed.
Definition: rx28.cpp:954
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:637
void close()
Close port.
Definition: rx28.cpp:250
static const float SEC_PER_60DEG_12V
SEC_PER_60DEG_12V.
Definition: rx28.h:145
void set_goal_speed(unsigned char id, unsigned int goal_speed)
Set goal speed.
Definition: rx28.cpp:1284
static const unsigned char P_PRESENT_POSITION_H
P_PRESENT_POSITION_H.
Definition: rx28.h:188
static const unsigned char P_UP_CALIBRATION_L
P_UP_CALIBRATION_L.
Definition: rx28.h:172
unsigned char get_delay_time(unsigned char id, bool refresh=false)
Get time of the delay before replies are sent.
Definition: rx28.cpp:777
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:924
unsigned char get_status_return_level(unsigned char id, bool refresh=false)
Get status return level.
Definition: rx28.cpp:845
static const unsigned char P_DOWN_LIMIT_VOLTAGE
P_DOWN_LIMIT_VOLTAGE.
Definition: rx28.h:162
static const unsigned char P_SYSTEM_DATA2
P_SYSTEM_DATA2.
Definition: rx28.h:160
void set_punch(unsigned char id, unsigned int punch)
Set punch.
Definition: rx28.cpp:1340
void set_alarm_led(unsigned char id, unsigned char alarm_led)
Set alarm LED settings.
Definition: rx28.cpp:1184
static const unsigned char P_PAUSE_TIME
P_PAUSE_TIME.
Definition: rx28.h:196
static const unsigned char P_LIMIT_TEMPERATURE
P_LIMIT_TEMPERATURE.
Definition: rx28.h:161
float get_max_supported_speed(unsigned char id, bool refresh=false)
Get maximum supported speed.
Definition: rx28.cpp:966
void set_led_enabled(unsigned char id, bool enabled)
Turn LED on or off.
Definition: rx28.cpp:1251
static const unsigned char P_PRESENT_TEMPERATURE
P_PRESENT_TEMPERATURE.
Definition: rx28.h:194
unsigned char get_temperature_limit(unsigned char id, bool refresh=false)
Get temperature limit.
Definition: rx28.cpp:805
static const unsigned char P_PRESENT_SPEED_L
P_PRESENT_SPEED_L.
Definition: rx28.h:189
unsigned int get_goal_position(unsigned char id, bool refresh=false)
Get goal position.
Definition: rx28.cpp:942
bool is_moving(unsigned char id, bool refresh=false)
Check if servo is moving.
Definition: rx28.cpp:1053
static const unsigned char P_PRESENT_LOAD_L
P_PRESENT_LOAD_L.
Definition: rx28.h:191
~RobotisRX28()
Destructor.
Definition: rx28.cpp:170
unsigned int get_punch(unsigned char id, bool refresh=false)
Get punch.
Definition: rx28.cpp:1077
void finish_read_table_values()
Finish control table receive operations.
Definition: rx28.cpp:549
void set_id(unsigned char id, unsigned char new_id)
Set ID.
Definition: rx28.cpp:1088
void set_torque_limit(unsigned char id, unsigned int torque_limit)
Set torque limit.
Definition: rx28.cpp:1329
bool is_led_enabled(unsigned char id, bool refresh=false)
Check if LED is enabled.
Definition: rx28.cpp:909
void set_max_torque(unsigned char id, unsigned int max_torque)
Set maximum torque.
Definition: rx28.cpp:1161
static const unsigned char P_REGISTERED_INSTRUCTION
P_REGISTERED_INSTRUCTION.
Definition: rx28.h:195
static const unsigned char SRL_RESPOND_NONE
SRL_RESPOND_NONE.
Definition: rx28.h:134
static const unsigned char P_PRESENT_SPEED_H
P_PRESENT_SPEED_H.
Definition: rx28.h:190
static const unsigned char P_MAX_TORQUE_H
P_MAX_TORQUE_H.
Definition: rx28.h:165
unsigned int get_load(unsigned char id, bool refresh=false)
Get current load.
Definition: rx28.cpp:1017
static const unsigned char P_GOAL_SPEED_L
P_GOAL_SPEED_L.
Definition: rx28.h:183
static const unsigned char P_CCW_COMPLIANCE_MARGIN
P_CCW_COMPLIANCE_MARGIN.
Definition: rx28.h:178
void write_table_value(unsigned char id, unsigned char addr, unsigned int value, bool double_byte=false)
Write a table value.
Definition: rx28.cpp:601
static const unsigned char P_TORQUE_ENABLE
P_TORQUE_ENABLE.
Definition: rx28.h:175
static const unsigned char P_MOVING
P_MOVING.
Definition: rx28.h:197
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:729
unsigned char get_voltage(unsigned char id, bool refresh=false)
Get current voltage.
Definition: rx28.cpp:1029
bool is_torque_enabled(unsigned char id, bool refresh=false)
Check if torque is enabled.
Definition: rx28.cpp:897
void set_goal_speeds(unsigned int num_servos,...)
Set goal speeds for multiple servos.
Definition: rx28.cpp:1296
static const float SEC_PER_60DEG_16V
SEC_PER_60DEG_16V.
Definition: rx28.h:146
void get_angle_limits(unsigned char id, unsigned int &cw_limit, unsigned int &ccw_limit, bool refresh=false)
Get angle limits.
Definition: rx28.cpp:790
unsigned char get_baudrate(unsigned char id, bool refresh=false)
Get baud rate.
Definition: rx28.cpp:765
static const unsigned char P_GOAL_SPEED_H
P_GOAL_SPEED_H.
Definition: rx28.h:184
static const unsigned char P_RETURN_DELAY_TIME
P_RETURN_DELAY_TIME.
Definition: rx28.h:155
DeviceList discover(unsigned int total_timeout_ms=50)
Discover devices on the bus.
Definition: rx28.cpp:458
static const unsigned char P_DOWN_CALIBRATION_H
P_DOWN_CALIBRATION_H.
Definition: rx28.h:171
static const unsigned char SRL_RESPOND_ALL
SRL_RESPOND_ALL.
Definition: rx28.h:136
static const unsigned char P_LED
P_LED.
Definition: rx28.h:176
static const float POS_TICKS_PER_RAD
POS_TICKS_PER_RAD.
Definition: rx28.h:144
static const float MAX_ANGLE_DEG
MAX_ANGLE_DEG.
Definition: rx28.h:141
static const unsigned char P_GOAL_POSITION_L
P_GOAL_POSITION_L.
Definition: rx28.h:181
unsigned int get_speed(unsigned char id, bool refresh=false)
Get current speed.
Definition: rx28.cpp:1005
unsigned char get_temperature(unsigned char id, bool refresh=false)
Get temperature.
Definition: rx28.cpp:1041
static const unsigned int MAX_SPEED
MAX_SPEED.
Definition: rx28.h:147
static const unsigned char P_RETURN_LEVEL
P_RETURN_LEVEL.
Definition: rx28.h:166
unsigned int get_position(unsigned char id, bool refresh=false)
Get current position.
Definition: rx28.cpp:741
void set_torques_enabled(bool enabled, unsigned char num_servos,...)
Enable or disable torque for multiple (selected) servos at once.
Definition: rx28.cpp:1221
static const unsigned char P_MODEL_NUMBER_L
P_MODEL_NUMBER_L.
Definition: rx28.h:150
static const unsigned char P_CW_ANGLE_LIMIT_L
P_CW_ANGLE_LIMIT_L.
Definition: rx28.h:156
void set_baudrate(unsigned char id, unsigned char baudrate)
Set baud rate.
Definition: rx28.cpp:1099
static const unsigned char P_CW_COMPLIANCE_SLOPE
P_CW_COMPLIANCE_SLOPE.
Definition: rx28.h:179
bool data_available()
Check data availability.
Definition: rx28.cpp:431
Time tracking utility.
Definition: tracker.h:38
static const unsigned int MAX_POSITION
MAX_POSITION.
Definition: rx28.h:139
static const unsigned char P_GOAL_POSITION_H
P_GOAL_POSITION_H.
Definition: rx28.h:182
void open()
Open serial port.
Definition: rx28.cpp:177
void goto_position(unsigned char id, unsigned int value)
Move servo to specified position.
Definition: rx28.cpp:1364
void get_voltage_limits(unsigned char id, unsigned char &low, unsigned char &high, bool refresh=false)
Get voltage limits.
Definition: rx28.cpp:818
void set_voltage_limits(unsigned char id, unsigned char low, unsigned char high)
Set voltage limits.
Definition: rx28.cpp:1147
static const unsigned char P_BAUD_RATE
P_BAUD_RATE.
Definition: rx28.h:154
static const unsigned char P_ALARM_LED
P_ALARM_LED.
Definition: rx28.h:167
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:1265
unsigned char get_firmware_version(unsigned char id, bool refresh=false)
Get firmware version.
Definition: rx28.cpp:753
static const unsigned char P_CCW_ANGLE_LIMIT_L
P_CCW_ANGLE_LIMIT_L.
Definition: rx28.h:158
static const unsigned char P_MODEL_NUMBER_H
P_MODEL_NUMBER_H.
Definition: rx28.h:151
void set_temperature_limit(unsigned char id, unsigned char temp_limit)
Set temperature limit.
Definition: rx28.cpp:1135
static const unsigned char P_PRESENT_LOAD_H
P_PRESENT_LOAD_H.
Definition: rx28.h:192
static const unsigned char P_PRESENT_POSITION_L
P_PRESENT_POSITION_L.
Definition: rx28.h:187
Class to access a chain of Robotis RX28 servos.
Definition: rx28.h:42
static const unsigned char P_ALARM_SHUTDOWN
P_ALARM_SHUTDOWN.
Definition: rx28.h:168
static const unsigned char P_PUNCH_H
P_PUNCH_H.
Definition: rx28.h:200
void set_status_return_level(unsigned char id, unsigned char status_return_level)
Set status return level.
Definition: rx28.cpp:1173
static const unsigned char P_CW_COMPLIANCE_MARGIN
P_CW_COMPLIANCE_MARGIN.
Definition: rx28.h:177
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:140
static const unsigned char P_PRESENT_VOLTAGE
P_PRESENT_VOLTAGE.
Definition: rx28.h:193
static const unsigned char P_TORQUE_LIMIT_L
P_TORQUE_LIMIT_L.
Definition: rx28.h:185
void set_return_delay_time(unsigned char id, unsigned char return_delay_time)
Set return delay time.
Definition: rx28.cpp:1110
bool is_locked(unsigned char id, bool refresh=false)
Check is servo is locked.
Definition: rx28.cpp:1065
static const unsigned char P_CCW_ANGLE_LIMIT_H
P_CCW_ANGLE_LIMIT_H.
Definition: rx28.h:159
static const float RAD_PER_POS_TICK
RAD_PER_POS_TICK.
Definition: rx28.h:143
unsigned int get_torque_limit(unsigned char id, bool refresh=false)
Get torque limit.
Definition: rx28.cpp:993
static const unsigned char SRL_RESPOND_READ
SRL_RESPOND_READ.
Definition: rx28.h:135
static const unsigned char P_MAX_TORQUE_L
P_MAX_TORQUE_L.
Definition: rx28.h:164
static const unsigned char BROADCAST_ID
BROADCAST_ID.
Definition: rx28.h:138
static const unsigned char P_UP_CALIBRATION_H
P_UP_CALIBRATION_H.
Definition: rx28.h:173
static const unsigned char P_CW_ANGLE_LIMIT_H
P_CW_ANGLE_LIMIT_H.
Definition: rx28.h:157
void lock_config(unsigned char id)
Lock config.
Definition: rx28.cpp:1352
void set_angle_limits(unsigned char id, unsigned int cw_limit, unsigned int ccw_limit)
Set angle limits.
Definition: rx28.cpp:1122
static const unsigned char P_TORQUE_LIMIT_H
P_TORQUE_LIMIT_H.
Definition: rx28.h:186
void set_alarm_shutdown(unsigned char id, unsigned char alarm_shutdown)
Set shutdown on alarm.
Definition: rx28.cpp:1195
unsigned int get_max_torque(unsigned char id, bool refresh=false)
Get maximum torque.
Definition: rx28.cpp:833
static const unsigned char P_ID
P_ID.
Definition: rx28.h:153
void goto_positions(unsigned int num_positions,...)
Move several servos to specified positions.
Definition: rx28.cpp:1377
static const unsigned char P_OPERATING_MODE
P_OPERATING_MODE.
Definition: rx28.h:169
static const unsigned char P_LOCK
P_LOCK.
Definition: rx28.h:198
unsigned char get_alarm_led(unsigned char id, bool refresh=false)
Get alarm LED status.
Definition: rx28.cpp:857
static const unsigned char P_DOWN_CALIBRATION_L
P_DOWN_CALIBRATION_L.
Definition: rx28.h:170
void read_table_values(unsigned char id)
Read all table values for given servo.
Definition: rx28.cpp:517
void get_calibration(unsigned char id, unsigned int &down_calib, unsigned int &up_calib, bool refresh=false)
Get calibration data.
Definition: rx28.cpp:882
bool ping(unsigned char id, unsigned int timeout_ms=100)
Ping servo.
Definition: rx28.cpp:497