-
Notifications
You must be signed in to change notification settings - Fork 0
AutoNav Interpreter
The AutoNav Interpreter is responsible for interpreting commands sent from the server and running said action. It has to sort through priorities and decide what to run first. A practical approach to sending data efficiently and respective to the importance would be having multiple HTTP streams connected, each labeled respectively to the data sent through the stream. Then the program would be able to handle the data in a "queue" respective to the priority of the action. This same logic can be applied to the messages sent to the interface. Multiple HTTP streams could be created to the interface from the interpreter, and data is sent through the respective stream. Data is sent through the format of JSON objects. More about the structure of those here.
New information is categorized into "sections" e.g. 1.2, 4.3, 6.8. This is to help you navigate the documentation better. Easily navigate through those sections on the sidebar.
(insert the diagram here)
This diagram shows the high-level overview of the AutoNav Interpreter system. Below we go more in-depth about the components of this system
Section 2 is all about logging of events, and how we store data, such as ids, robot metrics, and everything else. === 2.1 Action ID System
All actions are assigned an ID. This ID is used to look up the action that is stored in a database. Here is the code we use to generate an ID:
protected String genID() {
int n = 6;
String alphaStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "0123456789"
+ "abcdefghijklmnopqrstuvwxyz";
StringBuilder sb = new StringBuilder(n);
for (int i=0;i<n;i++) {
int index = (int)(alphaStr.length() * Math.random());
sb.append(alphaStr.charAt(index));
}
sb.insert(3, "-", 0, 1);
return sb.toString();
}
Example of an ID generated with the function: luX-fMZ
IDs are stored in a database accessible by all AutoNav programs. The interface program would primarily be using this, just to display the contents of the database as a log.
AutoNav 2023 - Authored by @rohanmishr, @TreeBronch, @IncbomDev, and @PillageDev