Git Product home page Git Product logo

simple-web-control's Introduction

PREPARATION: SITL (software in the loop) Setup Guide

For those who are curious, you can find the ardupilot SITL documentation here

This guide provides the steps to setup the ArduPilot's Software in the Loop (SITL) environment on your raspberry pi.

Prerequisites

Before you begin, make sure your Linux distribution is up-to-date and has `git` and `python3` installed.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git python3 python3-dev python3-pip
pip3 install future

Step 1: Clone the ArduPilot repository

cd ~/
git clone https://github.com/ArduPilot/ardupilot.git --depth 1
cd ardupilot

Step 2: Update submodules

git submodule update --init --recursive

Step 3: Run the Setup Script

Navigate to the directory where the setup scripts reside and run the appropriate setup script for your environment. For Ubuntu, run:

cd Tools/environment_install
./install-prereqs-ubuntu.sh -y

When the script finishes execution, reload the path:

. ~/.profile

Step 4: Add the `Tools/autotest` directory to your PATH

echo -e "\nexport PATH=$PATH:$HOME/ardupilot/Tools/autotest" >> ~/.zshrc
source ~/.zshrc

Step 5: Setup the sim for first use

The ardupilot instructions suggest running the sim with the -w flag on first execution to load all default values. Wait for the build process to fully complete! Once this is commpleted, and you see messages about battery status, you can exit with ctrl+c. Make sure to run this from the ArduSub folder

cd ~/ardupilot/ArduSub/
sim_vehicle.py -w

Note: sim_vehicle.py is located in the ardupilot/Tools/autotest folder

Step 6: Run SITL simulation with QGroundcontrol

Find your laptop ip address on the RPi network interface

The simulation will be running on your Raspberry Pi, but QGroundcontrol needs to be launched from your laptop. For the sim to be able to find your laptop, you'll have to specify the ip address of your laptop. This is the ip address on the usb ethernet adapter, not your wlan.

  • Click here for instructions on MAC
  • Click here for Windows
  • For Linux simply type ifconfig in your terminal, and find the adapter starting with enx

Launch the simulator

In the command below, make sure to change the the <hostname> section with the correct name or ip.

cd ArduSub
sim_vehicle.py --vehicle=ArduSub --aircraft="bwsibot" -L RATBeach --out=udp:<hostname>:14550

Finally, launch QGroundcontrol

If you haven't done so yet, you can download it from the QGroundControl's official download page.

RUNNING THE SIMPLE WEB CONTROLS

On the Raspberry Pi

INSTALL DEPENDENCIES

Create a new virtual environment and install the dependencies

cd simple-web-control
mkvirtualenv -p python3 simple-web-control
workon simple-web-control# SITL documentation
[You can find the ardupilot SITL documentation here](https://ardupilot.org/dev/docs/sitl-simulator-software-in-the-loop.html)

# ArduPilot SITL Setup Guide

This guide provides the steps to setup the ArduPilot's Software in the Loop (SITL) environment on Ubuntu Linux.

## Prerequisites

Before you begin, make sure your Linux distrhibution is up-to-date and has \`git\` and \`python3\` installed. 

```bash
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git python3 python3-dev python3-pip
pip3 install future

Step 1: Clone the ArduPilot repository

cd ~/
git clone https://github.com/ArduPilot/ardupilot.git --depth 1
cd ardupilot

Step 2: Update submodules

git submodule update --init --recursive

Step 3: Run the Setup Script

Navigate to the directory where the setup scripts reside and run the appropriate setup script for your environment. For Ubuntu, run:

cd Tools/environment_install
./install-prereqs-ubuntu.sh -y

When the script finishes execution, reload the path:

. ~/.profile

Step 4: Add the `Tools/autotest` directory to your PATH

echo -e "\nexport PATH=$PATH:$HOME/ardupilot/Tools/autotest" >> ~/.zshrc
source ~/.zshrc

Step 5: Setup the sim for first use

The ardupilot instructions suggest running the sim with the -w flag on first execution to load all default values.

ℹ️ Wait until the build process is fully finished!.

Once everything is built, and you start seeing messages about battery level, you can exit with ctrl+c. Make sure to run this from the ArduSub folder

cd ~/ardupilot/ArduSub/
sim_vehicle.py -w

Note: sim_vehicle.py is located in the ardupilot/Tools/autotest folder

Step 6: Run SITL simulation with QGroundcontrol

Find your laptop ip address on the RPi network interface

The simulation will be running on your Raspberry Pi, but QGroundcontrol needs to be launched from your laptop. For the sim to be able to find your laptop, you'll have to specify the ip address of your laptop. This is the ip address on the usb ethernet adapter, not your wlan.

pip install -r requirements.txt


### RUN

```bash
python sliders.py

ℹ️ Keep an eye on the terminal for the output of the script. Wait for the script to verify that the ROV has been armed

On your laptop

simple-web-control's People

Contributors

vince-vd avatar travtran05 avatar msis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.