Main Page
Classes
Files
File List
File Members
src
ros.h
Go to the documentation of this file.
1
/*
2
Common Definitions for ROS driver ArbotiX Firmware
3
Copyright (c) 2008-2012 Vanadium Labs LLC. All right reserved.
4
5
Redistribution and use in source and binary forms, with or without
6
modification, are permitted provided that the following conditions are met:
7
8
* Redistributions of source code must retain the above copyright
9
notice, this list of conditions and the following disclaimer.
10
* Redistributions in binary form must reproduce the above copyright
11
notice, this list of conditions and the following disclaimer in the
12
documentation and/or other materials provided with the distribution.
13
* Neither the name of Vanadium Labs LLC nor the names of its
14
contributors may be used to endorse or promote products derived
15
from this software without specific prior written permission.
16
17
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
DISCLAIMED. IN NO EVENT SHALL VANADIUM LABS BE LIABLE FOR ANY DIRECT, INDIRECT,
21
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
*/
28
29
/* ArbotiX (id:253) Instruction Definitions */
30
#define ARB_SIZE_POSE 7 // pose size: a single param for size of pose
31
#define ARB_LOAD_POSE 8 // load pose: index, then pose positions (# of params = 2*pose_size)
32
#define ARB_LOAD_SEQ 9 // seq size: a single param for the size of the seq
33
#define ARB_PLAY_SEQ 10 // load seq: index/times (# of params = 3*seq_size)
34
#define ARB_LOOP_SEQ 11 // play seq: no params
35
//#define ARB_TEST 25 // hardware test: no params
36
#define ARB_CONTROL_SETUP 26 // write ids: id of controller, params (usually ids of servos, # of params = pose_size + 1)
37
#define ARB_CONTROL_WRITE 27 // write positions: positions in order of servos (# of params = 2*pose_size)
38
#define ARB_CONTROL_STAT 28 // retrieve status: id of controller
39
#define ARB_SYNC_READ 0x84
40
41
/* ArbotiX (id:253) Register Table Definitions */
42
#define REG_MODEL_NUMBER_L 0
43
#define REG_MODEL_NUMBER_H 1
44
#define REG_VERSION 2
45
#define REG_ID 3
46
#define REG_BAUD_RATE 4
47
48
#define REG_DIGITAL_IN0 5 // First block of digital pins to read
49
#define REG_DIGITAL_IN1 6
50
#define REG_DIGITAL_IN2 7
51
#define REG_DIGITAL_IN3 8
52
53
#define REG_RESCAN 15
54
#define REG_RETURN_LEVEL 16
55
#define REG_ALARM_LED 17
56
#define REG_ANA_BASE 18 // First Analog Port
57
#define REG_SERVO_BASE 26 // Up to 10 servos, each uses 2 bytes (L, then H), pulse width (0, 1000-2000ms)
58
#define REG_MOVING 46
59
60
#define REG_DIGITAL_OUT0 47 // First digital pin to write
61
// base + index, bit 1 = value (0,1), bit 0 = direction (0,1)
62
63
#define REG_RESERVED 79 // 79 -- 99 are reserved for future use
64
#define REG_USER 100 //
65
66
/* Packet Decoding */
67
int
mode
= 0;
// where we are in the frame
68
69
unsigned
char
id
= 0;
// id of this frame
70
unsigned
char
length
= 0;
// length of this frame
71
unsigned
char
ins
= 0;
// instruction of this frame
72
73
unsigned
char
params
[143];
// parameters (match RX-64 buffer size)
74
unsigned
char
index
= 0;
// index in param buffer
75
76
int
checksum
;
// checksum
params
unsigned char params[143]
Definition:
ros.h:73
length
unsigned char length
Definition:
ros.h:70
mode
int mode
Definition:
ros.h:67
checksum
int checksum
Definition:
ros.h:76
index
unsigned char index
Definition:
ros.h:74
ins
unsigned char ins
Definition:
ros.h:71
arbotix_firmware
Author(s): Michael Ferguson
autogenerated on Fri Jun 7 2019 21:54:07