diff --git a/docs/architecture/code_flow_detailed.md b/docs/architecture/code_flow_detailed.md index a0e90dc..8762560 100644 --- a/docs/architecture/code_flow_detailed.md +++ b/docs/architecture/code_flow_detailed.md @@ -2,73 +2,77 @@ ## Scope The purpose of this file is to outline the desired framework of the auton stack (and the simulator + logging capabilities) of the RD25 software on a file level. This document should be referenced when writing new files for this framework. -The large boxes are ROSNodes. Each individual smaller box is a file. Data within ROSNodes are transferred via function calls, while data between node are transferred via publishers and subscribers. - ## Viewing On VSCode Install `bierne r.markdown-mermaid` from the extension marketplace to render the charts in VSCode markdown preview. -## Chart! +## Legend +- Green Boxes are marking ros topic gropus, labeled at the top +- Orange boxes are marking ros nodes and their functions +- Hexagonal black boxes are marking the ros topics that the ros nodes subscribe and publish to +- Rectangular black boxes are marking individual files within the ros node and what topics they interact with + +## Chart ```mermaid -flowchart LR - - subgraph "ROS Topic - Raw State" - self/raw_state - other/raw_state - self/gps - self/encoder_speed - self/stepper_steering +flowchart TB + + subgraph RT-RS["ROS Topic - Raw State"] + self/raw_state{{"self/raw_state"}} + other/raw_state{{"other/raw_state"}} + self/gps{{"self/gps"}} + self/encoder_speed{{"self/encoder_speed"}} + self/stepper_steering{{"self/stepper_steering"}} end - subgraph "ROS Topic - Clean State" - self/state - other/state + subgraph RT-CS["ROS Topic - Clean State"] + self/state{{"self/state"}} + other/state{{"other/state"}} end - subgraph "ROS Topic - Trajectory" - self/global_traj - self/cur_traj + subgraph RT-TRAJ["ROS Topic - Trajectory"] + self/global_traj{{"self/global_traj"}} + self/cur_traj{{"self/cur_traj"}} end - subgraph "ROS Topic - Output" - self/steering + subgraph RT-OUT["ROS Topic - Output"] + self/steering{{"self/steering"}} end - subgraph "ROS Topic - Debug" - self/ins_topics - self/gnss1 - self/gnss2 - self/firmware_debug - self/sanity + subgraph RT-DEB["ROS Topic - Debug"] + self/ins_topics{{"self/ins_topics "}} + self/gnss1{{"self/gnss1"}} + self/gnss2{{"self/gnss2"}} + self/firmware_debug{{"self/firmware_debug"}} + self/sanity{{"self/sanity"}} end - subgraph "Serial Node" + subgraph RN-SER["Serial Node"] ROS_serial_translator serial_port_parser end - subgraph "UKF Node" + subgraph RN-UKF["UKF Node"] UKF end - subgraph "Buggy State Node" + subgraph RN-STATE["Buggy State Node"] buggy_state_converter end - subgraph "Debug Telem Node" + subgraph RN-DEB["Debug Telem Node"] telemetry watchdog end - subgraph "Pathplanner Node - 10 Hz" + subgraph RN-PATH["Pathplanner Node - 10 Hz"] initialize_trajectory path_planner trajectory_wrapper end - subgraph "Controller Node - 100 Hz" + subgraph RN-CTRL["Controller Node - 100 Hz"] controller end @@ -82,13 +86,6 @@ flowchart LR INS --> |"10 Hz"| self/gnss2 INS --> |"10 Hz - SC"| self/gps - ROS_serial_translator --> |"10 Hz - SC"| self/encoder_speed - ROS_serial_translator --> |"10 Hz - SC"| self/stepper_steering - ROS_serial_translator --> |"10 Hz - SC"| other/raw_state - ROS_serial_translator --> |"100 Hz - NAND"| self/raw_state - ROS_serial_translator --> |"100 Hz"| self/firmware_debug - self/steering --> |"100 Hz"| ROS_serial_translator - other/raw_state --> |"10 Hz"| buggy_state_converter buggy_state_converter --> |"10 Hz"| other/state self/raw_state --> |"100 Hz"| buggy_state_converter @@ -110,5 +107,29 @@ flowchart LR other/state --> telemetry self/cur_traj --> telemetry watchdog --> self/sanity + + ROS_serial_translator --> |"10 Hz - SC"| self/encoder_speed + ROS_serial_translator --> |"10 Hz - SC"| self/stepper_steering + ROS_serial_translator --> |"10 Hz - SC"| other/raw_state + ROS_serial_translator --> |"100 Hz - NAND"| self/raw_state + ROS_serial_translator --> |"100 Hz"| self/firmware_debug + self/steering --> |"100 Hz"| ROS_serial_translator + + RT-RS:::RT + RT-CS:::RT + RT-TRAJ:::RT + RT-OUT:::RT + RT-DEB:::RT + + RN-SER:::RN + RN-UKF:::RN + RN-STATE:::RN + RN-DEB:::RN + RN-PATH:::RN + RN-CTRL:::RN + + classDef RT color:#000,fill:#74a57f; + classDef RN color:#000,fill:#ee5622; + linkStyle default stroke-width:3px; ``` \ No newline at end of file