Skip to content
Abhay Deshpande edited this page Oct 3, 2023 · 4 revisions

Rover Code Wiki Home

System Overview

The below diagram gives a brief overview of how the different parts of the system work together. Note that the Mission Control repository is here, the Simulator repository is here, and the Ardupilot Driver repository is here.

Essentially, the different software components (rover code, MC, Simulator, Ardupilot Driver) all communicate over WebSocket, the server for which is hosted by the rover code. The rover code, if running on the real hardware, communicates to the rest of the hardware via CAN.

The rover code runs somewhat similarly to a stateful server. That is, behavior is defined in terms of handlers/callbacks that mutate the state of the rover, possibly starting or stopping asynchronous routines. These handlers are mostly defined in the MissionControlProtocol, which handles communication between the rover and Mission Control. Examples of asynchronous routines that are started/stopped by Mission Control include autonomous navigation, or the IK controller task.

The rover interacts with the world using the world interface. This layer of abstraction allows the rover code to seamlessly work with either the real hardware or with the simulation, and is achieved by compiling different implementations depending on if we're in sim or the real world. All interaction with the world is done through this interface.

graphviz

GraphViz source for above diagram
graph G {
    "Mission Control";
    Simulator;
    ArdupilotDriver;
    
    subgraph cluster_rover {
        label="Rover";
        MissionControlProtocol;
        WorldInterface;
        SimulatorInterface;
        RealWorldInterface;
        ArdupilotInterface;
        "Async Tasks";
        
        MissionControlProtocol -- WorldInterface;
        MissionControlProtocol -- "Async Tasks";
        "Async Tasks" -- WorldInterface;
        WorldInterface -- SimulatorInterface;
        WorldInterface -- RealWorldInterface;
        RealWorldInterface -- ArdupilotInterface;
    }
    
    subgraph cluster_hardware {
        label="Hardware";
        "Real Robot";
        Ardupilot;
    }

    ArdupilotInterface -- ArdupilotDriver [label="WebSocket"];
    ArdupilotDriver -- Ardupilot [label="USB"]
    "Mission Control" -- MissionControlProtocol [label="WebSocket"];
    SimulatorInterface -- Simulator [label="WebSocket"];
    RealWorldInterface -- "Real Robot" [label="CAN"];
    
    {rank=same; Simulator; ArdupilotDriver}
}