These brief instructions will help you get started with the simulator. The other topics in this help provide additional information and detail about working with other aspects of this platform.

Getting Started

Welcome to the SWARM Developer System!

1. Install and Prepare Your Environment

Please follow the guide for installation in Installation Guide.

2. Install Your License Key

In the welcome email you received, please put the file labelled LicenseKey.json in the `settings` folder in the root of the `SWARM-RDS-Client` repository.

3. Start the SWARM Core System

A shell file has been provided in the `scripts` folder called `run_swarm_container.sh` that will run the Docker image containing the SWARM RDS Server.
To run this file, please run the following command in the root of the `SWARM-RDS-Client` repository:
`./scripts/run_swarm_container.sh swarm-home:1.7.4 127.0.0.1`
The first arguement is the name of the Docker image to run. The second arguement is the IP address for ROS to utilize. You can ommit the second arguement if you are running everything locally.

4. Set Up Your Simulation

Look at the following file, as shown below, in the `settings` folder called `DefaultSimulationSettings.json`.
{
    "ID": 0,
    "SimulationName": "example",
    "RunLength": 30.0,
    "Scenario": {
        "Name": "DataCollection",
        "Options": {
            "MultiLevel": true,
            "LevelNames": [
                "Home1",
                "Home2",
                "Home3"
            ]
        }
    },
    "Environment": {
        "Name": "SWARMHome",
        "StreamVideo": false
    },
    "Data": {
        "VehicleState": {
            "Format": "SWARM"
        },
        "Images": {
            "Format": "PNG"
        }
    },
    "Agents": {
        "Drone1": {
            "Vehicle": "Multirotor",
            "AutoPilot": "SWARM",
            "Sensors": {
                "Cameras": {
                    "Camera1": {
                        "X": 0.35,
                        "Y": 0.0,
                        "Z": 0.0,
                        "Settings": {
                            "Width": 640,
                            "Height": 480
                        }
                    }
                }
            },
            "Controller": {
                "Name": "SWARMBase",
                "Gains": {
                    "P": 0.45,
                    "I": 0.0,
                    "D": 0.05
                }
            },
            "SoftwareModules": {
                "HighLevelBehavior": {
                    "Level": 1,
                    "States": [],
                    "Parameters": {
                        "completed_waypoint_distance": 2.0
                    },
                    "ClassName": "PathFollowing",
                    "ReturnValues": [
                        "Position",
                        "Heading"
                    ]
                },
                "LowLevelPathPlanning": {
                    "Level": 1,
                    "States": [],
                    "Parameters": {},
                    "ClassName": "PassThroughPlanner",
                    "ReturnValues": [
                        "MovementCommand"
                    ]
                },
                "VideoRecorder": {
                    "Level": 1,
                    "States": [],
                    "Parameters": {},
                    "ClassName": "VideoRecorder",
                    "InputArgs": {},
                    "ReturnValues": []
                }
            }
        }
    }
}
You can leave everything as it is above. This configuration will run a simulation with a single agent with a single camera, returning to you a tar file containing the images collected and a set of flight logs. **Note** This file, along with the Trajectory you define, will be validated before submission.

5. Define Your Trajectory

You will need to set the set of points you want to fly. This can be done by modifying the file called `DefaultTrajectory.json` in the `settings` folder. Each point must have the five fields as shown below and you are defining points in North, East and Down (NED).
{
    "X": 0.0,
    "Y": 0.0,
    "Z": -0.5,
    "Heading": 0.0,
    "Speed": 2.0
}

6. Run the SWARM Developer Client

In another terminal, run the following command: `python3 main.py --map-name SWARMHome`. The system will validate your settings file and trajectory file to ensure they are valid and will run properly. Once you have submitted, you will see the following messages in the terminal.

7. View Your Simulation

View the Streaming output by going to any web browser and typing `127.0.0.1`, then click start to view the stream. This is a fully interactive client that will allow you to control the camera. (Hit `F1` to view options!)

8. Collect and View the Data

Once the simulation has been completed, it will ask if you want to collect data from the server. Enter the number `1`. This will start the download process.

9. View Your Data

Untar the tarball file by running `tar -xzvf data/example_data.tar.gz`. This will print out what files were collected. You can go to the `data` directory to see the files. An example video is shown below:
[titlepage]: titlepage.html [tocpage]: tocpage.html [index]: index.html [roadmap]: roadmap.html [mydoc_installation]: mydoc_installation.html [mydoc_getting_started]: mydoc_getting_started.html [px4_tutorial]: px4_tutorial.html [custom_algorithm_gui]: custom_algorithm_gui.html [custom_algorithm_cli]: custom_algorithm_cli.html [developing_with_rds]: developing_with_rds.html [data_collect_gui]: data_collect_gui.html [data_collect_cli]: data_collect_cli.html [mydoc_features]: mydoc_features.html [pytorch]: pytorch.html [currently_supported]: currently_supported.html [environment_list]: environment_list.html [environment_control]: environment_control.html [multi_level]: multi_level.html [swarm_core_api]: swarm_core_api.html [swarm_firmware_api]: swarm_firmware_api.html [sensors]: sensors.html [algorithms]: algorithms.html [pub_sub]: pub_sub.html [configuration]: configuration.html [px4_configuration]: px4_configuration.html [ros_configuration]: ros_configuration.html [swarm_classes]: swarm_classes.html [mydoc_api_doc_index]: mydoc_api_doc_index.html [mydoc_faq]: mydoc_faq.html [mydoc_hyperlinks.html#automatedlinks]: mydoc_hyperlinks.html#automatedlinks [mydoc_hyperlinks.html#bookmarklinks]: mydoc_hyperlinks.html#bookmarklinks [mydoc_pages.html#someIdTag]: mydoc_pages.html#someIdTag [index]: index.html