Skip to content

plainchan/RaspBotControl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1.简介

raspbot是一个基于ROS的小车。它采用树莓派4B作为微型电脑,STM32F103C8T6作为下位机控制小车移动,两者之间依靠串口进行通信。

2.串口协议

/****************************************************************************************
*                             Serial Protocol                                           *
*                                                                                       *
*  ,------+------+------+-------+- - - - - -+- - - - - -+- - - - -+- - - - -+           *
*  | Type | SOF  |  LEN |  CRC  |    DPKG   |    DPKG   |   ....  |   CRC   |           *
*  ,------+------+------+-------+-----------+-----------+---------+---------+           *
*  | size |  2   |   1  |   1   |    ...    |    ...    |   ...   |    2    |           *
*  '----- +------+------+-------+- - - - - -+- - - - - -+- - - - -+- - - - -+           *
*  SOF  .........  start of frame, 2 bytes                                              *
*  LEN  .........  number of data package in the frame                                  *
*  CRC  .........  Head of Frame's cyclic redundancy check                              *
*  DPKG .........  data package,include DATA_TAG,DATA                                   *
*  CRC  .........  DATA cyclic redundancy check                                         *   
*                                                                                       *
*                                                                                       *
*  ,------+--------------+---------+---------+--------+                                 *
*  | Type |   element    |  size   |  offset |   seq  |                                 *
*  ,------,--------------+---------+---------+--------+                                 *
*  |      | frame  head1 | 1 BYTE  |    0    |    1   |                                 *
*  | SOF  ,--------------+---------+---------+--------+                                 *
*  |      | frame  head2 | 1 BYTE  |    1    |    2   |                                 *
*  ,------,--------------+---------+---------+--------+                                 *
*  | LEN  |              | 1 BYTE  |    2    |    3   |                                 *
*  ,------,--------------+---------+---------+--------+                                 *
*  | CRC  |              | 1 BYTES |    3    |    4   |                                 *
*  ,------,--------------+---------+---------+--------+                                 *
*  |      |   DATA_TAG   | 1 BYTE  |    4    |    5   |                                 *
*  | DPKG ,--------------+---------+---------+--------+                                 *
*  |      |   DATA       | n BYTES |    5    |    6   |                                 *
*  ,---------------------+---------+---------+--------+                                 *
*  | CRC  |              | 2 BYTES |    4+n  |   n+5  |                                 *
*  '------'--------------+---------+---------+--------+                                 *  
*                                                                                       *
*  Endian: Little-Endian                                                                *
*****************************************************************************************/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages