Coder Social home page Coder Social logo

aerorust / mav Goto Github PK

View Code? Open in Web Editor NEW
18.0 18.0 7.0 5.95 MB

Rust crates for the MAVLink lightweight messaging protocol for communicating with drones (and between onboard drone components).

Home Page: http://aerorust.org/mav/

Rust 100.00%
drones hacktoberfest robotics rustlang simulation

mav's People

Contributors

dylan-dpc avatar elpiel avatar o0ignition0o avatar udhaykumarbala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mav's Issues

Set up ArduPilot (SITL) with Docker & Gazebo simulation

Possibly blocked by #4

We currently support the PX4 autopilot (flight control software) https://px4.io however we would like to have a similar setup with another autopilot: ArduPilot https://ardupilot.org.

Goal

Allow the developers using this project to focus on hacking and controlling the drones themselves instead of setting up other tools, installing other software on their machines, etc.
The set up should be as simple as possible and have a running simulation ready for use.

Resources:

Check out the list provided in the README.md

Tasks:

  • Explore how to use MAVSDK for ArduPilot #4
  • Use the available ArduPilot SITL (Software in a loop)
    • Available Docker images of Ardupilot with SITL are in the resources list.
  • Docker
    • Docker-compose - If it's not possible to use a single Dockerfile for setting up all tools
  • Simulation - Set up gazebo and the required gazebo plugin
  • Check (and setup) vehicle(s) that support Video stream from drone in the simulation

Explore how to use MAVSDK server for ArduPilot

I've recently asked in the ArduPilot community on Discord if it's possible to use MAVSDK for ArduPilot.
Apparently, the MAVSDK server is hardcoded for PX4 specifically and there might be more than a few differences.

This should be explored so that we can see what it would take to use the MAVSDK server for ArduPilot.

Basically mavsdk will runtime detect which autopilot it connects to, but some functionality is hardcoded to px4 - for instance Ardupilot uses waypoint 0 to store the home location, so missions are effectively indexed from 1. Px4 doesn’t, so missions are indexed from 0. Takeoff, land, etc should work.

ArduPilot related issues for its support in the MAVSDK server:

Document gazebo client connection with gazebo server

Overview

The gazebo server is running in a docker container in Headless mode, however, if you have installed gazebo client on your host machine you can connect to the server.

Benefits

This will allow people to view and manipulate the gazebo environment, for example to:

  • observe the drone while it's flying
  • manipulate the simulation environment by adding or moving objects and other features that the client allows for.

What you should do

Document the command we can use to connect to the server.

Tasks

Explain how to connect a gazebo client to the server in:

  • README (not really needed)
  • book - Add a section in the book

Bugs

  • ign-transport not working
  • Models don't load - because they need to be loaded from the host machine

Screenshot from 2022-08-22 17-26-48

Check MAVSDK server latency

Check what is the request-response time for the MAVSDK server which underneath uses the MAVLINK protocol to send and receive messages.

This will help us determine if it's reliable for Proof of concept project regarding flying/controlling drones.

Broken simulation setup (upstream)

The Typhoon SITL simulation is broken for some time now, I've filed an issue in the PX4 repo (see the upstream issue for more details PX4/PX4-Autopilot#19853) and the drone is not able to Arm.

We can wait for a response on the issue but also we can switch the drone model used for the simulation and try with it. There is a drawback to this (if it works) - we won't have a video stream as only the typhoon simulation supports one.

Tasks

  • Switch the drone model (easy) This does not work
  • Apply a fix to the default Typhoon SITL simulation (challenging)

Apparently this is an issue with the image itself. Once we've downgraded the image to 0.10.1 this issue disappeared:

d48b352

Examples with different Drone services

Examples

Here are 2 examples that cover one Action & one Telemetry service:

M1: px4-gazebo-headless sigabrt

Relevant logs imo:

px4-gazebo-headless    | Error Code: 11 Msg: Unable to find uri[model://baylands]
px4-gazebo-headless    | Error setting socket option (IP_MULTICAST_IF).
px4-gazebo-headless    | Error setting socket option (IP_MULTICAST_IF).
px4-gazebo-headless    | Did you set the environment variable IGN_IP with a correct IP address? 
px4-gazebo-headless    |   [172.24.0.3] seems an invalid local IP address.
px4-gazebo-headless    |   Using 127.0.0.1 as hostname.
px4-gazebo-headless    | Error setting socket option (IP_MULTICAST_IF).
px4-gazebo-headless    | terminate called after throwing an instance of 'std::out_of_range'
px4-gazebo-headless    |   what():  vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)

It looks like we're looking for multicast capabilities which may or may not be available, i m not sure and i lack context on what the container tries to achieve here

full logs can be found here:

px4-gazebo-headless    | [100%] Built target px4
px4-gazebo-headless    | Scanning dependencies of target gazebo_typhoon_h480__baylands
px4-gazebo-headless    | SITL ARGS
px4-gazebo-headless    | sitl_bin: /root/Firmware/build/px4_sitl_default/bin/px4
px4-gazebo-headless    | debugger: none
px4-gazebo-headless    | program: gazebo
px4-gazebo-headless    | model: typhoon_h480
px4-gazebo-headless    | world: baylands
px4-gazebo-headless    | src_path: /root/Firmware
px4-gazebo-headless    | build_path: /root/Firmware/build/px4_sitl_default
px4-gazebo-headless    | GAZEBO_PLUGIN_PATH :/root/Firmware/build/px4_sitl_default/build_gazebo
px4-gazebo-headless    | GAZEBO_MODEL_PATH :/root/Firmware/Tools/sitl_gazebo/models
px4-gazebo-headless    | LD_LIBRARY_PATH :/root/Firmware/build/px4_sitl_default/build_gazebo
px4-gazebo-headless    | Using: /root/Firmware/Tools/sitl_gazebo/models/typhoon_h480/typhoon_h480.sdf
px4-gazebo-headless    | not running gazebo gui
px4-gazebo-headless    | SITL COMMAND: "/root/Firmware/build/px4_sitl_default/bin/px4" "/root/Firmware/build/px4_sitl_default"/etc -s etc/init.d-posix/rcS -t "/root/Firmware"/test_data
px4-gazebo-headless    | INFO  [px4] Creating symlink /root/Firmware/build/px4_sitl_default/etc -> /root/Firmware/build/px4_sitl_default/tmp/rootfs/etc
px4-gazebo-headless    | 
px4-gazebo-headless    | ______  __   __    ___ 
px4-gazebo-headless    | | ___ \ \ \ / /   /   |
px4-gazebo-headless    | | |_/ /  \ V /   / /| |
px4-gazebo-headless    | |  __/   /   \  / /_| |
px4-gazebo-headless    | | |     / /^\ \ \___  |
px4-gazebo-headless    | \_|     \/   \/     |_/
px4-gazebo-headless    | 
px4-gazebo-headless    | px4 starting.
px4-gazebo-headless    | 
px4-gazebo-headless    | INFO  [px4] Calling startup script: /bin/sh etc/init.d-posix/rcS 0
px4-gazebo-headless    | Info: found model autostart file as SYS_AUTOSTART=6011
px4-gazebo-headless    | INFO  [param] selected parameter default file eeprom/parameters_6011
px4-gazebo-headless    | [param] parameter file not found, creating eeprom/parameters_6011
px4-gazebo-headless    |   SYS_AUTOCONFIG: curr: 0 -> new: 1
px4-gazebo-headless    |   SYS_AUTOSTART: curr: 0 -> new: 6011
px4-gazebo-headless    |   CAL_ACC0_ID: curr: 0 -> new: 1310988
px4-gazebo-headless    |   CAL_GYRO0_ID: curr: 0 -> new: 1310988
px4-gazebo-headless    |   CAL_ACC1_ID: curr: 0 -> new: 1310996
px4-gazebo-headless    |   CAL_GYRO1_ID: curr: 0 -> new: 1310996
px4-gazebo-headless    |   CAL_ACC2_ID: curr: 0 -> new: 1311004
px4-gazebo-headless    |   CAL_GYRO2_ID: curr: 0 -> new: 1311004
px4-gazebo-headless    |   CAL_MAG0_ID: curr: 0 -> new: 197388
px4-gazebo-headless    |   CAL_MAG1_ID: curr: 0 -> new: 197644
px4-gazebo-headless    |   SENS_BOARD_X_OFF: curr: 0.0000 -> new: 0.0000
px4-gazebo-headless    |   SENS_DPRES_OFF: curr: 0.0000 -> new: 0.0010
px4-gazebo-headless    | Error Code: 11 Msg: Unable to find uri[model://baylands]
px4-gazebo-headless    | Error setting socket option (IP_MULTICAST_IF).
px4-gazebo-headless    | Error setting socket option (IP_MULTICAST_IF).
px4-gazebo-headless    | Did you set the environment variable IGN_IP with a correct IP address? 
px4-gazebo-headless    |   [172.24.0.3] seems an invalid local IP address.
px4-gazebo-headless    |   Using 127.0.0.1 as hostname.
px4-gazebo-headless    | Error setting socket option (IP_MULTICAST_IF).
px4-gazebo-headless    | terminate called after throwing an instance of 'std::out_of_range'
px4-gazebo-headless    |   what():  vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)
px4-gazebo-headless    | qemu: uncaught target signal 6 (Aborted) - core dumped
px4-gazebo-headless    | * SYS_AUTOCONFIG: curr: 1 -> new: 0
px4-gazebo-headless    |   IMU_INTEG_RATE: curr: 200 -> new: 250
px4-gazebo-headless    | INFO  [dataman] Unknown restart, data manager file './dataman' size is 11798680 bytes
px4-gazebo-headless    | PX4 SIM HOST: localhost
px4-gazebo-headless    | INFO  [simulator] Waiting for simulator to accept connection on TCP port 4560

Video stream

We've setup the typhoon h480 hexrotor( https://dev.px4.io/master/en/simulation/gazebo_vehicles.html#typhoon-h480-hexrotor) as the default drone in the docker-compose file because it supports video stream in the Gazebo simulation.

Using the headless gazebo enabled docker image I tried to connect and use the video stream from the simulation, but I was not able to make it work.
Before we are able to use the Video stream in an application we need to figure out how to connect to the docker container.

Please make sure to add documentation (on the what and whys) once this is working

Guidance:

From the C RTSP video proxy:

  • port: 8554
  • route: /live

Example of a connection url (can be used in e.g. VLC): rtsp://127.0.0.1:8554/live

VLC settings example

Resources:

Related issue: JonasVautherin/px4-gazebo-headless#20

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.