Skip to content

Commit

Permalink
Merge branch 'main' of github.com:PegasusResearch/pegasus
Browse files Browse the repository at this point in the history
  • Loading branch information
jschpinto committed May 16, 2024
2 parents f06f87c + 0046d7f commit 07488cf
Show file tree
Hide file tree
Showing 9 changed files with 158 additions and 6 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/doc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build docs

on:
push:
branches:
main
pull_request:
branches:
- main

jobs:
build-docs:
name: Build documentation
runs-on: ubuntu-22.04
if: github.repository == 'PegasusResearch/pegasus'

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Checkout code
uses: actions/checkout@v2

- name: Install doc requirements
working-directory: ./docs
run: pip install -r requirements.txt

- name: Compile html docs
working-directory: ./docs
run: make html

- name: Deploy to github pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Not only have you made this project possible, but also crashing drones an enjoya
source/features/states
source/features/controllers
source/features/geofencing
source/features/static_trajectory_manager

.. toctree::
:maxdepth: 3
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ sphinx_mdinclude==0.5.3
myst-parser==0.18.1
sphinxcontrib-bibtex==2.5.0
sphinxcontrib-youtube==1.2.0
readthedocs-sphinx-search==0.1.2
readthedocs-sphinx-search==0.3.2
49 changes: 48 additions & 1 deletion docs/source/features/autopilot.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,51 @@
Autopilot
=========

At the center of the Guidance and Control system is the Autopilot.
At the center of the Guidance and Control system is the Autopilot, implemented in C++. This is located inside the ``pegasus_autopilot/autopilot`` package.
The Autopilot is responsible for keeping track of the current operating ``mode`` of the vehicle. It exposes to each operation ``mode`` the following APIs:

* ``Control`` - Provides the control commands to the vehicle to track a given position, attitude, velocity, etc.
* ``Geofencing`` - Checks if the vehicle is within the geofence and if not, provides the control commands to bring the vehicle back inside the geofence.
* ``Trajectory Manager`` - Manages desired trajectories for the vehicle to follow.

It also provides each mode with the current ``state`` of the vehicle, which includes the current position, velocity, attitude, etc.

The autopilot operation ``modes``, ``controllers``, ``geofencing`` and ``trajectory manager`` are implemented as ROS 2 plugins. This allows for easy extensibility and customization of the Autopilot, without having
to modify the base autopilot packages. The Autopilot is responsible for loading the plugins at runtime and managing the communication between them.

0. Operating Modes
------------------

The default operating modes provided by the Autopilot are:

* ``Arm`` - The vehicle is armed and ready to take off.
* ``Disarm`` - The vehicle is on the ground and disarmed.
* ``Takeoff`` - The vehicle takes of to a predefined altitude above the current position.
* ``Land`` - The vehicle lands at the current position.
* ``Hold`` - The vehicle holds its current position.
* ``Follow Trajectory`` - The vehicle follows the trajectory loaded in the trajectory manager.
* ``Waypoint`` - The vehicle goes to a waypoint.


1. Autopilot Code
-----------------

.. literalinclude:: ../../../pegasus_autopilot/autopilot/include/autopilot/autopilot.hpp
:language: c++
:emphasize-lines: 87-88, 90-91, 93-94, 102-103, 127-128, 130-131, 133-136, 182-186
:linenos:

2. Explanation
--------------

In order to

.. literalinclude:: ../../../pegasus_autopilot/autopilot/include/autopilot/autopilot.hpp
:language: c++
:lines: 87-88
:lineno-start: 87





9 changes: 8 additions & 1 deletion docs/source/features/controllers.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
Controllers
===========
===========

0. Definition of the Controller Interface
-----------------------------------------
.. literalinclude:: ../../../pegasus_autopilot/autopilot/include/autopilot/controller.hpp
:language: c++
:emphasize-lines: 92-95, 97-101, 128-130, 132-139, 141-148, 150-157, 159-166, 168-173
:linenos:
9 changes: 8 additions & 1 deletion docs/source/features/geofencing.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
Geofencing
==========
==========

0. Definition of the Geofencing Interface
-----------------------------------------
.. literalinclude:: ../../../pegasus_autopilot/autopilot/include/autopilot/geofencing.hpp
:language: c++
:emphasize-lines: 92-93, 95-99
:linenos:
17 changes: 16 additions & 1 deletion docs/source/features/states.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
States
======
======

0. Definition of the State Machine Mode Interface
-------------------------------------------------
.. literalinclude:: ../../../pegasus_autopilot/autopilot/include/autopilot/mode.hpp
:language: c++
:emphasize-lines: 103-108
:linenos:

1. Provided State Machine Modes
-------------------------------
TODO

2. Adding Custom Modes to the State Machine
-------------------------------------------
TODO
17 changes: 17 additions & 0 deletions docs/source/features/static_trajectory_manager.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Static Trajectory Manager
=========================

0. Definition of the Trajectory Interface
-----------------------------------------
.. literalinclude:: ../../../pegasus_autopilot/static_trajectory_manager/include/static_trajectory_manager/static_trajectory.hpp
:language: c++
:emphasize-lines: 67-73
:linenos:

1. Provided Trajectories
------------------------
TODO

2. Adding Custom Static Trajectories
------------------------------------
TODO
24 changes: 23 additions & 1 deletion docs/source/vehicles/pegasus.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,37 @@ Pegasus Drone v1.0.0

CAD Model
---------
The lastest CAD model for the Pegasus Drone can be found in the `Pegasus CAD <https://github.com/PegasusResearch/pegasus_cad>`_ repository under a `Creative Commons Non-Commercial & Non-Military License <https://github.com/PegasusResearch/pegasus_cad/blob/main/LICENSE>`_.

.. image:: https://github.com/PegasusResearch/pegasus_cad/blob/main/docs/_static/full_assembly.png?raw=true
:width: 600
:align: center
:alt: Pegasus Drone CAD Model

Bill of Materials
-----------------

In order to replicate the Pegasus Drone, the following components are required:

* 1x `Nvidia Jetson Orin Nano Developer Kit <https://developer.nvidia.com/embedded/learn/get-started-jetson-orin-nano-devkit>`_
* 1x 256GB NVMe SSD PCIe 4.0
* 1x `Kakute H7 v1.3 stack (Microcontroller + 4in1 ESC) <https://holybro.com/products/kakute-h7-v1-stacks?variant=42833125277885>`_
* 4x `T-motor V2306 V2 2400KV <https://store.tmotor.com/product/v2306-v2-fpv-motor.html>`_
* 1x `Micro M8N GPS <https://holybro.com/collections/standard-gps-module/products/micro-m8n-gps>`_
* 1x `FrSky XM Plus ACCST 16CH Sbus <https://www.frsky-rc.com/product/xm-plus/>`_
* 1x `Realsense d435i <https://www.intelrealsense.com/depth-camera-d435i/>`_
* 4x `Propellers Dalprop Cyclone T5050 <http://www.dalprop.com>`_
* 1x Battery 4S 4300mAh
* 1x Set of jumper dupont wires
* 1x XT60 cable connector

PX4 Configuration for Indoor Flight
-----------------------------------


Pegasus Drone Setup
-------------------

Realsense Setup
---------------
---------------

0 comments on commit 07488cf

Please sign in to comment.