Skip to content

Commit

Permalink
Merge branch 'master' into verbose_rc_override
Browse files Browse the repository at this point in the history
  • Loading branch information
BillThePlatypus committed Mar 16, 2020
2 parents 4078c84 + cfe32fe commit c1cb191
Show file tree
Hide file tree
Showing 38 changed files with 1,018 additions and 337 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Documentation

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
uses: actions/setup-python@v1
with:
python-version: '3.x'
architecture: 'x64'
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mkdocs mkdocs-material pygments pymdown-extensions
- name: Build Documentation
run: |
mkdocs build -s
21 changes: 21 additions & 0 deletions .github/workflows/f1_firmware.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: F1 Firmware

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: checkout submodules
run: git submodule update --init --recursive
- name: install toolchain
run: |
sudo add-apt-repository -y -u ppa:team-gcc-arm-embedded/ppa
sudo apt -y install gcc-arm-embedded
- name: check toolchain
run: arm-none-eabi-gcc --version
- name: make
run: make BOARD=NAZE -j4 -l4
21 changes: 21 additions & 0 deletions .github/workflows/f4_firmware.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: F4 Firmware

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: checkout submodules
run: git submodule update --init --recursive
- name: install toolchain
run: |
sudo add-apt-repository -y -u ppa:team-gcc-arm-embedded/ppa
sudo apt -y install gcc-arm-embedded
- name: check toolchain
run: arm-none-eabi-gcc --version
- name: make
run: make BOARD=REVO -j4 -l4
37 changes: 37 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: "pre-release"

on:
push:
branches:
- "master"

jobs:
pre-release:
name: "Pre Release"
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v2
- name: checkout submodules
run: git submodule update --init --recursive
- name: install toolchain
run: |
sudo add-apt-repository -y -u ppa:team-gcc-arm-embedded/ppa
sudo apt -y install gcc-arm-embedded
- name: check toolchain
run: arm-none-eabi-gcc --version
- name: make_f4
run: make BOARD=REVO -j4 -l4
- name: make_f1
run: make BOARD=NAZE -j4 -l4

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: |
boards/airbourne/build/rosflight_REVO_Release.bin
boards/breezy/build/rosflight_NAZE_Release.hex
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: "Release"

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
release:
name: "Release"
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v2
- name: checkout submodules
run: git submodule update --init --recursive
- name: install toolchain
run: |
sudo add-apt-repository -y -u ppa:team-gcc-arm-embedded/ppa
sudo apt -y install gcc-arm-embedded
- name: check toolchain
run: arm-none-eabi-gcc --version
- name: make_f4
run: make BOARD=REVO -j4 -l4
- name: make_f1
run: make BOARD=NAZE -j4 -l4

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
boards/airbourne/build/rosflight_REVO_Release.bin
boards/breezy/build/rosflight_NAZE_Release.hex
35 changes: 35 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Unit Tests

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: clone
run: git submodule update --init --recursive
- name: apt install
run: sudo apt-get install -y build-essential cmake libgtest-dev libeigen3-dev
- name: install gtest
run: |
cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make
sudo cp *.a /usr/lib
- name: cmake
run: |
cd test
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
- name: make
run: |
cd test/build
make
- name: test
run: |
cd test/build
./unit_tests
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# ROSflight
[![Build Status](https://travis-ci.org/rosflight/firmware.svg?branch=master)](https://travis-ci.org/rosflight/firmware)

![Unit Tests](https://github.com/rosflight/firmware/workflows/Unit%20Tests/badge.svg)
![F4 Firmware](https://github.com/rosflight/firmware/workflows/F4%20Firmware/badge.svg)
![F1 Firmware](https://github.com/rosflight/firmware/workflows/F1%20Firmware/badge.svg)

![Documentation](https://github.com/rosflight/firmware/workflows/Documentation/badge.svg)

This is the firmware required for STM32F10x-based flight controllers (Naze32, Flip32 etc...) and STM32F4x5 boards (Revo) to run ROSflight. ROSflight is a software architecture which uses a simple, inexpensive flight controller in tandem with a much more capable companion computer running ROS. The companion computer is given a high-bandwidth connection to the flight controller to access sensor information and perform actuator commands at high rates. This architecture provides direct control of lower-level functions via the embedded processor while also enabling more complicated functionality such as vision processing and optimization via the ROS middleware.

ROSflight is designed to accomplish the following objectives:

1. Provide simpler and easier methods to develop and run advanced autopilot code on both multirotor and fixed-wing UAVs without extensive embedded programming.
1. Robust software-in-the-loop (SIL) simulation tools for rapid testing and development of UAV code.
1. The extensive use of peer-reviewed sources for all critical control and estimation algorithms complete with official documentation explaining all critical code.
1. Prioritize high-bandwidth, low-latency communication with a companion computer running ROS.
2. Robust software-in-the-loop (SIL) simulation tools for rapid testing and development of UAV code.
3. The extensive use of peer-reviewed sources for all critical control and estimation algorithms complete with official documentation explaining all critical code.
4. Prioritize high-bandwidth, low-latency communication with a companion computer running ROS.

These objectives will allow researchers to more easily develop, test and field UAV code by prioritizing offboard control, good documentation and robust development tools.

Expand Down
5 changes: 4 additions & 1 deletion boards/airbourne/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ AIRBOURNE_SRCS = led.cpp \
uart.cpp \
M25P16.cpp \
ms4525.cpp \
backup_sram.cpp
backup_sram.cpp \
analog_digital_converter.cpp \
analog_pin.cpp \
battery_monitor.cpp \


# board-specific source files
Expand Down
55 changes: 49 additions & 6 deletions boards/airbourne/airbourne_board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ void AirbourneBoard::sensors_init()
sonar_.init(&ext_i2c_);
airspeed_.init(&ext_i2c_);
// gnss_.init(&uart1_);
battery_adc_.init(battery_monitor_config.adc);
battery_monitor_.init(battery_monitor_config, &battery_adc_, 0,0);
}

uint16_t AirbourneBoard::num_sensor_errors()
Expand Down Expand Up @@ -331,6 +333,36 @@ GNSSRaw AirbourneBoard::gnss_raw_read()
return raw;
}

bool AirbourneBoard::battery_voltage_present() const
{
return this->battery_monitor_.has_voltage_sense();
}

float AirbourneBoard::battery_voltage_read() const
{
return static_cast<float>(this->battery_monitor_.read_voltage());
}

void AirbourneBoard::battery_voltage_set_multiplier(double multiplier)
{
this->battery_monitor_.set_voltage_multiplier(multiplier);
}

bool AirbourneBoard::battery_current_present() const
{
return this->battery_monitor_.has_current_sense();
}

float AirbourneBoard::battery_current_read() const
{
return static_cast<float>(this->battery_monitor_.read_current());
}

void AirbourneBoard::battery_current_set_multiplier(double multiplier)
{
this->battery_monitor_.set_current_multiplier(multiplier);
}

// PWM
void AirbourneBoard::rc_init(rc_type_t rc_type)
{
Expand Down Expand Up @@ -432,16 +464,27 @@ void AirbourneBoard::led1_toggle()
led2_.toggle();
}

//Backup memory
bool AirbourneBoard::has_backup_data()
// Backup memory
void AirbourneBoard::backup_memory_init()
{
BackupData backup_data = backup_sram_read();
return (check_backup_checksum(backup_data) && backup_data.error_code!=0);
backup_sram_init();
}

rosflight_firmware::BackupData AirbourneBoard::get_backup_data()
bool AirbourneBoard::backup_memory_read(void *dest, size_t len)
{
return backup_sram_read();
backup_sram_read(dest, len);
return true; //!< @todo backup_sram_read() has no return value
}

void AirbourneBoard::backup_memory_write(const void *src, size_t len)
{
backup_sram_write(src, len);
}

void AirbourneBoard::backup_memory_clear(size_t len)
{
backup_sram_clear(len);
}


} // namespace rosflight_firmware
21 changes: 18 additions & 3 deletions boards/airbourne/airbourne_board.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
#include "uart.h"
#include "mb1242.h"
#include "backup_sram.h"
#include "analog_digital_converter.h"
#include "analog_pin.h"
#include "battery_monitor.h"
// #include "ublox.h"

#include "board.h"
Expand Down Expand Up @@ -88,6 +91,8 @@ class AirbourneBoard : public Board
LED led2_;
LED led1_;
M25P16 flash_;
AnalogDigitalConverter battery_adc_;
BatteryMonitor battery_monitor_;
// UBLOX gnss_;

enum SerialDevice : uint32_t
Expand Down Expand Up @@ -163,6 +168,14 @@ class AirbourneBoard : public Board
bool gnss_present() override;
void gnss_update() override;

bool battery_voltage_present() const override;
float battery_voltage_read() const override;
void battery_voltage_set_multiplier(double multiplier) override;

bool battery_current_present() const override;
float battery_current_read() const override;
void battery_current_set_multiplier(double multiplier) override;

//GNSS
GNSSData gnss_read() override;
bool gnss_has_new_data() override;
Expand Down Expand Up @@ -191,9 +204,11 @@ class AirbourneBoard : public Board
void led1_off() override;
void led1_toggle() override;

//Backup Data
bool has_backup_data() override;
rosflight_firmware::BackupData get_backup_data() override;
// Backup Data
void backup_memory_init() override;
bool backup_memory_read(void *dest, size_t len) override;
void backup_memory_write(const void *src, size_t len) override;
void backup_memory_clear(size_t len) override;
};

} // namespace rosflight_firmware
Expand Down
Loading

0 comments on commit c1cb191

Please sign in to comment.