Automatically build and lint documentation (#100)

* Build and publish docs with the RPi image

* travis: Don't use docker for gitbook building

* docs: markdownlint fixes

* travis: Don't lint lessons

* travis: Don't lint lessons (for real this time)

* docs: Style fixes

* travis: Fix typo to actually deploy build artifacts

* travis: Disable automatic docs deployment, revisit this later
This commit is contained in:
sfalexrog
2019-02-06 19:28:02 +03:00
committed by Oleg Kalachev
parent 94a8b7a040
commit 8f332d8d53
11 changed files with 66 additions and 48 deletions

View File

@@ -10,24 +10,54 @@ env:
- IMAGE_NAME="$(basename -s '.git' ${TARGET_REPO})_${IMAGE_VERSION}.img"
git:
depth: 1
before_script:
- docker pull ${DOCKER}
script:
- docker run --privileged --rm -v /dev:/dev -v $(pwd):/builder/repo -e TRAVIS_TAG="${TRAVIS_TAG}" ${DOCKER}
before_deploy:
# Set up git user name and tag this commit
- git config --local user.name "goldarte"
- git config --local user.email "goldartt@gmail.com"
- sudo chmod -R 777 *
- cd images && zip ${IMAGE_NAME}.zip ${IMAGE_NAME}
deploy:
provider: releases
api_key: ${GITHUB_OAUTH_TOKEN}
file: ${IMAGE_NAME}.zip
skip_cleanup: true
on:
tags: true
draft: true
matrix:
fast_finish: true
include:
- name: "Raspberry Pi Image Build"
before_script:
- docker pull ${DOCKER}
script:
- docker run --privileged --rm -v /dev:/dev -v $(pwd):/builder/repo -e TRAVIS_TAG="${TRAVIS_TAG}" ${DOCKER}
before_deploy:
# Set up git user name and tag this commit
- git config --local user.name "goldarte"
- git config --local user.email "goldartt@gmail.com"
- sudo chmod -R 777 *
- cd images && zip ${IMAGE_NAME}.zip ${IMAGE_NAME}
deploy:
provider: releases
api_key: ${GITHUB_OAUTH_TOKEN}
file: ${IMAGE_NAME}.zip
skip_cleanup: true
on:
tags: true
draft: true
- name: "Documentation"
language: node_js
node_js:
- "10"
before_script:
- npm install gitbook-cli -g
- npm install markdownlint-cli -g
- gitbook -V
- markdownlint -V
script:
- markdownlint docs --ignore **/lesson*.md --ignore **/metodmaterials.md
- gitbook install
- gitbook build
# ***
# Disable deployments for now, revisit this later
# --sfalexrog, 06.02.2019
# ***
# deploy:
# provider: pages
# local-dir: _book
# skip-cleanup: true
# github-token: ${GITHUB_OAUTH_TOKEN}
# keep-history: true
# target-branch: gh-pages
# on:
# branch: WIP/gitbook-autobuild
# More info there
# https://github.com/travis-ci/travis-ci/issues/6893

View File

@@ -30,10 +30,3 @@
* [ROS](ros.md)
* [MAVROS](mavros.md)
* [Simple offboard](simple_offboard.md)

View File

@@ -325,10 +325,10 @@ IMPORTANT NOTE about polarity
#### Installation of the Pixhawk flight controller
1. Stick the two-sided adhesive tape in the corners of the flight controller. ![Flight controller](../assets/pixhawk.png)
> **IMPORTANT** When the motors rotate, vibrations occur, which affect sensors of the PixHawk flight controller. To avoid this effect, the number of double-sided tape layers
> **IMPORTANT** When the motors rotate, vibrations occur, which affect sensors of the Pixhawk flight controller. To avoid this effect, the number of double-sided tape layers
should be increased up to 4 5.
2. Install the flight controller in the center of the frame. ![Flight controller](../assets/topviewpixhawk.jpg)
> **IMPORTANT** The arrows on the frame and PixHawk should point in the same direction
> **IMPORTANT** The arrows on the frame and Pixhawk should point in the same direction
#### Connecting the flight controller according to the circuit diagram

View File

@@ -95,7 +95,7 @@ TODO
![Installation of the BEC voltage Converter](../assets/cl3_mountBEC.JPG)
## Installation of the 4 in 1 ESC board and the PDB power-board
## Installation of the 4 in 1 ESC board and the PDB power-board
1. Install the 4 in 1 ESC circuit-board as shown in the picture.
@@ -188,7 +188,7 @@ article [remote faults](radioerrors.md).
![Installation of Raspberry Pi Model B](../assets/cl3_mountRaspberryPi.JPG)
## Installation of Arduino and the FlySky radio receiver
## Installation of Arduino and the FlySky radio receiver
1. Mount the pins of the Arduino Nano micro-controller using soldering.
2. Install the micro-controller into a special mount, and attach to the lower deck using М3х16 screws (4 pcs).

View File

@@ -2,7 +2,7 @@
Main documentation: [http://wiki.ros.org/mavros](http://wiki.ros.org/mavros)
MAVROS \(MAVLink + ROS\) is a package for ROS that provides the possibility of controlling drones via the [MAVLink] protocol (mavlink.md). MAVROS supports flight stacks PX4 and APM. Communication is established via UART, USB, TCP or UDP.
MAVROS \(MAVLink + ROS\) is a package for ROS that provides the possibility of controlling drones via the [MAVLink](mavlink.md) protocol. MAVROS supports flight stacks PX4 and APM. Communication is established via UART, USB, TCP or UDP.
MAVROS subscribes to certain ROS topics while waiting for commands, publishes telemetry to other topics, and provides services.

View File

@@ -2,7 +2,7 @@
The Raspberry Pi Wi-Fi adapter of has two main operating modes:
1. **Client mode** RPi connects to an existing Wi-Fi network.
1. **Client mode** RPi connects to an existing Wi-Fi network.
2. **Access point mode** RPi creates a Wi-Fi network that you can connect to.
When using [the RPi image](microsd_images.md), the Wi-Fi adapter works in the [access point mode] by default (Wi-Fi.md).

View File

@@ -146,7 +146,6 @@ Start the calibration procedure
![Gyroscope calibration](../assets/calibrategyro.jpg)
> *Warning* During calibration, the drone should remain in position, be stable, etc.
## Flight modes

View File

@@ -269,7 +269,6 @@ set_velocity(vx=0.4, vy=0.0, vz=0, yaw=float('nan'), yaw_rate=0.4, frame_id='bod
Setting pitch, roll, yaw and throttle level (approximate analogue to control in [the `STABILIZED` mode](modes.md)). This service may be used for lower level monitoring of the copter behavior or controlling the copter, if no reliable data about its position are available.
Parameters:
* `pitch`, `roll`, `yaw` required pitch, roll, and yaw angle *(radians)*;

View File

@@ -1,6 +1,6 @@
# Viewing images from cameras
To view images from cameras (or other Ros topics), you can use [rviz](rviz.md), rqt, or watch them in a browser using web\_video\_server.
To view images from cameras (or other ROS topics), you can use [rviz](rviz.md), rqt, or watch them in a browser using web\_video\_server.
See read more about [using rqt](rviz.md).

View File

@@ -1,42 +1,34 @@
# Пульт на Android
# Пульт на Android
Все владельцы мобильных устройств фирмы *Apple* ещё морозным январем 2018го обзавелись приятным приложением под *iOS* для пилотирования квадрокоптеров с помощью **WiFi**. И вот, спустя год вышло такое же приложение но уже для другой операционной системы. Актуальную версию вы можете скачать [**тут**](https://vk.com/away.php?to=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dexpress.copter.cleverrc&cc_key=) .
## Введение
## Введение
В данной статье я расскажу вам о том, как можно написать свой или доработать уже имеющийся пульт для Андроид своими руками. Для работы будем использовать модный язык *Kotlin*, а в качестве среды разработки возьмем *Android Studio*. Для тех кто ни разу ей не пользовался рекомендую к ознакомлению следующие [*материалы*](https://www.google.com/search?ei=xQxDXMH0C8OOmgW4mYigDQ&q=%D0%A7%D1%82%D0%BE+%D0%B4%D0%B5%D0%BB%D0%B0%D1%82%D1%8C+%D0%B5%D1%81%D0%BB%D0%B8+%D1%8F+%D0%BD%D0%B5+%D1%83%D0%BC%D0%B5%D1%8E+%D0%BF%D0%B8%D1%81%D0%B0%D1%82%D1%8C+%D0%BF%D0%BE%D0%B4+%D0%B0%D0%BD%D0%B4%D1%80%D0%BE%D0%B8%D0%B4%3F&oq=%D0%A7%D1%82%D0%BE+%D0%B4%D0%B5%D0%BB%D0%B0%D1%82%D1%8C+%D0%B5%D1%81%D0%BB%D0%B8+%D1%8F+%D0%BD%D0%B5+%D1%83%D0%BC%D0%B5%D1%8E+%D0%BF%D0%B8%D1%81%D0%B0%D1%82%D1%8C+%D0%BF%D0%BE%D0%B4+%D0%B0%D0%BD%D0%B4%D1%80%D0%BE%D0%B8%D0%B4%3F&gs_l=psy-ab.3...4413.17423..17726...9.0..2.442.4577.45j5j1j0j1....2..0....1..gws-wiz.....6..0i71j35i39j0i131j0j0i67j0i131i67j0i22i30j33i22i29i30j33i21j33i160.0bZz-WGxoHY). Весь код приложения можно найти [**тут**](https://github.com/Tennessium/android). Если вы хотите сразу получить приложение с целью дальнейшей доработки, выполните следующую команду:
```Bash
git clone https://github.com/Tennessium/android
```
Однако чтобы вы смогли полностью понять устройство приложения, я расскажу вам о каждом этапе создания проекта, как если бы вы делали его с нуля.
## Обертка
Однако чтобы вы смогли полностью понять устройство приложения, я расскажу вам о каждом этапе создания проекта, как если бы вы делали его с нуля.
## Обертка
Начнем с самого простого - внешнего вида нашего приложения. На [**гитхабе**](https://github.com/CopterExpress/clever/tree/master/apps/android/app/src/main/assets) вы можете найти *HTML*, *CSS* и *JavaScript* файлы, это и есть веб страница с которой будет происходить управление коптером. Чтобы эта страница отображалась у нас в приложении надо:
1. Создать папку **assets** в главной папке приложения **app**
2. Добавить в нее файлы все файлы [отсюда](https://github.com/CopterExpress/clever/tree/master/apps/android/app/src/main/assets)
Если вы дошли до этого этапа то у вас уже есть необходимая веб страница, поздравляю! Теперь нам надо её как-то отобразить в приложении. Для этого в классе вашего *activity* в методе **onCreate** необходимо написать следующий код:
```Kotlin
main_web.loadUrl("file:///android_asset/index.html")
```
Где *main_web* - id вашего *WebView*, который должен находится в *xml* файле выбранного вами *activity*.
К сожалению, пульт для управления коптером требует всего экрана устройства, а элементы интерфейса системы мешают полноценному использованию программы. Для этого надо в начале метода **onCreate** вызвать следующую функцию:
```Kotlin
@@ -104,12 +96,15 @@ main_web.addJavascriptInterface(WebAppInterface(this), "appInterface")
**Важно!**
Для любой работы с интернетом на платформе *Android* в файле **AndroidManifest.xml** внутри тега *manifest* необходимо добавить такую строку:
```XML
<uses-permission android:name="android.permission.INTERNET"/>
```
Она дает вашему приложению доступ в интернет и возможность передавать данные по средствам **WiFi**. А как это делать, мы с вами сейчас и узнаем. Идём дальше!
Вы наверное заметили функцию *send* в классе **WebAppInterface**. Именно она отправляет данные на коптер. Давайте объявим ее **вне классов**:
```Kotlin
fun send(host: String, port: Int, data: ByteArray, senderPort: Int = 0): Boolean {
var ret = false
@@ -136,7 +131,7 @@ fun pack(x: Short, y: Short, z: Short, r: Short): ByteArray {
val pump_on_buf: ByteBuffer = ByteBuffer.allocate(8)
pump_on_buf.putShort(r)
pump_on_buf.putShort(z)
pump_on_buf.putShort(y)
pump_on_buf.putShort(y)
pump_on_buf.putShort(x)
return pump_on_buf.array().reversedArray()
}

View File

@@ -1,3 +1,5 @@
# Комплектация
В составе набора имеется 4 дополнительных рамы (поз. 2).
Они абсолютно одинаковые.
Поэтому для дальнейшего удобства понимания инструкции условно разделим их на верхнюю и нижнюю дополнительные рамы