锐蓝3D打印wiki

Rayland Protocol

2018-05-05
/
/

本文档介绍了用Rayland-DUAL主板控制鸵鸟机器人的控制协议。

鸵鸟机器人控制协议

Android -> 下位机

1.1 控制指令

cmd_type,pkg_length,seq,cmd_io,s_x,s_y,v_x,v_y

Param Describe Type Range Unit
cmd_type 指令类型 uint8 0  
pkg_length 包长度 uint8 12bytes  
seq 指令序号 uint8    
cmd_io io口控制指令(8) uint8 0;1  
s_x 左轮里程 int16 打点个数  
s_y 右轮里程 int16 打点个数  
v_x 左轮速度 int16 正:前进;负:后退  
v_y 右轮速度 int16 v_x一致  

2.2 摄像头控制指令

cmd_type,pkg_length,seq,angle_hor,angle_ver

Param Describe Type Range Unit
cmd_type 指令类型 uint8 1  
pkg_length 包长度 uint8 7bytes  
seq 指令序号 uint8    
angle_hor 水平方向转动角度 int16 -180~180 °
angle_ver 垂直方向转动角度 int16 -180~180 °

3.3 腰、升降控制指令

cmd_type,pkg_length,seq,s_w,s_u

Param Describe Type Range Unit
cmd_type 指令类型 uint8 2  
pkg_length 包长度 uint8 7bytes  
seq 指令序号 uint8    
s_w 转腰里程 int16    
s_u 升降里程 int16    

4.4 out口控制指令

cmd_type,pkg_length,seq,outputBit,maskBit

Param Describe Type Range Unit
cmd_type 指令类型 uint8 3  
pkg_length 包长度 uint8 7bytes  
seq 指令序号 uint8    
outputBit 输出 int16 0:move,1:stop  
maskBit mask int16 1:有效  

outputbit:右转,左转,二右转,二左转,降,升,后退,后退

5.5 清空脉冲计数指令

cmd_type,pkg_length,seq

Param Describe Type Range Unit
cmd_type 指令类型 uint8 4  
pkg_length 包长度 uint8 3bytes  
seq 指令序号 uint8    

下位机 -> Android

1.1 状态回传

cmd_type,pkg_length,seq,lim,pro_change,pulse_count

Param Describe Type Range Unit
cmd_type 指令类型 uint8 0  
pkg_length 包长度 uint8 24bytes  
seq 指令序号 uint8    
lim 限位开关信息(15) uint32 0;1  
pro 优先级控制 uint8    
pulse_count 脉冲计数(4) uint32 * 4    

lim:

           
正常 0000 0000‭0001 11111010‬ 506        
后到位 0000 0000‭‭0001 11101010‬ 490 5-0-15 15-0
下降 0000 0000‭0001 11111110‬ 510 3-1-17 17-1
上升 ‭0000 0000‭0001 11111011‬ 507 1-1-19 19-1
中间点 0000 0000‭0001 01111010‬‬ 378 8-0-12   12-0 0
正转 0000 0000‭‭0101 11111010‬ 1530 11-1-9 9-1
反转 0000 0000‭‭1011 11111010‬ 3066 12-1-8 8-1
云台上 ‭0001 00000001 11111010‬ 66042 17-1-3   3-1
云台下 ‭‭0010 00000001 11111010‬ 131578 18-1-2   2-1
云台左 ‭0000 10000001 11111010‬ 33274 16-1-4   4-1
云台右 0000 ‭01000001 11111010‬ 16890 15-1-5   5-1

           
中间点 ‭0000 00000011 01001011‬ 0 不正常1   843 17 0
正常 ‭0000 00000011 01001111‬     847    
后到位 0000 0000‭0001 01001011‬     331 停 10-0
下降 0000 0000‭0011 11001011‬     12-1
上升 0000 0000‭‭0011 01101011‬     14-1
正转 0000 0000‬‭0111 01001111‬     1871停 9-1
反转 0000 0000‭1011 01011111‬     8-1
云台上 ‭‭0010 00000011 01001011‬     131915 2-1 中 左转 右转
云台下 ‭0001 00000011 01001011‬     66379 3-1
云台左 0000 ‭01000011 01001011‬     17227 5-1
云台右 0000 ‭10000011 01001011‬     33611 4-1


Comments