Skip to content

Rover Satellite Communications Protocol is a protocol for communicating with a rover over a serial connection. This project is designed for Anatolian Rover Challenge (ARC)

License

Notifications You must be signed in to change notification settings

anatolianroverchallenge/rscp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rover Satellite Communications Protocol

Rover Satellite Communications Protocol is a protocol for communicating with a rover over a serial connection. This project is designed for Anatolian Rover Challenge (ARC).

If you are a competitor in ARC'25, please watch this repository to get notified about the updates.

Also check out Discussions for updates and questions.

Issue Tracking

Please use the GitHub issue tracker to report issues or request features. https://github.com/anatolianroverchallenge/rscp/releases

Releases

The latest release can be found on the GitHub releases page. If you cannot see any releases, hold tight! We are working hard.

Table of Contents

Details

RSCP now uses Google Protocol Buffers for serialization and deserialization of messages. This means you don't have to manually serialize/deserialize RSCP messages.

You can use the provided .proto files under proto directory to generate the necessary classes for your language. Refer to the official documentation for more information. You can use the official protoc compiler to generate the necessary classes for your language, or you can use the pre-generated classes provided in this repository, which can be found in the releases. Always use the latest release for the most up-to-date classes.

The releases will have c.zip cpp.zip rscp_protobuf.zip nanopb.zip index.html files which contain the necessary classes for the respective languages, generated using the .proto files in the proto directory using the protoc compiler.

Language File Description
C c.zip C source files
C++ cpp.zip C++ source files
rscp_protobuf rscp_protobuf.zip Python source files (pip3 install to install)
nanopb nanopb.zip C source and header files for nanopb library
docs index.html Documentation for the protocol

You may use rscp_protobuf.zip under the releases to install the python package using pip3 install https://github.com/anatolianroverchallenge/rscp/releases/latest/download/rscp_protobuf.zip

The nanopb library is used to generate the C/C++ source and header files that can be used in embedded systems. Refer to the official documentation and nanopb examples for more information.

You may find the latest Protobuf documentation of the protocol here

Frame Format

To communicate with the RSCP module, all you need to do is:

  • Create a rscp.ResponseEnvelope object
  • Fill out the appropriate fields
  • Serialize the object using the SerializeToString method
  • Encode it with cobs encoding. For python you can use the cobs package.
  • Send the encoded message to the rover over serial

To receive an instruction from the RSCP module, you need to:

  • Receive the message from the serial port and accumulate it over a buffer
  • If 0x00 is received, decode the message using cobs decoding
  • Parse the message using the rscp.RequestEnvelope object
  • Use request.WhichOneof('request') to determine the type of the message
  • Use the appropriate method to handle the data

Communication Sequence

RSCP client module will be sending host messages to the rovers in rscp.RequestEnvelope format. The rovers will be sending responses to the host in rscp.ResponseEnvelope format.

Stage 1 Antenna Installation

Message Type Direction       Description                               light
SetStage(1)               HM -> CM         --                                       ❤️
SetStage(1)               CM -> Rover Rover sets the stage to 1                 ❤️        
Acknowledge               Rover -> CM Rover acknowledges the stage setting     ❤️        
Acknowledge               CM -> HM         --                                       ❤️        
ArmDisarm(arm=True)       HM -> CM         --                                       ❤️        
ArmDisarm(arm=True)       CM -> Rover Rover arms itself                         💚  
Acknowledge               Rover -> CM Rover acknowledges the arming request     💚  
Acknowledge               CM -> HM         --                                       💚  
SearchArea(lat1,lon1,rad1) HM -> CM --                                       💚
SearchArea(lat1,lon1,rad1) CM -> Rover Rover starts receives area coordinates 💚  
Acknowledge               Rover -> CM Rover acknowledges and starts navigation and search 💛
Acknowledge CM -> HM --                                       💛
no message sent -- finished navigating and searching 💛
no message sent --               install antenna 💛
GPSCoordinate(lat2,lon2) Rover -> CM Rover sends coordinates of the peak 💛
GPSCoordinate(lat2,lon2) CM -> HM -- 💛
TaskCompleted             Rover -> CM rover reports navigation finished         💚
TaskCompleted CM -> HM         -- 💚

Stage 2 Icy Crater

Message Type             Direction       Description                               light
SetStage(2) HM -> CM         --                                       💚
SetStage(2) CM -> Rover Rover sets the stage to 2 💚
Acknowledge               Rover -> CM Rover acknowledges the stage setting     💚
Acknowledge               CM -> HM         --                                       💚
SearchArea(lat3,lon3,rad3) HM -> CM --                                       💚
SearchArea(lat3,lon3,rad3) CM -> Rover Rover starts receives area coordinates 💚  
Acknowledge               Rover -> CM Rover acknowledges and starts navigation and search 💛
Acknowledge CM -> HM --                                       💛
no message sent -- finished navigating and searching 💛
GPSCoordinate(lat4,lon4) Rover -> CM Rover sends coordinates of the coldest surface 💛
GPSCoordinate(lat4,lon4) CM -> HM -- 💛
TaskCompleted Rover -> CM rover reports navigation finished         💚
TaskCompleted CM -> HM         -- 💚

Stage 3 Lava Tube

Message Type Direction Description light
SetStage(3) HM -> CM -- 💚
SetStage(3) CM -> Rover Rover sets the stage to 3 💚
Acknowledge Rover -> CM Rover acknowledges the stage setting 💚
Acknowledge CM -> HM -- 💚
NavigateToGPS(lat5,lon5) HM -> CM -- 💚
NavigateToGPS(lat5,lon5) CM -> Rover Rover starts receives lava tube enterance coordinates 💚
Acknowledge Rover -> CM Rover acknowledges and starts navigation 💛
Acknowledge CM -> HM -- 💛
no message sent -- finished navigating 💛
TaskCompleted Rover -> CM rover reports navigation finished 💚
TaskCompleted CM -> HM 💚
no message sent -- Rover locates tag i (lava tube enterance) 💚
StartExploration HM -> CM -- 💚
StartExploration CM -> Rover Rover starts to exploring 💚
Acknowledge Rover -> CM Rover acknowledges the message receiving 💛
Acknowledge CM -> HM -- 💛
no message sent -- continue exploring 💛
no message sent -- Rover measures the length of covered section 💛
distance Rover -> CM Rover sends the measured distance 💛
distance CM -> HM -- 💛
no message sent -- continue exploring 💛
no message sent -- Rover locates tag j (lava tube exit) and exits 💛
TaskCompleted Rover -> CM rover reports mission completed 💚
TaskCompleted CM -> HM -- 💚

Stage 4 Return to Airlock

Message Type Direction Description light
SetStage(4) HM -> CM -- 💚
SetStage(4) CM -> Rover Rover sets the stage to 3 💚
Acknowledge Rover -> CM Rover acknowledges the stage setting 💚
Acknowledge CM -> HM -- 💚
NavigateToGPS(lat6,lon6) HM -> CM -- 💚
NavigateToGPS(lat6,lon6) CM -> Rover Rover starts receives GPS coordinates 💚
Acknowledge Rover -> CM Rover acknowledges and starts navigation 💛
Acknowledge CM -> HM -- 💛
no message sent -- finished navigating 💛
TaskCompleted Rover -> CM rover reports navigation finished 💚
TaskCompleted CM -> HM 💚
no message sent -- Rover locates tag k (airlock enterance) 💛
no message sent -- Rover docks to the airlock 💛
ArmDisarm(arm=False) HM -> CM -- 💛
ArmDisarm(arm=False) CM -> Rover Rover disarms itself, light turns yellow to red ❤️
Acknowledge Rover -> CM Rover acknowledges the arming request ❤️
Acknowledge CM -> HM mission completed. ❤️

Getting Started

Installation of python package

python3 -m pip install https://github.com/anatolianroverchallenge/rscp/releases/latest/download/rscp_protobuf.zip

# To test the installation
python3 -c "import rscp_protobuf"

Examples

  • aruco_detection_example.py is an example code to detect the Aruco markers which will be placed in the competition area.

  • Check out the examples/python directory for more examples of the protocol using Python.

License

This project is licensed under the terms of the BSD 3-Clause License.

Authors

Acknowledgements

This project is developed for Anatolian Rover Challenge (ARC)

About

Rover Satellite Communications Protocol is a protocol for communicating with a rover over a serial connection. This project is designed for Anatolian Rover Challenge (ARC)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •