Callback register and release
This page contains information on all functions present within register_release.py and aims to give a clear understanding both of what these functions do and the requirements for any data to be input into them.
Functions
register_release_control
Source code in actions\register_release.py
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 | |
register_cmdnum_changed_callback(callback=None)
Register the cmdnum changed callback, only available if enable_report is True
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
callback data: { "cmdnum": cmdnum } |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |
register_connect_changed_callback(callback=None)
Register the connect status changed callback
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
callback data: { "connected": connected, "reported": reported, } |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
register_count_changed_callback(callback=None)
Register the counter value changed callback, only available if enable_report is True
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
callback data: { "count": counter value } |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | |
register_error_warn_changed_callback(callback=None)
Register the error code or warn code changed callback, only available if enable_report is True
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
callback data: { "error_code": error_code, "warn_code": warn_code, } |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
register_feedback_callback(callback=None)
Register the callback of feedback
Note
- only available if firmware_version >= 2.1.0
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
callback data: bytes data: data[0:2]: transaction id, (Big-endian conversion to unsigned 16-bit integer data), command ID corresponding to the feedback, consistent with issued instructions
data[4:6]: feedback_length, feedback_length == len(data) - 6, (Big-endian conversion to unsigned 16-bit integer data) data[8]: feedback type
data[9]: feedback funcode, command code corresponding to feedback, consistent with issued instructions
data[10:12]: feedback taskid, (Big-endian conversion to unsigned 16-bit integer data) data[12]: feedback code, execution status code, generally only meaningful when the feedback type is end, normally 0, 2 means discarded data[13:21]: feedback us, (Big-endian conversion to unsigned 64-bit integer data), time when feedback triggers (microseconds)
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 | |
register_iden_progress_changed_callback(callback=None)
Register the Identification progress value changed callback, only available if enable_report is True
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
callback data: { "progress": progress value } |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
register_mode_changed_callback(callback=None)
Register the mode changed callback, only available if enable_report is True and the connection method is socket
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
callback data: { "mode": mode, } |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | |
register_mtable_mtbrake_changed_callback(callback=None)
Register the motor enable states or motor brake states changed callback, only available if enable_report is True and the connection method is socket
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
callback data: { "mtable": [motor-1-motion-enable, motor-2-motion-enable, ...], "mtbrake": [motor-1-brake-enable, motor-1-brake-enable,...], } |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
register_report_callback(callback=None, report_cartesian=True, report_joints=True, report_state=True, report_error_code=True, report_warn_code=True, report_mtable=True, report_mtbrake=True, report_cmd_num=True)
Register the report callback, only available if enable_report is True
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
callback data { 'cartesian': [], # if report_cartesian is True 'joints': [], # if report_joints is True 'error_code': 0, # if report_error_code is True 'warn_code': 0, # if report_warn_code is True 'state': state, # if report_state is True 'mtbrake': mtbrake, # if report_mtbrake is True, and available if enable_report is True and the connection method is socket 'mtable': mtable, # if report_mtable is True, and available if enable_report is True and the connection method is socket 'cmdnum': cmdnum, # if report_cmd_num is True } |
None
|
|
report_cartesian
|
report cartesian or not, default is True |
True
|
|
report_joints
|
report joints or not, default is True |
True
|
|
report_state
|
report state or not, default is True |
True
|
|
report_error_code
|
report error or not, default is True |
True
|
|
report_warn_code
|
report warn or not, default is True |
True
|
|
report_mtable
|
report motor enable states or not, default is True |
True
|
|
report_mtbrake
|
report motor brake states or not, default is True |
True
|
|
report_cmd_num
|
report cmdnum or not, default is True |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
register_report_location_callback(callback=None, report_cartesian=True, report_joints=True)
Register the report location callback, only available if enable_report is True
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
callback data: { "cartesian": [x, y, z, roll, pitch, yaw], ## if report_cartesian is True "joints": [angle-1, angle-2, angle-3, angle-4, angle-5, angle-6, angle-7], ## if report_joints is True } |
None
|
|
report_cartesian
|
report or not, True/False, default is True |
True
|
|
report_joints
|
report or not, True/False, default is True |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
register_state_changed_callback(callback=None)
Register the state status changed callback, only available if enable_report is True
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
callback data: { "state": state, } |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
register_temperature_changed_callback(callback=None)
Register the temperature changed callback, only available if enable_report is True
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
callback data: { "temperatures": [servo-1-temperature, ...., servo-7-temperature] } |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | |
release_cmdnum_changed_callback(callback=None)
Release the cmdnum changed callback
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
368 369 370 371 372 373 374 375 376 377 378 | |
release_connect_changed_callback(callback=None)
Release the connect changed callback
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
308 309 310 311 312 313 314 315 316 317 318 | |
release_count_changed_callback(callback=None)
Release the counter value changed callback
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
392 393 394 395 396 397 398 399 400 401 402 | |
release_error_warn_changed_callback(callback=None)
Release the error warn changed callback
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
356 357 358 359 360 361 362 363 364 365 366 | |
release_feedback_callback(callback=None)
Release the callback of feedback
Note
- only available if firmware_version >= 2.1.0
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
459 460 461 462 463 464 465 466 467 468 469 470 471 472 | |
release_iden_progress_changed_callback(callback=None)
Release the Identification progress value changed callback
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
404 405 406 407 408 409 410 411 412 413 414 | |
release_mode_changed_callback(callback=None)
Release the mode changed callback
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
332 333 334 335 336 337 338 339 340 341 342 | |
release_mtable_mtbrake_changed_callback(callback=None)
Release the motor enable states or motor brake states changed callback
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
344 345 346 347 348 349 350 351 352 353 354 | |
release_report_callback(callback=None)
Release the report callback
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
283 284 285 286 287 288 289 290 291 292 293 | |
release_report_location_callback(callback=None)
Release the location report callback
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
296 297 298 299 300 301 302 303 304 305 306 | |
release_state_changed_callback(callback=None)
Release the state changed callback
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
320 321 322 323 324 325 326 327 328 329 330 | |
release_temperature_changed_callback(callback=None)
Release the temperature changed callback
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
bool
|
True/False |
Source code in actions\register_release.py
380 381 382 383 384 385 386 387 388 389 390 | |