Coder Social home page Coder Social logo

px4_gzweb's Introduction

Docker Environment for PX4 Development with ROS2 Foxy and Gazebo Web Simulation (gzweb)

This repository contains a Dockerfile to build a Docker image for PX4 development with ROS2 Foxy and Gazebo Web Simulation (gzweb). This docker image can be used to run the PX4 SITL simulation on headless infrastructure. The Gazebo client is served via a web browser.

Screenshot

Prerequisites

  • Git
  • Docker

Build the Docker Image

Clone this repository:

git clone https://github.com/joshuadamanik/px4_gzweb.git --recursive
cd px4_gzweb

Build the Docker image and run the container:

docker build -t px4_gzweb:latest -f Dockerfile-<arch> .
docker run -it --rm --name px4_gzweb
    -v src/PX4-Autopilot:/root/PX4-Autopilot
    -v src/ws_commander:/root/ws_commander
    -p 8080:8080
    -p 14570:14570/udp
    px4_gzweb:latest bash

Or pull the Docker image from Docker Hub:

docker run -it --rm --name px4_gzweb
    -v src/PX4-Autopilot:/root/PX4-Autopilot
    -v src/ws_commander:/root/ws_commander
    -p 8080:8080
    -p 14570:14570/udp
    joshuajdmk/px4_gzweb:<arch> bash

where <arch> is the architecture of your host machine. The following architectures are supported:

  • amd64 (x86_64) : Linux, Windows
  • arm64 (ARMv8) : macOS

Run the PX4 SITL Simulation

Attach two terminals to the Docker container.

Terminal 1:

cd /root/PX4_Autopilot
HEADLESS=1 make px4_sitl gazebo-classic

Terminal 2:

cd /root/gzweb
npm start

Open a web browser and navigate to http://localhost:8080/. You should see the Gazebo client.

Build and Run the ROS2 Commander

Attach another two terminals to the Docker container.

Terminal 3:

MicroXRCEAgent udp4 -p 8888

Terminal 4:

cd /root/ws_commander
source /opt/ros/foxy/setup.bash
colcon build
source install/setup.bash
ros2 launch px4_ros_com offboard_control.launch.yaml

License

This repository is licensed under the BSD 3-Clause License. See LICENSE for more information.

px4_gzweb's People

Contributors

damanikjosh avatar

Watchers

 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.