|
1 | | -# Naval Radar - Simulator |
| 1 | +# Antares Simulator |
2 | 2 |
|
3 | | -The Naval Radar Simulator is a robust project designed to simulate radar systems, generate radar data, and emulate real-world scenarios involving radar detection and tracking. |
| 3 | +**Antares** is a high-performance simulation engine for naval radar scenarios, written in Rust. It generates dynamic environments with ships, emitters, and wave conditions, and feeds simulated radar data to subscribers via TCP and WebSocket. The simulator is designed for modular experimentation, real-time control, and seamless integration with visualization tools such as [Antares Web](https://thesoftwaredesignlab.github.io/ANTARES/antares-web). |
4 | 4 |
|
5 | | -## **Features** |
| 5 | +## Prerequisites |
6 | 6 |
|
7 | | -- **Configurable Radar Simulation**: |
8 | | - - Define radar parameters like range, resolution, and target detection. |
9 | | -- **Dynamic Simulation**: |
10 | | - - Simulates target movements (linear, random, circular, stationary) and environmental effects. |
11 | | -- **Communication Protocol**: |
12 | | - - Implements TCP interfaces for communication between radar components. |
13 | | -- **Realistic Tracking**: |
14 | | - - Includes tracking algorithms for managing targets. |
| 7 | +Make sure you have [Rust](https://www.rust-lang.org/tools/install) installed. You can install Rust and Cargo using: |
15 | 8 |
|
16 | | -## **Setup Instructions** |
17 | | - |
18 | | -1. **Install Rust** |
19 | | - Make sure you have Rust and cargo installed. If not, you can install them following the instructions on the [Rust website](https://www.rust-lang.org/tools/install). |
20 | | - |
21 | | -2. **Go to the Project Directory** |
22 | | - |
23 | | - ```bash |
24 | | - cd naval-radar-simulator |
25 | | - ``` |
26 | | - |
27 | | -3. **Build the Project** |
28 | | - There are 2 ways to build the project: |
29 | | - |
30 | | - - **Development Build**: |
31 | | - ```bash |
32 | | - cargo build |
33 | | - ``` |
34 | | - - **Release Build**: |
35 | | - ```bash |
36 | | - cargo build --release |
37 | | - ``` |
38 | | - |
39 | | - It is recommended to use the release build for better performance. Use the development build for debugging and testing. |
40 | | - |
41 | | -4. **Run the Simulator** |
42 | | - Run the simulator with a configuration file: |
43 | | - |
44 | | - For the release build: |
| 9 | +```bash |
| 10 | +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
| 11 | +``` |
45 | 12 |
|
46 | | - ```bash |
47 | | - ./target/release/naval-radar-simulator <config-file> |
48 | | - ``` |
| 13 | +## Running the Simulator |
49 | 14 |
|
50 | | - For the development build: |
| 15 | +To launch the simulator with the default settings: |
51 | 16 |
|
52 | | - ```bash |
53 | | - cargo run -- <config-file> |
54 | | - ``` |
| 17 | +```bash |
| 18 | +cargo run |
| 19 | +``` |
55 | 20 |
|
56 | | - Replace `<config-file>` with the path to your TOML configuration file. |
| 21 | +To run the simulator with a custom configuration: |
57 | 22 |
|
58 | | -## **Configuration File** |
| 23 | +```bash |
| 24 | +cargo run -- --config path/to/config.toml |
| 25 | +``` |
59 | 26 |
|
60 | | -The simulator uses a TOML configuration file to define settings such as radar range, simulation parameters, and environment details. A sample configuration file might look like this: |
| 27 | +You can use `config.example.toml` as a starting point. |
61 | 28 |
|
62 | | -```toml |
63 | | -[radar] |
| 29 | +## Building for Release |
64 | 30 |
|
65 | | -[radar.protocol] |
66 | | -host = "0.0.0.0" |
67 | | -num_workers_tci = 1 |
68 | | -num_workers_tdi = 1 |
| 31 | +For optimized builds suitable for production or deployment: |
69 | 32 |
|
70 | | -[radar.detector] |
71 | | -range = 100.0 |
72 | | -speed = 10.0 |
73 | | -angle = 0.0 |
74 | | -start_coordinates = [4.0, -72.0] |
| 33 | +```bash |
| 34 | +cargo build --release |
| 35 | +``` |
75 | 36 |
|
76 | | -[simulation] |
77 | | -emission_interval = 20 |
| 37 | +## Project Structure |
78 | 38 |
|
79 | | -[simulation.ships] |
80 | | -line = [{ initial_position = [-50.0, 50.0], angle = 0.785, speed = 5.0 }] |
81 | | -circle = [{ initial_position = [50.0, -50.0], radius = 20.0, speed = 5.0 }] |
82 | | -random = [{ initial_position = [-50.0, -50.0], max_speed = 20.0 }] |
83 | | -stationary = [{ initial_position = [50.0, 50.0] }] |
84 | 39 | ``` |
85 | | - |
86 | | -## **Directory Structure** |
87 | | - |
88 | | -The directory structure organizes the project for clarity and scalability: |
89 | | - |
90 | | -```plaintext |
91 | | -src |
92 | | -├── config.rs # Manages configuration structures and settings |
93 | | -├── controller.rs # Manages the Controller struct, starting the radar and simulation |
94 | | -├── lib.rs # Main library file with module definitions |
95 | | -├── main.rs # Entry point for the simulator |
96 | | -├── radar/ # Radar simulation logic |
97 | | -│ ├── config.rs # Configuration for radar-specific settings |
98 | | -│ ├── detector/ # Radar detection logic |
99 | | -│ │ ├── detector.rs # Core detection algorithms |
100 | | -│ │ ├── mod.rs # Detector module entry point |
101 | | -│ │ └── plot.rs # Handles radar plot generation |
102 | | -│ ├── mod.rs # Radar module entry point |
103 | | -│ ├── protocol/ # Radar communication protocol |
104 | | -│ │ ├── constants/ # Constants used in protocol definitions |
105 | | -│ │ │ ├── client_command.rs |
106 | | -│ │ │ ├── error_message.rs |
107 | | -│ │ │ ├── interface_ports.rs |
108 | | -│ │ │ ├── mod.rs |
109 | | -│ │ │ └── server_command.rs |
110 | | -│ │ ├── mod.rs # Protocol module entry point |
111 | | -│ │ └── tcp_interfaces/ |
112 | | -│ │ ├── base_track_interface.rs |
113 | | -│ │ ├── mod.rs |
114 | | -│ │ ├── track_control_interface.rs |
115 | | -│ │ └── track_data_interface.rs |
116 | | -│ ├── radar.rs # Core radar logic |
117 | | -│ └── tracker/ # Radar tracking algorithms |
118 | | -│ ├── mod.rs |
119 | | -│ ├── track.rs |
120 | | -│ └── tracker.rs |
121 | | -├── simulation/ # Simulation logic for the radar |
122 | | -│ ├── config.rs # Configuration for the simulation module |
123 | | -│ ├── emitters/ # Handles simulated emitters like ships or targets |
124 | | -│ │ ├── emitter.rs |
125 | | -│ │ ├── mod.rs |
126 | | -│ │ └── ship.rs |
127 | | -│ ├── environment/ # Simulated environmental effects |
128 | | -│ │ ├── mod.rs |
129 | | -│ │ └── wave.rs |
130 | | -│ ├── mod.rs # Simulation module entry point |
131 | | -│ ├── movement/ # Movement strategies for targets |
132 | | -│ │ ├── circle.rs |
133 | | -│ │ ├── line.rs |
134 | | -│ │ ├── mod.rs |
135 | | -│ │ ├── random.rs |
136 | | -│ │ ├── stationary.rs |
137 | | -│ │ └── strategy.rs |
138 | | -│ └── simulation.rs # Core simulation logic |
139 | | -└── utils/ # Utility functions and reusable structures |
140 | | - ├── escape_ascii.rs # ASCII character processing utilities |
141 | | - ├── mod.rs # Utils module entry point |
142 | | - └── thread_pool.rs # Thread pool implementation for concurrency |
| 40 | +antares/ |
| 41 | +├── src/ # Source code |
| 42 | +│ ├── config.rs # Global configuration loader |
| 43 | +│ ├── controller.rs # Simulation runtime controller |
| 44 | +│ ├── main.rs # Entry point |
| 45 | +│ ├── radar/ # Radar logic and broadcasting |
| 46 | +│ │ ├── detector/ # Radar detection and plotting |
| 47 | +│ │ ├── tracker/ # Track generation and filtering |
| 48 | +│ │ ├── broadcaster/ # Data output via TCP/WebSocket |
| 49 | +│ ├── simulation/ # Simulation models |
| 50 | +│ │ ├── emitters/ # Emitter and ship definitions |
| 51 | +│ │ ├── environment/ # Environmental effects (e.g. waves) |
| 52 | +│ │ ├── movement/ # Movement patterns and strategies |
| 53 | +│ │ └── simulation.rs # Simulation loop |
| 54 | +├── Cargo.toml # Project metadata and dependencies |
| 55 | +└── Cargo.lock # Version lockfile |
143 | 56 | ``` |
144 | 57 |
|
145 | | -## **Other Dependencies** |
| 58 | +## Learn More |
| 59 | + |
| 60 | +For demos, examples, and system overview, visit the official platform website: |
| 61 | +👉 [https://thesoftwaredesignlab.github.io/ANTARES/antares-simulator](https://thesoftwaredesignlab.github.io/ANTARES/antares-simulator) |
146 | 62 |
|
147 | | -- **`chrono`**: Handles date and time functionality. |
148 | | -- **`rand`**: Generates random numbers for simulation randomness. |
149 | | -- **`serde` and `serde_derive`**: Serializes and deserializes data structures. |
150 | | -- **`toml`**: Parses TOML configuration files. |
151 | | -- **`std::thread`**: For multi-threaded processing. |
0 commit comments