-
Notifications
You must be signed in to change notification settings - Fork 32
Communications Simulation
Radio communication can be simulated without the use of XBee radios.
Under "comm_simulation" in the configs file, when "toggled_on" is set to true, a comm_simulation thread is started. Either file_simulated or http_simulated may then be set to true, toggling the type of simulation. file_simulation will read commands from the specified text file(under "comm_sim_file") and send them to xbee_callback. http_sim will read messages from HTTP POST requests sent to localhost:8080 (recommend using postman for intended use). Both methods will invoke xbee_callback and should be formatted as if they were sent by radio from GCS, as JSON bodies.
Commands from the text file are read line by line. Each line should include the time to execute the instruction and the message formatted as a JSON string. "~" is used as a delimiter.
Example (file sim):
0.0~{"type":"start", "searchArea":{"center":[1, 1], "rad1":0, "rad2":100}}
1.0~{"type":"pause"}
2.0~{"type":"resume"}
3.0~{"type":"stop"}
Example (HTTP sim):
GET localhost:8080
body: {"type":"continue"}
More info about proper message formatting can be found on the JSON Message Formatting wiki page.
- Project Overview
- Dependency List
- GCS JSON Message Formatting
- Dronekit mission_basic.py
- Continuous Integration with Travis
- Engineering Requirements
- Test Hierarchy
- Style Guide
- Glossary