Skip to content

Commit

Permalink
Merge pull request #19 from rosflight/overview-page-updates
Browse files Browse the repository at this point in the history
Overview page updates
  • Loading branch information
iandareid authored Jul 9, 2024
2 parents f43708e + c754909 commit f3dbf93
Show file tree
Hide file tree
Showing 13 changed files with 199 additions and 63 deletions.
4 changes: 4 additions & 0 deletions docs/assets/ROSplane-overview.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/ROSplane_sim.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/plotjuggler_demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/rviz_demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions docs/developer-guide/rosplane/rosplane-dev-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# ROSplane Developer Guide Overview

The purpose of the this section is to provide detailed information on each of the components of ROSplane, as shown in the below figure.
It is written with the intent that a user might know how to change each component of ROSplane, not only how to use it.

Note that the system components not part of ROSplane are not included in this section (ROSflight firmware, physical aircraft setup, etc.).


| ![Diagram of ROSplane architecture](../../assets/ROSplane-overview.svg "ROSplane architecture") |
|:--:|
|*Diagram of the ROSplane architecture*|

Each of these components are described in detail in this section, but the implementation is not fully described.
Please refer to the code for more detailed information on the actual implementation of each of the elements shown above.

## Contributing to ROSplane

If you create a new "module" when using ROSplane for your application, please contribute back!
While changes won't be included in the core ROSplane stack (see [ROSflight Vision](../../index.md#our-vision)), we hope to build a repository of modules and projects that have been created by others.
Doing this is also an effective way to share your work and help others build on it.
4 changes: 3 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

## What is ROSflight?

ROSflight is a lean and adaptable autopilot system designed from the ground up with researchers in mind. Its purpose is to enable researchers to quickly and easily try out new ideas with minimal effort. Some of ROSflight's key feature are:
ROSflight is a lean and adaptable autopilot system designed from the ground up with researchers in mind.
Its purpose is to enable researchers to quickly and easily try out new ideas with minimal effort.
Some of ROSflight's key feature are:

- Lightweight, modular, and well documented code that is easy to understand and modify.
- Most of the autopilot exists on a Linux computer rather than a microcontroller, enabling easier development with increased capabilities.
Expand Down
10 changes: 10 additions & 0 deletions docs/user-guide/flight-controller-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,13 @@ sudo apt install dfu-util
``` bash
dfu-util -a 0 -s 0x08000000 -D rosflight-F4.bin
```

## LEDs

The meaning of the various LEDs is summarized in the following table. The colors of the LEDs may change depending on your specific board:

| LED | On | Off | Slow Blink | Fast Blink |
|---------------|---------------|------------------|------------------|------------------|
| Power (Blue) | Board powered | - | - | - |
| Info (Green) | RC control | Offboard control | - | - |
| Warning (Red) | Armed | Disarmed | Error (disarmed) | Failsafe (armed) |
52 changes: 14 additions & 38 deletions docs/user-guide/overview.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Overview

!!! tldr
Visit [Getting Started](./getting-started.md) to start setting up ROSflight.
Then visit [ROSplane Overview](./rosplane-overview.md) (for fixedwing aircraft) or [ROScopter Overview](./roscopter-overview.md) (for multirotor aircraft) to set up your autonomy stack.

## Main Components of ROSflight

ROSflight is intended to be used with both a typical flight controller and a companion Linux computer. Although it can be used with just a flight controller, this setup will not offer most of the advantages of ROSflight.
Expand All @@ -11,7 +15,7 @@ ROSflight is intended to be used with both a typical flight controller and a com
- **Companion computer:** A Linux computer, running ROS2, that is mounted on the vehicle and has a physical, serial connection with the flight controller
- **Offboard control (setpoints):** The control setpoints passed from the companion computer to the flight controller. The control is "offboard" from the perspective of the flight controller, even though the computer providing those commands is mounted onboard the vehicle.

The following figure illustrates the interactions between the major components of the system:
The following figure illustrates the interactions between the major components of ROSflight:

![System Components](images/components.svg)

Expand All @@ -31,45 +35,17 @@ Although higher level control is offloaded to the companion computer, enough con

ROSplane and ROScopter are not required for using ROSflight and you could choose to use an entirely different autonomy stack if you so desired.

## RC Safety Pilot
### RC Safety Pilot

ROSflight is designed for use with offboard control from experimental and research code.
As such, it provides several mechanisms for an RC safety pilot to intervene if something goes wrong with the control setpoints coming from the companion computer:

- **RC override switch:** The safety pilot can flip a switch on the transmitter to take back RC control. Attitude and throttle override can be mapped independently, meaning you can choose one or the other, put them on separate switches, or put them both on the same switch. Details on these switches are provided on the [RC configuration](rc-configuration.md) page.
- **Stick deviations:** If a stick is deviated from its center position, then that channel is overridden by RC control. This allows the safety pilot to take control without flipping a switch. This may be useful to provide a momentary correction on a single axis. The fraction of stick travel needed to activate the RC override is controlled by the `RC_OVRD_DEV` parameter. The `OVRD_LAG_TIME` parameter controls the amount of time that the override remains active after the sticks return to center.
- **Minimum throttle:** By default, the flight controller takes the minimum of the two throttle commands from RC and offboard control setpoints. This allows the safety pilot to drop the throttle quickly if needed. This behavior can be turned on or off with the `MIN_THROTTLE` parameter.

## Arming, Errors & Failsafe

The flight controller can only be armed and disarmed via RC control.
Two mechanisms are provided: sticks (left stick down and right to arm, down and left to disarm) and switch.
Only one of these options can be active at a time.
Details on configuration are given on the [RC configuration](rc-configuration.md) page.

The firmware runs a number of error checks before allowing the flight controller to arm.
Completing the configuration checklist on the [Getting Started](getting-started.md) page should avoid these errors.
In addition to a few internal health checks, the following conditions are checked:

- **Mixer:** Valid mixer must have been selected (see the [Hardware Setup](hardware-setup.md) documentation page)
- **IMU calibration:** The IMU must have been calibrated since firmware was flashed (it is recommended that you recalibrate often)
- **RC:** There must be an active RC connection

In addition to the error checking before arming, the flight controller enters a failsafe mode if the RC connection is lost during flight while armed.
While in failsafe mode the flight controller commands level flight with the throttle value defined by the `FAILSAFE_THR` parameter.

The following is a simplified version of the finite state machine that defines logic used for the arming, error checks, and failsafe operations:

![Arming FSM](images/arming-fsm-simplified.svg)

The state manager also includes functionality for recovering from hard faults if one were to occur, although this is unlikely with unmodified firmware. If a hard fault occurs while the flight controller is armed, the firmware has the ability to immediately rearm after rebooting to enable continued RC control of the vehicle for recovery.
As such, it provides several mechanisms for an RC safety pilot to intervene if something goes wrong with the control setpoints coming from the companion computer.
See the [RC Setup](./rc-configuration.md) page for more information.

## LEDs
## Where do I start?

The meaning of the various LEDs is summarized in the following table. The colors of the LEDs may change depending on your specific board:
To get started with ROSflight, visit the [Getting Started](./getting-started.md) page.
This page will direct you on how to set up your hardware and flight controller to run ROSflight.

| LED | On | Off | Slow Blink | Fast Blink |
|---------------|---------------|------------------|------------------|------------------|
| Power (Blue) | Board powered | - | - | - |
| Info (Green) | RC control | Offboard control | - | - |
| Warning (Red) | Armed | Disarmed | Error (disarmed) | Failsafe (armed) |
After you set up ROSflight, you should set up an autonomy stack to interact with ROSflight.
Visit the [ROSplane Setup](./rosplane-setup.md) page for fixedwing aircraft or the [ROScopter Setup](./roscopter-setup.md) page for multirotor aircraft.
You can also use your own autonomy stack as described in [Autonomous Flight](./autonomous-flight.md).
33 changes: 33 additions & 0 deletions docs/user-guide/rc-configuration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# RC Configuration

## RC Safety Pilot

ROSflight is designed for use with offboard control from experimental and research code.
As such, it provides several mechanisms for an RC safety pilot to intervene if something goes wrong with the control setpoints coming from the companion computer:

- **RC override switch:** The safety pilot can flip a switch on the transmitter to take back RC control. Attitude and throttle override can be mapped independently, meaning you can choose one or the other, put them on separate switches, or put them both on the same switch. Details on these switches are provided on the [RC configuration](rc-configuration.md) page.
- **Stick deviations:** If a stick is deviated from its center position, then that channel is overridden by RC control. This allows the safety pilot to take control without flipping a switch. This may be useful to provide a momentary correction on a single axis. The fraction of stick travel needed to activate the RC override is controlled by the `RC_OVRD_DEV` parameter. The `OVRD_LAG_TIME` parameter controls the amount of time that the override remains active after the sticks return to center.
- **Minimum throttle:** By default, the flight controller takes the minimum of the two throttle commands from RC and offboard control setpoints. This allows the safety pilot to drop the throttle quickly if needed. This behavior can be turned on or off with the `MIN_THROTTLE` parameter.

## Arming, Errors & Failsafe

The flight controller can only be armed and disarmed via RC control.
Two mechanisms are provided: sticks (left stick down and right to arm, down and left to disarm) and switch.
Only one of these options can be active at a time.
Details on configuration are given on the [RC configuration](rc-configuration.md) page.

The firmware runs a number of error checks before allowing the flight controller to arm.
Completing the configuration checklist on the [Getting Started](getting-started.md) page should avoid these errors.
In addition to a few internal health checks, the following conditions are checked:

- **Mixer:** Valid mixer must have been selected (see the [Hardware Setup](hardware-setup.md) documentation page)
- **IMU calibration:** The IMU must have been calibrated since firmware was flashed (it is recommended that you recalibrate often)
- **RC:** There must be an active RC connection

In addition to the error checking before arming, the flight controller enters a failsafe mode if the RC connection is lost during flight while armed.
While in failsafe mode the flight controller commands level flight with the throttle value defined by the `FAILSAFE_THR` parameter.

The following is a simplified version of the finite state machine that defines logic used for the arming, error checks, and failsafe operations:

![Arming FSM](images/arming-fsm-simplified.svg)

The state manager also includes functionality for recovering from hard faults if one were to occur, although this is unlikely with unmodified firmware. If a hard fault occurs while the flight controller is armed, the firmware has the ability to immediately rearm after rebooting to enable continued RC control of the vehicle for recovery.

## Binding your Transmitter to your Receiver

Follow the instructions in your user manual to bind your transmitter to your RC receiver. You may also be able to find a guide on YouTube with instructions; just search for your particular transmitter and receiver model.
Expand Down
3 changes: 3 additions & 0 deletions docs/user-guide/roscopter-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ROScopter Overview

ROScopter is still under development. Check the [github repo](https://github.com/rosflight/roscopter) for the latest instructions.
36 changes: 36 additions & 0 deletions docs/user-guide/rosplane-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# ROSplane Overview

ROSplane is a basic fixed-wing autopilot build around ROS2 for use with the ROSflight autopilot.
It is built according to the methods published in *Small Unmanned Aircraft: Theory and Practice* by Dr. Randy Beard and Dr. Tim McLain.

As per the [ROSflight vision](../index.md#our-vision), ROSplane is *not* a fully-featured fixed-wing autopilot.
Instead, ROSplane is a simple, lean, ROS2-based fixedwing autopilot

The core ROSplane package is a simple waypoint-following autopilot.
This includes a navigation stack, a controller, and an estimator.
This can be seen in the figure below.

| ![Diagram of ROSplane architecture](../assets/ROSplane-overview.svg "ROSplane architecture") |
|:--:|
|*Diagram of the ROSplane architecture*|

The structure of ROSplane and the nature of ROS2 interfaces allow ROSplane to be very modular, allowing you to write and integrate your own code without having to spend as much time working with interfaces and code integration.
Since it is lean, the time to learn and understand the nature of ROSplane should be small compared to other, more featured (but more complex) autopilots.
This can improve research productivity, decrease debugging time, and improve the development of novel algorithms.

## Core Functionality

The ROSplane autopilot allows users to fly waypoint missions with an RC safety pilot.
The simplicity of this framework allows users to add their own autonomy stacks or mission requirements on top of the ROSplane stack.

For example, the `path_manager` node in the navigation stack in the core ROSplane package directs the `path_follower` node to follow either straight lines or circular arcs.
However, if a project needed to follow B-splines instead, the `path_manager` and the `path_follower` nodes could easily be replaced to achieve that.
Instead of loading a predetermined number of waypoints, higher levels of autonomy (i.e., vision-based guidance, etc.) can also be accomodated by building on top of the ROSplane stack by dynamically feeding the `path_planner` waypoints.

## Using ROSplane

For detailed instructions on how to use the core ROSplane package to fly autonomous waypoint missions, see the [ROSplane Setup](./rosplane-setup.md) page.
This page can be used as a guide to building and running ROSplane before you start making your own changes to the autonomy stack.

For detailed instructions on each of the components of ROSplane, see the [ROSplane Developer Guide](../developer-guide/rosplane/rosplane-dev-overview.md).
This page provides detailed instructions on how to use and change the code for each component of the ROSplane stack.
Loading

0 comments on commit f3dbf93

Please sign in to comment.