Layout
The SWARM Firmware documentation has the following structure:
- Examples - "How do you use this thing?"
- SWARM Firmware Modules - "Our fancy software system (and no it's not ROS)"
- Built-In Algorithms - "The real power here!"
Examples
Most of the configuration of the SWARM system is completed through the `SimulationSettings.json` file that can be found in the `settings` folder in the root of the project. The examples shown below provide examples of how to use Python to spin up the system quickly. For detailed information on settings, please see Configurator Guide.
Running A Simulation
The following Python code can be found in the `examples` folder in the main directory.
Let's go through this line by line.
Line 1 - 3 Import the SWARM Module (DOCS LINK) and set your API Key.
Line 5 Create a new instance of the SWARM Module, giving it the API key you defined
and a possible IP address if you are using the SWARM Developer Cloud version.
Line 7 Validate the name of the environment you chose. This is confirmed with the Server
to make sure you have the right environment selected.
Line 9 Run the setup process, providing the name of the map.
Line 11 Build the simulation, setting up the needed files and perparing the Client.
Line 13 Run the simulation. This sends the Simulation package to the Core server
Extracting Data
In this example, we will extract data from the SWARM Core server once we have submitted a simulation.
Using the example above, we can now extract a data package in the form of a tar file.
A loading bar will pop up once you send this command, indicating how large the file is that will downloaded. The data will be stored in the `data` folder in a folder labeled the name of the simulation that is provided.
View A Level
You can now spin up an environment for a fixed period of time and fly through said environment to see the level layout, what is of interest, etc.
To do this, you only need to make a small change. You can also use the file view_level.py in the examples folder. You can use the Python code below.
Let's go through this line by line.
Line 1 - 3 Import the SWARM Module (DOCS LINK) and set your API Key.
Line 5 Create a new instance of the SWARM Module, giving it the API key you defined
and a possible IP address if you are using the SWARM Developer Cloud version.
Line 7 Validate the name of the environment you chose. This is confirmed with the Server
to make sure you have the right environment selected.
Line 9 Run the setup process, providing the name of the map.
Line 11 Build the simulation, setting up the needed files and perparing the Client.
Line 13 Run the simulation in "View Only". This sends the Simulation package to the Core server and runs the
simulation, but will not move the agent.
SWARM Firmware Modules
Description
The SWARM Firmware consists of a set of flexible modules that can be quickly inserted into each agent, allowing maximum performance and usefulness. As Python allows for an easy process to go from one to many components, each module has a similar structure, such as receiving messages, operating in our "multi-level" paradigm and more.
Each module has it's own logging system and ability to run a collection of specifically designed algorithms, allowing for maximum plug and play as needed during development.
Now, we know what you may be thinking: "Python is slow!". You're right, especially when working on any embedded system. container p-3 shadow-sm my-3, we thought of that and we came up with a new way. The backbone of each module is written in C++, which is then managed by our Python manager. So, when you're ready for the real world, we make the process of going Python -> C++ that much easier. More on this later!
Available Modules
</div>
Built-In Algorithms
Description
Below are the provided algorithms, which can be referenced by the ClassName
Path Following
Pass Through Planner
- None
Pass Through Trajectory Planner
- None
Video Recorder
- None