Giter Club home page Giter Club logo

drone_orbit's Introduction

ROS2 Package for Drone Orbit

This repository contains a ROS2 package to simulation an orbit movement for a drone.

The scripts are ran in the px4_simulator_container found in this gitlab repository here, which uses Ubuntu 20.04, ROS2 Galatic, Micro-XRCE Agent, PX4 and Gazebo.

The scripts were tested using software-in-the-loop (SITL). NED coordinate system is used in the code.

Description of Path

A video of the simulation demo can be found on YouTube here.

The drone will perform a clockwise orbit about the boat position, facing inwards towards the centre. It will start the orbit from the position (x+ORBIT_RADIUS, y). Boat positions are added to boat_queue and the drone goes to the boat at the start of the queue

cmd_timer_callback runs like a state machine to command the drone at different stages of the mission.

Build the ROS2 package

Start the px4 simulator container

cd px4_simulator_container
./launch_container.sh

Change directory into the ROS2 workspace

cd ~/ros_ws/src

Add SSH key to your github account. Follow instructions here.

View the generated public key.

cat ~/.ssh/id_ed25519.pub

Clone the repository

git clone [email protected]:yufanana/drone_orbit.git

Build with colon

colcon build

Alternatively, only build specific packages that were modified.

colcon build --packages-select <name-of-pkg>

Source the setup file

source /ros_ws/install/setup.bash

Running the package

Start the px4 simulation container

cd px4_simulator_container
./launch_container.sh

Run tmux to have multiple terminals (tmux cheatsheet).

tmux
  • The common shortcuts to use are
    • Ctrl + b % : split pane with horizontal layout
    • Ctrl + b " : split pane with vertical layout
    • Ctrl + b arrow key : switch pane to the direction

Source the setup file in each new terminal session

source /ros_ws/install/setup.bash

Run software-in-the-loop. This brings up Gazebo.

./start_sitl.sh

In 2 new terminals,

  • run the offboard control node that commands the drone movements
ros2 run drone_orbit offboard_orbit
  • run the boat publisher node to output the boat positions
ros2 run drone_orbit boat_publisher

In the terminal for the boat_publisher, enter dummy numerical values to introduce target positions for the drone to travel to.

Enter boat XY-position: <x> <y>

drone_orbit's People

Contributors

yufanana 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.