mirror of
https://github.com/CopterExpress/clover.git
synced 2026-06-02 07:59:32 +00:00
Compare commits
51 Commits
v0.20-alph
...
v0.20-rc.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d48c79c52 | ||
|
|
ad46a0918c | ||
|
|
9487522992 | ||
|
|
80b35d3b90 | ||
|
|
12e292c9d7 | ||
|
|
9b28e9cad2 | ||
|
|
d57ab82f38 | ||
|
|
c8da639eab | ||
|
|
c7e7edec70 | ||
|
|
72869fcf2b | ||
|
|
387d2c2341 | ||
|
|
a665caeea3 | ||
|
|
3079d2a3e1 | ||
|
|
7d5bdf4f22 | ||
|
|
2a3efa2908 | ||
|
|
ddee29a0e8 | ||
|
|
8596be07c6 | ||
|
|
a480ebe80a | ||
|
|
77ca50b901 | ||
|
|
ead9b904fa | ||
|
|
90956ecd44 | ||
|
|
f070c60e14 | ||
|
|
68edf07f6e | ||
|
|
7f161b1ad7 | ||
|
|
a41a432ef3 | ||
|
|
2b896b06d9 | ||
|
|
5070cafbfb | ||
|
|
9c0af7285c | ||
|
|
c67d937842 | ||
|
|
b79d87242f | ||
|
|
4d0ddcb319 | ||
|
|
3ff4ee6c4c | ||
|
|
90049182cf | ||
|
|
33f4601fdc | ||
|
|
2a62891d60 | ||
|
|
b043737e91 | ||
|
|
c61a0485ff | ||
|
|
f1539177eb | ||
|
|
6cbbb5580e | ||
|
|
c2d22ae12a | ||
|
|
7160d804cd | ||
|
|
3ac51baf7c | ||
|
|
48cc82001d | ||
|
|
43eae885c6 | ||
|
|
2bb29ff389 | ||
|
|
3811cbff3e | ||
|
|
2d49f58fb8 | ||
|
|
bbcf75b806 | ||
|
|
3e79c25147 | ||
|
|
2f69ad3f43 | ||
|
|
b08ad5a618 |
29
.travis.yml
29
.travis.yml
@@ -1,4 +1,5 @@
|
||||
sudo: required
|
||||
os: linux
|
||||
dist: xenial
|
||||
language: generic
|
||||
services:
|
||||
- docker
|
||||
@@ -43,7 +44,7 @@ jobs:
|
||||
- cd images && zip ${IMAGE_NAME}.zip ${IMAGE_NAME}
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key: ${GITHUB_OAUTH_TOKEN}
|
||||
token: ${GITHUB_OAUTH_TOKEN}
|
||||
file: ${IMAGE_NAME}.zip
|
||||
skip_cleanup: true
|
||||
on:
|
||||
@@ -82,18 +83,18 @@ jobs:
|
||||
- ./check_unused_assets.py
|
||||
- gitbook install
|
||||
- gitbook build
|
||||
deploy:
|
||||
provider: pages
|
||||
local-dir: _book
|
||||
skip-cleanup: true
|
||||
github-token: ${GITHUB_OAUTH_TOKEN}
|
||||
keep-history: true
|
||||
target-branch: master
|
||||
repo: CopterExpress/clever.coex.tech
|
||||
fqdn: clever.coex.tech
|
||||
verbose: true
|
||||
on:
|
||||
branch: master
|
||||
# deploy:
|
||||
# provider: pages
|
||||
# local_dir: _book
|
||||
# skip_cleanup: true
|
||||
# token: ${GITHUB_OAUTH_TOKEN}
|
||||
# keep_history: true
|
||||
# target_branch: master
|
||||
# repo: CopterExpress/clover.coex.tech
|
||||
# fqdn: clover.coex.tech
|
||||
# verbose: true
|
||||
# on:
|
||||
# branch: master
|
||||
- stage: Annotate
|
||||
name: Auto-generate changelog
|
||||
language: python
|
||||
|
||||
105
README.md
105
README.md
@@ -1,103 +1,40 @@
|
||||
# CLEVER
|
||||
# COEX Clover Drone Kit
|
||||
|
||||
<img src="docs/assets/clever4-front-white.png" align="right" width="400px" alt="CLEVER drone">
|
||||
<img src="docs/assets/clever4-front-white.png" align="right" width="400px" alt="Clover Drone">
|
||||
|
||||
CLEVER (Russian: *"Клевер"*, meaning *"Clover"*) is an educational programmable drone kit consisting of an unassembled quadcopter, open source software and documentation. The kit includes Pixhawk/Pixracer autopilot running PX4 firmware, Raspberry Pi 3 as companion computer, a camera for computer vision navigation as well as additional sensors and peripheral devices.
|
||||
Clover is an educational programmable drone kit consisting of an unassembled quadcopter, open source software and documentation. The kit includes Pixracer-compatible autopilot running PX4 firmware, Raspberry Pi 4 as companion computer, a camera for computer vision navigation as well as additional sensors and peripheral devices.
|
||||
|
||||
Copter Express has implemented a large number of different autonomous drone projects using exactly the same platform: [automated pizza delivery](https://www.youtube.com/watch?v=hmkAoZOtF58) in Samara and Kazan, coffee delivery in Skolkovo Innovation Center, [autonomous quadcopter with charging station](https://www.youtube.com/watch?v=RjX6nUqw1mI) for site monitoring and security, winning drones on [Robocross-2016](https://www.youtube.com/watch?v=dGbDaz_VmYU) and [Robocross-2017](https://youtu.be/AQnd2CRczbQ) competitions and many others.
|
||||
The main documentation is available [on Gitbook](https://clover.coex.tech/).
|
||||
|
||||
**The main documentation is available [on Gitbook](https://clever.coex.tech/).**
|
||||
Official website: <a href="https://coex.tech/clover">coex.tech/clover</a>.
|
||||
|
||||
Use it to learn how to assemble, configure, pilot and program autonomous CLEVER drone.
|
||||
## Video compilation
|
||||
|
||||
[](https://youtu.be/u3omgsYC4Fk)
|
||||
|
||||
Clover drone is used on a wide range of educational events, including [Copter Hack](https://www.youtube.com/watch?v=xgXheg3TTs4), WorldSkills Drone Operation competition, [Autonomous Vehicles Track of NTI Olympics 2016–2020](https://www.youtube.com/watch?v=E1_ehvJRKxg), Quadro Hack 2019 (National University of Science and Technology MISiS), Russian Robot Olympiad (autonomous flights), and others.
|
||||
|
||||
## Raspberry Pi image
|
||||
|
||||
**Preconfigured image for Raspberry Pi 3 with installed and configured software, ready to fly, is available [in the Releases section](https://github.com/CopterExpress/clever/releases).**
|
||||
Preconfigured image for Raspberry Pi with installed and configured software, ready to fly, is available [in the Releases section](https://github.com/CopterExpress/clover/releases).
|
||||
|
||||
[](https://travis-ci.org/CopterExpress/clever)
|
||||
[](https://travis-ci.org/CopterExpress/clover)
|
||||
|
||||
Image includes:
|
||||
Image features:
|
||||
|
||||
* Raspbian Buster
|
||||
* ROS Melodic
|
||||
* [ROS Melodic](http://wiki.ros.org/melodic)
|
||||
* Configured networking
|
||||
* OpenCV
|
||||
* mavros
|
||||
* Periphery drivers (`pigpiod`, `rpi_ws281x`, etc)
|
||||
* CLEVER software bundle for autonomous drone control
|
||||
* [`mavros`](http://wiki.ros.org/mavros)
|
||||
* Periphery drivers for ROS ([GPIO](https://clover.coex.tech/en/gpio.html), [LED strip](https://clover.coex.tech/en/leds.html), etc)
|
||||
* `aruco_pose` package for marker-assisted navigation
|
||||
* `clover` package for autonomous drone control
|
||||
|
||||
API description (in Russian) for autonomous flights is available [on GitBook](https://clever.coex.tech/simple_offboard.html).
|
||||
API description for autonomous flights is available [on GitBook](https://clover.coex.tech/en/simple_offboard.html).
|
||||
|
||||
## Manual installation
|
||||
|
||||
Install ROS Melodic according to the [documentation](http://wiki.ros.org/melodic/Installation), then [create a Catkin workspace](http://wiki.ros.org/catkin/Tutorials/create_a_workspace).
|
||||
|
||||
Clone this repo to directory `~/catkin_ws/src/clever`:
|
||||
|
||||
```bash
|
||||
cd ~/catkin_ws/src
|
||||
git clone https://github.com/CopterExpress/clever.git clever
|
||||
```
|
||||
|
||||
All the required ROS packages (including `mavros` and `opencv`) can be installed using `rosdep`:
|
||||
|
||||
```bash
|
||||
cd ~/catkin_ws/
|
||||
rosdep install -y --from-paths src --ignore-src
|
||||
```
|
||||
|
||||
Build ROS packages (on memory constrained platforms you might be going to need to use `-j1` key):
|
||||
|
||||
```bash
|
||||
cd ~/catkin_ws
|
||||
catkin_make -j1
|
||||
```
|
||||
|
||||
To complete `mavros` install you'll need to install `geographiclib` datasets:
|
||||
|
||||
```bash
|
||||
curl https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh | sudo bash
|
||||
```
|
||||
|
||||
You may optionally install udev rules to provide `/dev/px4fmu` symlink to your PX4-based flight controller connected over USB. Copy `99-px4fmu.rules` to your `/lib/udev/rules.d` folder:
|
||||
|
||||
```bash
|
||||
cd ~/catkin_ws/src/clever/clever/config
|
||||
sudo cp 99-px4fmu.rules /lib/udev/rules.d
|
||||
```
|
||||
|
||||
Alternatively you may change the `fcu_url` property in `mavros.launch` file to point to your flight controller device.
|
||||
|
||||
## Running
|
||||
|
||||
Enable systemd service `roscore` (if not running):
|
||||
|
||||
```bash
|
||||
sudo systemctl enable /home/<username>/catkin_ws/src/clever/builder/assets/roscore.service
|
||||
sudo systemctl start roscore
|
||||
```
|
||||
|
||||
To start connection to SITL, use:
|
||||
|
||||
```bash
|
||||
roslaunch clever sitl.launch
|
||||
```
|
||||
|
||||
To start connection to the flight controller, use:
|
||||
|
||||
```bash
|
||||
roslaunch clever clever.launch
|
||||
```
|
||||
|
||||
> Note that the package is configured to connect to `/dev/px4fmu` by default (see [previous section](#manual-installation)). Install udev rules or specify path to your FCU device in `mavros.launch`.
|
||||
|
||||
Also, you can enable and start the systemd service:
|
||||
|
||||
```bash
|
||||
sudo systemctl enable /home/<username>/catkin_ws/src/clever/deploy/clever.service
|
||||
sudo systemctl start clever
|
||||
```
|
||||
For manual package installation and running see [`clover` package documentation](clover/README.md).
|
||||
|
||||
## License
|
||||
|
||||
While the Clever platform source code is available under the MIT License, note, that the [documentation](docs/) is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
|
||||
While the Clover platform source code is available under the MIT License, note, that the [documentation](docs/) is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
|
||||
|
||||
@@ -394,7 +394,7 @@ publish_debug:
|
||||
int num_markers = board_->dictionary->bytesList.rows;
|
||||
if (num_markers <= id) {
|
||||
NODELET_ERROR("Marker id %d is not in dictionary; current dictionary contains %d markers. "
|
||||
"Please see https://github.com/CopterExpress/clever/blob/master/aruco_pose/README.md#parameters for details",
|
||||
"Please see https://github.com/CopterExpress/clover/blob/master/aruco_pose/README.md#parameters for details",
|
||||
id, num_markers);
|
||||
return;
|
||||
}
|
||||
|
||||
12
book.json
12
book.json
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title": "Clever",
|
||||
"title": "Clover",
|
||||
"description": "Конструктор квадрокоптера «Клевер»",
|
||||
"author": "Copter Express",
|
||||
"language": "en",
|
||||
@@ -28,7 +28,7 @@
|
||||
"blank": true
|
||||
},
|
||||
"sitemap": {
|
||||
"hostname": "https://clever.coex.tech"
|
||||
"hostname": "https://clover.coex.tech"
|
||||
},
|
||||
"toolbar": {
|
||||
"buttons":
|
||||
@@ -37,19 +37,19 @@
|
||||
"label": "Edit page on github",
|
||||
"icon": "fa fa-pencil-square-o",
|
||||
"position" : "left",
|
||||
"url": "https://github.com/CopterExpress/clever/edit/master/docs/{{filepath_lang}}"
|
||||
"url": "https://github.com/CopterExpress/clover/edit/master/docs/{{filepath_lang}}"
|
||||
},
|
||||
{
|
||||
"label": "GitHub",
|
||||
"icon": "fa fa-github",
|
||||
"position" : "left",
|
||||
"url": "https://github.com/CopterExpress/clever"
|
||||
"url": "https://github.com/CopterExpress/clover"
|
||||
}
|
||||
]
|
||||
},
|
||||
"addcssjs": {
|
||||
"css": ["../clever.css"],
|
||||
"js": ["../clever.js"]
|
||||
"css": ["../clover.css"],
|
||||
"js": ["../clover.js"]
|
||||
},
|
||||
"language-picker": {
|
||||
"languages": [["ru", "Russian"], ["en", "English"]]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Information: https://clever.coex.tech/en/programming.html
|
||||
# Information: https://clover.coex.tech/programming
|
||||
|
||||
import rospy
|
||||
from clover import srv
|
||||
@@ -15,7 +15,7 @@ set_attitude = rospy.ServiceProxy('set_attitude', srv.SetAttitude)
|
||||
set_rates = rospy.ServiceProxy('set_rates', srv.SetRates)
|
||||
land = rospy.ServiceProxy('land', Trigger)
|
||||
|
||||
# Takeoff and hover 1 m above the ground
|
||||
# Take off and hover 1 m above the ground
|
||||
navigate(x=0, y=0, z=1, frame_id='body', auto_arm=True)
|
||||
|
||||
# Wait for 3 seconds
|
||||
|
||||
37
builder/assets/examples/flight_marker.py
Normal file
37
builder/assets/examples/flight_marker.py
Normal file
@@ -0,0 +1,37 @@
|
||||
# Information: https://clover.coex.tech/en/aruco.html
|
||||
|
||||
import rospy
|
||||
from clover import srv
|
||||
from std_srvs.srv import Trigger
|
||||
|
||||
rospy.init_node('flight')
|
||||
|
||||
get_telemetry = rospy.ServiceProxy('get_telemetry', srv.GetTelemetry)
|
||||
navigate = rospy.ServiceProxy('navigate', srv.Navigate)
|
||||
navigate_global = rospy.ServiceProxy('navigate_global', srv.NavigateGlobal)
|
||||
set_position = rospy.ServiceProxy('set_position', srv.SetPosition)
|
||||
set_velocity = rospy.ServiceProxy('set_velocity', srv.SetVelocity)
|
||||
set_attitude = rospy.ServiceProxy('set_attitude', srv.SetAttitude)
|
||||
set_rates = rospy.ServiceProxy('set_rates', srv.SetRates)
|
||||
land = rospy.ServiceProxy('land', Trigger)
|
||||
|
||||
# Take off and hover 1 m above the ground
|
||||
navigate(x=0, y=0, z=1, frame_id='body', auto_arm=True)
|
||||
|
||||
# Wait for 3 seconds
|
||||
rospy.sleep(3)
|
||||
|
||||
# Fly 1 meter above ArUco marker 0
|
||||
navigate(x=0, y=0, z=1, frame_id='aruco_0')
|
||||
|
||||
# Wait for 3 seconds
|
||||
rospy.sleep(3)
|
||||
|
||||
# Fly to x=1 y=1 z=1 relative to ArUco markers map
|
||||
navigate(x=1, y=1, z=1, frame_id='aruco_map')
|
||||
|
||||
# Wait for 3 seconds
|
||||
rospy.sleep(3)
|
||||
|
||||
# Perform landing
|
||||
land()
|
||||
@@ -1,4 +1,4 @@
|
||||
# Information: https://clever.coex.tech/en/leds.html
|
||||
# Information: https://clover.coex.tech/en/leds.html
|
||||
|
||||
import rospy
|
||||
from clover.srv import SetLEDEffect
|
||||
|
||||
41
builder/assets/examples/navigate_wait.py
Normal file
41
builder/assets/examples/navigate_wait.py
Normal file
@@ -0,0 +1,41 @@
|
||||
# Information: https://clover.coex.tech/en/snippets.html#block-nav
|
||||
|
||||
import math
|
||||
import rospy
|
||||
from clover import srv
|
||||
from std_srvs.srv import Trigger
|
||||
|
||||
rospy.init_node('flight')
|
||||
|
||||
get_telemetry = rospy.ServiceProxy('get_telemetry', srv.GetTelemetry)
|
||||
navigate = rospy.ServiceProxy('navigate', srv.Navigate)
|
||||
navigate_global = rospy.ServiceProxy('navigate_global', srv.NavigateGlobal)
|
||||
set_position = rospy.ServiceProxy('set_position', srv.SetPosition)
|
||||
set_velocity = rospy.ServiceProxy('set_velocity', srv.SetVelocity)
|
||||
set_attitude = rospy.ServiceProxy('set_attitude', srv.SetAttitude)
|
||||
set_rates = rospy.ServiceProxy('set_rates', srv.SetRates)
|
||||
land = rospy.ServiceProxy('land', Trigger)
|
||||
|
||||
def navigate_wait(x=0, y=0, z=0, yaw=float('nan'), yaw_rate=0, speed=0.5, \
|
||||
frame_id='body', tolerance=0.2, auto_arm=False):
|
||||
|
||||
res = navigate(x=x, y=y, z=z, yaw=yaw, yaw_rate=yaw_rate, speed=speed, \
|
||||
frame_id=frame_id, auto_arm=auto_arm)
|
||||
|
||||
if not res.success:
|
||||
return res
|
||||
|
||||
while not rospy.is_shutdown():
|
||||
telem = get_telemetry(frame_id='navigate_target')
|
||||
if math.sqrt(telem.x ** 2 + telem.y ** 2 + telem.z ** 2) < tolerance:
|
||||
return res
|
||||
rospy.sleep(0.2)
|
||||
|
||||
# Take off 1 meter
|
||||
navigate_wait(z=1, frame_id='body', auto_arm=True)
|
||||
|
||||
# Fly forward 1 m
|
||||
navigate_wait(x=1, frame_id='body')
|
||||
|
||||
# Land
|
||||
land()
|
||||
@@ -62,6 +62,10 @@ hostnamectl set-hostname $NEW_HOSTNAME
|
||||
sed -i 's/127\.0\.1\.1.*/127.0.1.1\t'${NEW_HOSTNAME}' '${NEW_HOSTNAME}'.local/g' /etc/hosts
|
||||
# .local (mdns) hostname added to make it accesable when wlan and ethernet interfaces are down
|
||||
|
||||
echo_stamp "Enable ROS services"
|
||||
systemctl enable roscore
|
||||
systemctl enable clover
|
||||
|
||||
echo_stamp "Harware setup"
|
||||
/root/hardware_setup.sh
|
||||
|
||||
|
||||
@@ -100,10 +100,6 @@ my_travis_retry pip install -r /home/pi/catkin_ws/src/clover/clover/requirements
|
||||
source /opt/ros/melodic/setup.bash
|
||||
catkin_make -j2 -DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
echo_stamp "Enable ROS services"
|
||||
systemctl enable roscore
|
||||
systemctl enable clover
|
||||
|
||||
echo_stamp "Install clever package (for backwards compatibility)"
|
||||
cd /home/pi/catkin_ws/src/clover/builder/assets/clever
|
||||
./setup.py install
|
||||
|
||||
@@ -95,6 +95,7 @@ libjpeg8 \
|
||||
tcpdump \
|
||||
ltrace \
|
||||
libpoco-dev \
|
||||
libzbar0 \
|
||||
python-rosdep \
|
||||
python-rosinstall-generator \
|
||||
python-wstool \
|
||||
@@ -157,6 +158,10 @@ echo_stamp "Installing ptvsd"
|
||||
my_travis_retry pip install ptvsd
|
||||
my_travis_retry pip3 install ptvsd
|
||||
|
||||
echo_stamp "Installing pyzbar"
|
||||
my_travis_retry pip install pyzbar
|
||||
my_travis_retry pip3 install pyzbar
|
||||
|
||||
echo_stamp "Add .vimrc"
|
||||
cat << EOF > /home/pi/.vimrc
|
||||
set mouse-=a
|
||||
|
||||
@@ -26,5 +26,6 @@ from pymavlink import mavutil
|
||||
import rpi_ws281x
|
||||
import pigpio
|
||||
from espeak import espeak
|
||||
from pyzbar import pyzbar
|
||||
|
||||
print cv2.getBuildInformation()
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
# Make sure our Python 3 software is installed
|
||||
|
||||
import cv2
|
||||
from pyzbar import pyzbar
|
||||
|
||||
print(cv2.getBuildInformation())
|
||||
|
||||
@@ -30,6 +30,12 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
||||
|
||||
find_package(GeographicLib REQUIRED)
|
||||
|
||||
find_package(OpenCV 3 REQUIRED
|
||||
COMPONENTS
|
||||
calib3d
|
||||
imgproc
|
||||
)
|
||||
|
||||
## System dependencies are found with CMake's conventions
|
||||
# find_package(Boost REQUIRED COMPONENTS system)
|
||||
|
||||
@@ -204,6 +210,7 @@ add_dependencies(shell ${PROJECT_NAME}_generate_messages_cpp)
|
||||
## Specify libraries to link a library or executable target against
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
${catkin_LIBRARIES}
|
||||
${OpenCV_LIBRARIES}
|
||||
)
|
||||
|
||||
#############
|
||||
|
||||
73
clover/README.md
Normal file
73
clover/README.md
Normal file
@@ -0,0 +1,73 @@
|
||||
# `clover` ROS package
|
||||
|
||||
A bundle for autonomous navigation and drone control.
|
||||
|
||||
## Manual installation
|
||||
|
||||
Install ROS Melodic according to the [documentation](http://wiki.ros.org/melodic/Installation), then [create a Catkin workspace](http://wiki.ros.org/catkin/Tutorials/create_a_workspace).
|
||||
|
||||
Clone this repo to directory `~/catkin_ws/src/clover`:
|
||||
|
||||
```bash
|
||||
cd ~/catkin_ws/src
|
||||
git clone https://github.com/CopterExpress/clover.git clover
|
||||
```
|
||||
|
||||
All the required ROS packages (including `mavros` and `opencv`) can be installed using `rosdep`:
|
||||
|
||||
```bash
|
||||
cd ~/catkin_ws/
|
||||
rosdep install -y --from-paths src --ignore-src
|
||||
```
|
||||
|
||||
Build ROS packages (on memory constrained platforms you might be going to need to use `-j1` key):
|
||||
|
||||
```bash
|
||||
cd ~/catkin_ws
|
||||
catkin_make -j1
|
||||
```
|
||||
|
||||
To complete `mavros` install you'll need to install `geographiclib` datasets:
|
||||
|
||||
```bash
|
||||
curl https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh | sudo bash
|
||||
```
|
||||
|
||||
You may optionally install udev rules to provide `/dev/px4fmu` symlink to your PX4-based flight controller connected over USB. Copy `99-px4fmu.rules` to your `/lib/udev/rules.d` folder:
|
||||
|
||||
```bash
|
||||
cd ~/catkin_ws/src/clover/clover/config
|
||||
sudo cp 99-px4fmu.rules /lib/udev/rules.d
|
||||
```
|
||||
|
||||
Alternatively you may change the `fcu_url` property in `mavros.launch` file to point to your flight controller device.
|
||||
|
||||
## Running
|
||||
|
||||
Enable systemd service `roscore` (if not running):
|
||||
|
||||
```bash
|
||||
sudo systemctl enable /home/<username>/catkin_ws/src/clover/builder/assets/roscore.service
|
||||
sudo systemctl start roscore
|
||||
```
|
||||
|
||||
To start connection to SITL, use:
|
||||
|
||||
```bash
|
||||
roslaunch clover sitl.launch
|
||||
```
|
||||
|
||||
To start connection to the flight controller, use:
|
||||
|
||||
```bash
|
||||
roslaunch clover clover.launch
|
||||
```
|
||||
|
||||
> Note that the package is configured to connect to `/dev/px4fmu` by default (see [previous section](#manual-installation)). Install udev rules or specify path to your FCU device in `mavros.launch`.
|
||||
|
||||
Also, you can enable and start the systemd service:
|
||||
|
||||
```bash
|
||||
sudo systemctl enable /home/<username>/catkin_ws/src/clover/deploy/clover.service
|
||||
sudo systemctl start clover
|
||||
```
|
||||
@@ -1,17 +1,17 @@
|
||||
image_width: 640
|
||||
image_height: 480
|
||||
distortion_model: plumb_bob
|
||||
camera_name: raspicam
|
||||
camera_name: main_camera_optical
|
||||
camera_matrix:
|
||||
rows: 3
|
||||
cols: 3
|
||||
data:
|
||||
- 332.47884746146343
|
||||
- 0.
|
||||
- 324.38022493658536
|
||||
- 320.0
|
||||
- 0.
|
||||
- 333.1761847948052
|
||||
- 219.6445547142857
|
||||
- 240.0
|
||||
- 0.
|
||||
- 0.
|
||||
- 1.
|
||||
@@ -1,45 +0,0 @@
|
||||
image_width: 320
|
||||
image_height: 240
|
||||
distortion_model: plumb_bob
|
||||
camera_name: raspicam
|
||||
camera_matrix:
|
||||
rows: 3
|
||||
cols: 3
|
||||
data:
|
||||
- 166.23942373073172
|
||||
- 0.
|
||||
- 162.19011246829268
|
||||
- 0.
|
||||
- 166.5880923974026
|
||||
- 109.82227735714285
|
||||
- 0.
|
||||
- 0.
|
||||
- 1.
|
||||
distortion_coefficients:
|
||||
rows: 1
|
||||
cols: 8
|
||||
data: [ 2.15356885e-01, -1.17472846e-01, -3.06197672e-04,
|
||||
-1.09444025e-04, -4.53657258e-03, 5.73090623e-01,
|
||||
-1.27574577e-01, -2.86125589e-02, 0.00000000e+00,
|
||||
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
|
||||
0.00000000e+00, 0.00000000e+00]
|
||||
rectification_matrix:
|
||||
rows: 3
|
||||
cols: 3
|
||||
data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
|
||||
projection_matrix:
|
||||
rows: 3
|
||||
cols: 4
|
||||
data:
|
||||
- 166.23942373073172
|
||||
- 0.
|
||||
- 162.19011246829268
|
||||
- 0.
|
||||
- 0.
|
||||
- 166.5880923974026
|
||||
- 109.82227735714285
|
||||
- 0.
|
||||
- 0.
|
||||
- 0.
|
||||
- 1.
|
||||
- 0.
|
||||
@@ -3,18 +3,20 @@
|
||||
<arg name="aruco_map" default="false"/>
|
||||
<arg name="aruco_vpe" default="false"/>
|
||||
|
||||
<!-- For additional help go to https://clever.coex.tech/aruco -->
|
||||
<!-- For additional help go to https://clover.coex.tech/aruco -->
|
||||
|
||||
<!-- aruco_detect: detect aruco markers, estimate poses -->
|
||||
<node name="aruco_detect" pkg="nodelet" if="$(arg aruco_detect)" type="nodelet" args="load aruco_pose/aruco_detect nodelet_manager" output="screen" clear_params="true">
|
||||
<remap from="image_raw" to="main_camera/image_raw"/>
|
||||
<remap from="camera_info" to="main_camera/camera_info"/>
|
||||
<remap from="map_markers" to="aruco_map/markers" if="$(arg aruco_map)"/>
|
||||
<param name="cornerRefinementMethod" value="2"/>
|
||||
<param name="estimate_poses" value="true"/>
|
||||
<param name="send_tf" value="true"/>
|
||||
<param name="known_tilt" value="map"/>
|
||||
<param name="length" value="0.33"/>
|
||||
<!-- aruco detector parameters -->
|
||||
<param name="cornerRefinementMethod" value="2"/> <!-- contour refinement -->
|
||||
<param name="minMarkerPerimeterRate" value="0.075"/> <!-- 0.075 for 320x240, 0.0375 for 640x480 -->
|
||||
</node>
|
||||
|
||||
<!-- aruco_map: estimate aruco map pose -->
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<launch>
|
||||
<arg name="fcu_conn" default="usb"/>
|
||||
<arg name="fcu_ip" default="127.0.0.1"/>
|
||||
<arg name="fcu_sys_id" default="1"/>
|
||||
<arg name="gcs_bridge" default="tcp"/>
|
||||
<arg name="web_video_server" default="true"/>
|
||||
<arg name="rosbridge" default="true"/>
|
||||
@@ -19,6 +20,7 @@
|
||||
<include file="$(find clover)/launch/mavros.launch">
|
||||
<arg name="fcu_conn" value="$(arg fcu_conn)"/>
|
||||
<arg name="fcu_ip" value="$(arg fcu_ip)"/>
|
||||
<arg name="fcu_sys_id" value="$(arg fcu_sys_id)"/>
|
||||
<arg name="gcs_bridge" value="$(arg gcs_bridge)"/>
|
||||
</include>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<launch>
|
||||
<!-- article about camera setup: https://clever.coex.tech/camera_frame -->
|
||||
<!-- article about camera setup: https://clover.coex.tech/camera_setup -->
|
||||
|
||||
<arg name="direction_z" default="down"/> <!-- direction the camera points: down, up -->
|
||||
<arg name="direction_y" default="backward"/> <!-- direction the camera cable points: backward, forward -->
|
||||
@@ -18,14 +18,14 @@
|
||||
<node pkg="nodelet" type="nodelet" name="main_camera" args="load cv_camera/CvCameraNodelet nodelet_manager" clear_params="true">
|
||||
<param name="device_path" value="/dev/video0"/> <!-- v4l2 device -->
|
||||
<param name="frame_id" value="main_camera_optical"/>
|
||||
<param name="camera_info_url" value="file://$(find clover)/camera_info/fisheye_cam_320.yaml"/>
|
||||
<param name="camera_info_url" value="file://$(find clover)/camera_info/fisheye_cam.yaml"/>
|
||||
|
||||
<param name="rate" value="100"/> <!-- poll rate -->
|
||||
<param name="cv_cap_prop_fps" value="40"/> <!-- camera FPS -->
|
||||
<param name="capture_delay" value="0.02"/> <!-- approximate delay on frame retrieving -->
|
||||
<param name="rescale_camera_info" value="true"/> <!-- automatically rescale camera calibration info -->
|
||||
|
||||
<!-- camera resolution, NOTE: camera_info file should match it -->
|
||||
<!-- camera resolution -->
|
||||
<param name="image_width" value="320"/>
|
||||
<param name="image_height" value="240"/>
|
||||
</node>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<launch>
|
||||
<arg name="fcu_conn" default="usb"/> <!-- options: usb, uart, tcp, udp, sitl -->
|
||||
<arg name="fcu_ip" default="127.0.0.1"/>
|
||||
<arg name="fcu_sys_id" default="1"/>
|
||||
<arg name="gcs_bridge" default="tcp"/>
|
||||
<arg name="viz" default="true"/>
|
||||
<arg name="respawn" default="true"/>
|
||||
@@ -19,6 +20,9 @@
|
||||
<!-- sitl since PX4 1.9.0 -->
|
||||
<param name="fcu_url" value="udp://@$(arg fcu_ip):14580" if="$(eval fcu_conn == 'sitl')"/>
|
||||
|
||||
<!-- set target_system_id -->
|
||||
<param name="target_system_id" value="$(arg fcu_sys_id)" />
|
||||
|
||||
<!-- gcs bridge -->
|
||||
<param name="gcs_url" value="tcp-l://0.0.0.0:5760" if="$(eval gcs_bridge == 'tcp')"/>
|
||||
<param name="gcs_url" value="udp://0.0.0.0:14550@14550" if="$(eval gcs_bridge == 'udp')"/>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<maintainer email="okalachev@gmail.com">Oleg Kalachev</maintainer>
|
||||
<license>MIT</license>
|
||||
|
||||
<url type="website">https://clever.coex.tech/</url>
|
||||
<url type="website">https://clover.coex.tech/</url>
|
||||
<author email="okalachev@gmail.com">Oleg Kalachev</author>
|
||||
<author email="urpylka@gmail.com">Artem Smirnov</author>
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ def check_fcu():
|
||||
is_clover_firmware = True
|
||||
|
||||
if not is_clover_firmware:
|
||||
failure('not running Clover PX4 firmware, https://clever.coex.tech/firmware')
|
||||
failure('not running Clover PX4 firmware, https://clover.coex.tech/firmware')
|
||||
|
||||
est = get_param('SYS_MC_EST_GROUP')
|
||||
if est == 1:
|
||||
@@ -250,11 +250,11 @@ def check_fcu():
|
||||
try:
|
||||
battery = rospy.wait_for_message('mavros/battery', BatteryState, timeout=3)
|
||||
if not battery.cell_voltage:
|
||||
failure('cell voltage is not available, https://clever.coex.tech/power')
|
||||
failure('cell voltage is not available, https://clover.coex.tech/power')
|
||||
else:
|
||||
cell = battery.cell_voltage[0]
|
||||
if cell > 4.3 or cell < 3.0:
|
||||
failure('incorrect cell voltage: %.2f V, https://clever.coex.tech/power', cell)
|
||||
failure('incorrect cell voltage: %.2f V, https://clover.coex.tech/power', cell)
|
||||
elif cell < 3.7:
|
||||
failure('critically low cell voltage: %.2f V, recharge battery', cell)
|
||||
except rospy.ROSException:
|
||||
@@ -718,7 +718,7 @@ def check_network():
|
||||
if ros_hostname in parts:
|
||||
break
|
||||
else:
|
||||
failure('not found %s in /etc/hosts, ROS will malfunction if network interfaces are down, https://clever.coex.tech/hostname', ros_hostname)
|
||||
failure('not found %s in /etc/hosts, ROS will malfunction if network interfaces are down, https://clover.coex.tech/hostname', ros_hostname)
|
||||
|
||||
|
||||
@check('RPi health')
|
||||
|
||||
@@ -490,7 +490,7 @@ inline void checkState()
|
||||
throw std::runtime_error("State timeout, check mavros settings");
|
||||
|
||||
if (!state.connected)
|
||||
throw std::runtime_error("No connection to FCU, https://clever.coex.tech/connection");
|
||||
throw std::runtime_error("No connection to FCU, https://clover.coex.tech/connection");
|
||||
}
|
||||
|
||||
#define ENSURE_FINITE(var) { if (!std::isfinite(var)) throw std::runtime_error(#var " argument cannot be NaN or Inf"); }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<h1>Clover Drone Kit Tools</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="docs">View documentation</a> (snapshot of <a href="https://clever.coex.tech">clever.coex.tech</a>)</li>
|
||||
<li><a href="docs">View documentation</a> (snapshot of <a href="https://clover.coex.tech">clover.coex.tech</a>)</li>
|
||||
<li><a href="" id="wvs">View image topics</a> (<code>web_video_server</code>)</li>
|
||||
<li><a href="" id="butterfly">Open web terminal</a> (<code>Butterfly</code>)</li>
|
||||
<li><a href="viz.html">View 3D visualization</a> (<code>ros3djs</code>)</li>
|
||||
|
||||
18312
docs/assets/dxf/mounting_deck_small.dxf
Normal file
18312
docs/assets/dxf/mounting_deck_small.dxf
Normal file
File diff suppressed because it is too large
Load Diff
BIN
docs/assets/p4df2_1.png
Normal file
BIN
docs/assets/p4df2_1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
BIN
docs/assets/p4df2_2.jpg
Normal file
BIN
docs/assets/p4df2_2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
BIN
docs/assets/p4df2_3.jpg
Normal file
BIN
docs/assets/p4df2_3.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 183 KiB |
BIN
docs/assets/p4df2_4.jpg
Normal file
BIN
docs/assets/p4df2_4.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 98 KiB |
BIN
docs/assets/stl/mounting_deck_small.stl
Normal file
BIN
docs/assets/stl/mounting_deck_small.stl
Normal file
Binary file not shown.
@@ -40,7 +40,7 @@ section ul li:before {
|
||||
margin-bottom: 0.85em;
|
||||
}
|
||||
|
||||
/* Main Clever image */
|
||||
/* Main Clover image */
|
||||
.book img.bigclever {
|
||||
margin-bottom: -12%;
|
||||
}
|
||||
@@ -6,7 +6,7 @@ The project was created in collaboration with Texel inc. that develops 3D-scanne
|
||||
|
||||
Our fellows from Texel provided a module consisting of a Raspberry Pi and a PrimeSense 3D-sensor.
|
||||
|
||||
We provided a Clever 3 drone that's capable of autonomous flight and wrote a flight program.
|
||||
We provided a Clover 3 drone that's capable of autonomous flight and wrote a flight program.
|
||||
|
||||
To make it all work we conducted many tests, made changes in the drone's design and tuned the drone properly.
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# COEX Clever
|
||||
# COEX Clover
|
||||
|
||||
<img class="center bigclever zoom" src="../assets/clever4-front-white-large.png" width="80%" alt="COEX Clever 4">
|
||||
<img class="center bigclever zoom" src="../assets/clever4-front-white-large.png" width="80%" alt="COEX Clover 4">
|
||||
|
||||
CLEVER (Russian: *"Клевер"*, meaning *"Clover"*) is an educational kit of a programmable quadcopter that consists of popular open source components, and a set of necessary documentation and libraries for working with it.
|
||||
**Clover** is an educational kit of a programmable quadcopter that consists of popular open source components, and a set of necessary documentation and libraries for working with it.
|
||||
|
||||
The kit includes a Pixhawk/Pixracer flight controller with the PX4 flight stack, a [Raspberry Pi 3](raspberry.md) as a controlling onboard computer, and a [camera module](camera.md) for performing flights with the use of computer vision, as well as a set of various sensors and other peripherals.
|
||||
The kit includes a Pixhawk/Pixracer flight controller with the PX4 flight stack, a [Raspberry Pi 4](raspberry.md) as a controlling onboard computer, and a [camera module](camera.md) for performing flights with the use of computer vision, as well as a set of various sensors and other peripherals.
|
||||
|
||||
The Clever platform contains a [pre-configured image for Raspberry Pi](image.md) with the full set of required software for working with peripheral devices and [programming autonomous flights](simple_offboard.md). The source code of the platform and of the documentation is open and [available on GitHub](https://github.com/CopterExpress/clever).
|
||||
The Clover platform contains a [pre-configured image for Raspberry Pi](image.md) with the full set of required software for working with peripheral devices and [programming autonomous flights](simple_offboard.md). The source code of the platform and of the documentation is open and [available on GitHub](https://github.com/CopterExpress/clover).
|
||||
|
||||
If you have studied the documentation but have not found an answer to your question, join our support chat and our specialists will be happy to answer you: [@COEXHelpdesk](tg://resolve?domain=COEXHelpdesk).
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* [Glossary](gloss.md)
|
||||
* [Safety tips](safety.md)
|
||||
* Assembly
|
||||
* [Clever 4 assembly](assemble_4.md)
|
||||
* [Clever 3 assembly](assemble_3.md)
|
||||
* [Clever 2 assembly](assemble_2.md)
|
||||
* [Clover 4 assembly](assemble_4.md)
|
||||
* [Clover 3 assembly](assemble_3.md)
|
||||
* [Clover 2 assembly](assemble_2.md)
|
||||
* Configuration
|
||||
* [Initial setup](setup.md)
|
||||
* [Sensor calibration](calibration.md)
|
||||
@@ -52,8 +52,9 @@
|
||||
* [PID Setup](calibratePID.md)
|
||||
* [Model files for parts](models.md)
|
||||
* [ROS Melodic installation](ros-install.md)
|
||||
* [Camera calibration](camera_calibration.md)
|
||||
* [Quadcopter control with 4G communication](4g.md)
|
||||
* [Clever and Jetson Nano](jetson_nano.md)
|
||||
* [Clover and Jetson Nano](jetson_nano.md)
|
||||
* [Remote control app](rc.md)
|
||||
* [Wi-Fi Configuration](network.md)
|
||||
* [UART settings](uart.md)
|
||||
@@ -64,18 +65,20 @@
|
||||
* [Multimeter usage](test_connection.md)
|
||||
* [RC Troubleshooting](radioerrors.md)
|
||||
* [Flashing ESCs](esc_firmware.md)
|
||||
* [Camera calibration](camera_calibration.md)
|
||||
* [Interfacing with Arduino](arduino.md)
|
||||
* [Connecting GPS](gps.md)
|
||||
* [Working with IR sensors on Raspberry Pi 3](ir_sensors.md)
|
||||
* [FPV Setup](fpv.md)
|
||||
* [Trainer mode](trainer_mode.md)
|
||||
* [Tinning](tinning.md)
|
||||
* [Types of power connectors](connectortypes.md)
|
||||
* [Connecting 4 in 1 ESCs](4in1.md)
|
||||
* [Soldering safety](tb.md)
|
||||
* [LED strip (legacy)](leds_old.md)
|
||||
* [Contribution Guidelines](contributing.md)
|
||||
* Clever-based projects
|
||||
* [Migration to v0.20](migrate20.md)
|
||||
* Clover-based projects
|
||||
* [Drone show](clever-show.md)
|
||||
* [Copter spheric guard](shield.md)
|
||||
* [Face recognition system](face_recognition.md)
|
||||
* [Android RC app](android.md)
|
||||
@@ -84,3 +87,4 @@
|
||||
* [Copter Hack 2019](copterhack2019.md)
|
||||
* [Copter Hack 2018](copterhack2018.md)
|
||||
* [Copter Hack 2017](copterhack2017.md)
|
||||
* [Camera calibration (legacy)](camera_calib.md)
|
||||
|
||||
@@ -14,11 +14,11 @@ However, to make you fully understand the application, I will tell you about eac
|
||||
|
||||
## Wrapper
|
||||
|
||||
Let's start with the simplest thing — the appearance of our application. At [**GitHub**](https://github.com/CopterExpress/clever/tree/master/apps/android/app/src/main/assets), you can find *HTML*, *CSS* and *JavaScript* files, which make up the web page to be used for controlling the copter. To have this page displayed in our application, do the following:
|
||||
Let's start with the simplest thing — the appearance of our application. At [**GitHub**](https://github.com/CopterExpress/clover/tree/master/apps/android/app/src/main/assets), you can find *HTML*, *CSS* and *JavaScript* files, which make up the web page to be used for controlling the copter. To have this page displayed in our application, do the following:
|
||||
|
||||
1. Create folder **assets** in the main folder of the app named **app**
|
||||
|
||||
2. Add to it all files from [here](https://github.com/CopterExpress/clever/tree/master/apps/android/app/src/main/assets)
|
||||
2. Add to it all files from [here](https://github.com/CopterExpress/clover/tree/master/apps/android/app/src/main/assets)
|
||||
|
||||
If you reached this stage, you already have the web page you want, congratulations! Now we have to display it somehow in the app. To do this, in class *activity* in method **onCreate**, write the following code:
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ For interaction with ROS topics and services on a Raspberry Pi, you can use the
|
||||
|
||||
The main tutorial for rosserial: http://wiki.ros.org/rosserial_arduino/Tutorials
|
||||
|
||||
Arudino is to be installed on Clever and connected via a USB port.
|
||||
Arudino is to be installed on Clover and connected via a USB port.
|
||||
|
||||
## Configuring Arduino IDE
|
||||
|
||||
@@ -21,19 +21,19 @@ The obtained folder `ros_lib` is to be copied to `<sketches folder>/libraries` o
|
||||
To run the program on Arduino once, you can use command:
|
||||
|
||||
```(bash)
|
||||
roslaunch clever arduino.launch
|
||||
roslaunch clover arduino.launch
|
||||
```
|
||||
|
||||
To start the link with Arduino at the startup automatically, set argument `arudino` in the Clever launch file (`~/catkin_ws/src/clever/clever/launch/clever.launch`):
|
||||
To start the link with Arduino at the startup automatically, set argument `arudino` in the Clover launch file (`~/catkin_ws/src/clover/clover/launch/clover.launch`):
|
||||
|
||||
```xml
|
||||
<arg name="arduino" default="true"/>
|
||||
```
|
||||
|
||||
After the launch file is edited, restart package `clever`:
|
||||
After the launch file is edited, restart the `clover` service:
|
||||
|
||||
```(bash)
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
## Delays
|
||||
@@ -59,7 +59,7 @@ for(int i=0; i<8; i++) {
|
||||
}
|
||||
```
|
||||
|
||||
## Working with Clever
|
||||
## Working with Clover
|
||||
|
||||
The set of services and topics is similar to the regular set in [simple_offboard](simple_offboard.md) and [mavros](mavros.md).
|
||||
|
||||
@@ -69,11 +69,11 @@ An example of a program that controls the copter by position using the `navigate
|
||||
// Connecting libraries for working with rosseral
|
||||
#include <ros.h>
|
||||
|
||||
// Connecting Clever and MAVROS package message header files
|
||||
#include <clever/Navigate.h>
|
||||
// Connecting Clover and MAVROS package message header files
|
||||
#include <clover/Navigate.h>
|
||||
#include <mavros_msgs/SetMode.h>
|
||||
|
||||
using namespace clever;
|
||||
using namespace clover;
|
||||
using namespace mavros_msgs;
|
||||
|
||||
ros::NodeHandle nh;
|
||||
@@ -174,7 +174,7 @@ With Arduino, you can use the [`get_telemetry` service](simple_offboard.md). To
|
||||
|
||||
// ...
|
||||
|
||||
#include <clever/GetTelemetry.h>
|
||||
#include <clover/GetTelemetry.h>
|
||||
|
||||
// ...
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# ArUco markers
|
||||
|
||||
> **Note** The following applies to [image versions](image.md) **0.16** and up. Older documentation is still available for [for version **0.15.1**](https://github.com/CopterExpress/clever/blob/v0.15.1/docs/ru/aruco.md).
|
||||
> **Note** The following applies to [image versions](image.md) **0.16** and up. Older documentation is still available for [for version **0.15.1**](https://github.com/CopterExpress/clover/blob/v0.15.1/docs/en/aruco.md).
|
||||
|
||||
[ArUco markers](https://docs.opencv.org/3.2.0/d5/dae/tutorial_aruco_detection.html) are commonly used for vision-based position estimation.
|
||||
|
||||
@@ -12,13 +12,13 @@ Examples of ArUco markers:
|
||||
|
||||
For rapid generation of markers for printing, you may use an online tool: http://chev.me/arucogen/.
|
||||
|
||||
[Clever Raspberry Pi image](image.md) contains a pre-installed `aruco_pose` ROS package, which can be used for marker detection.
|
||||
[Clover Raspberry Pi image](image.md) contains a pre-installed `aruco_pose` ROS package, which can be used for marker detection.
|
||||
|
||||
## Modes of operation
|
||||
|
||||
There are several preconfigured modes of operation for ArUco markers on the Clever drone:
|
||||
There are several preconfigured modes of operation for ArUco markers on the Clover drone:
|
||||
|
||||
* [single marker detection and navigation](aruco_marker.md);
|
||||
* [map-based navigation](aruco_map.md).
|
||||
|
||||
> **Info** Additional documentation for the `aruco_pose` ROS package is available [on GitHub](https://github.com/CopterExpress/clever/blob/master/aruco_pose/README.md).
|
||||
> **Info** Additional documentation for the `aruco_pose` ROS package is available [on GitHub](https://github.com/CopterExpress/clover/blob/master/aruco_pose/README.md).
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
|
||||
## Configuration
|
||||
|
||||
Set the `aruco` argument in `~/catkin_ws/src/clever/clever/launch/clever.launch` to `true`:
|
||||
Set the `aruco` argument in `~/catkin_ws/src/clover/clover/launch/clover.launch` to `true`:
|
||||
|
||||
```xml
|
||||
<arg name="aruco" default="true"/>
|
||||
```
|
||||
|
||||
In order to enable map detection set `aruco_map` and `aruco_detect` arguments to `true` in `~/catkin_ws/src/clever/clever/launch/aruco.launch`:
|
||||
In order to enable map detection set `aruco_map` and `aruco_detect` arguments to `true` in `~/catkin_ws/src/clover/clover/launch/aruco.launch`:
|
||||
|
||||
```xml
|
||||
<arg name="aruco_detect" default="true"/>
|
||||
@@ -45,12 +45,12 @@ Map path is defined in the `map` parameter:
|
||||
<param name="map" value="$(find aruco_pose)/map/map.txt"/>
|
||||
```
|
||||
|
||||
Some map examples are provided in [`~/catkin_ws/src/clever/aruco_pose/map`](https://github.com/CopterExpress/clever/tree/master/aruco_pose/map).
|
||||
Some map examples are provided in [`~/catkin_ws/src/clover/aruco_pose/map`](https://github.com/CopterExpress/clover/tree/master/aruco_pose/map).
|
||||
|
||||
Grid maps may be generated using the `genmap.py` script:
|
||||
|
||||
```bash
|
||||
rosrun aruco_pose genmap.py length x y dist_x dist_y first > ~/catkin_ws/src/clever/aruco_pose/map/test_map.txt
|
||||
rosrun aruco_pose genmap.py length x y dist_x dist_y first > ~/catkin_ws/src/clover/aruco_pose/map/test_map.txt
|
||||
```
|
||||
|
||||
`length` is the size of each marker, `x` is the marker count along the *x* axis, `y` is the marker count along the *y* axis, `dist_x` is the distance between the centers of adjacent markers along the *x* axis, `dist_y` is the distance between the centers of the *y* axis, `first` is the ID of the first marker (top left marker, unless `--bottom-left` is specified), `test_map.txt` is the name of the generated map file. The optional `--bottom-left` parameter changes the numbering of markers, making the bottom left marker the first one.
|
||||
@@ -58,7 +58,7 @@ rosrun aruco_pose genmap.py length x y dist_x dist_y first > ~/catkin_ws/src/cle
|
||||
Usage example:
|
||||
|
||||
```bash
|
||||
rosrun aruco_pose genmap.py 0.33 2 4 1 1 0 > ~/catkin_ws/src/clever/aruco_pose/map/test_map.txt
|
||||
rosrun aruco_pose genmap.py 0.33 2 4 1 1 0 > ~/catkin_ws/src/clover/aruco_pose/map/test_map.txt
|
||||
```
|
||||
|
||||
Additional information on the utility can be obtained using `-h` key: `rosrun aruco_pose genmap.py -h`.
|
||||
@@ -152,7 +152,7 @@ If the drone's altitude is not stable, try increasing the `MPC_Z_VEL_P` paramete
|
||||
|
||||
In order to navigate using markers on the ceiling, mount the onboard camera so that it points up and [adjust the camera frame accordingly](camera_setup.md).
|
||||
|
||||
You should also set the `known_tilt` parameter to `map_flipped` in both `aruco_detect` and `aruco_map` sections of `~/catkin_ws/src/clever/clever/launch/aruco.launch`:
|
||||
You should also set the `known_tilt` parameter to `map_flipped` in both `aruco_detect` and `aruco_map` sections of `~/catkin_ws/src/clover/clover/launch/aruco.launch`:
|
||||
|
||||
```xml
|
||||
<param name="known_tilt" value="map_flipped"/>
|
||||
|
||||
@@ -10,13 +10,13 @@ Using this module along with [map-based navigation](aruco_map.md) is also possib
|
||||
|
||||
## Setup
|
||||
|
||||
Set the `aruco` argument in `~/catkin_ws/src/clever/clever/launch/clever.launch` to `true`:
|
||||
Set the `aruco` argument in `~/catkin_ws/src/clover/clover/launch/clover.launch` to `true`:
|
||||
|
||||
```xml
|
||||
<arg name="aruco" default="true"/>
|
||||
```
|
||||
|
||||
For enabling detection set the `aruco_detect` argument in `~/catkin_ws/src/clever/clever/launch/aruco.launch` to `true`:
|
||||
For enabling detection set the `aruco_detect` argument in `~/catkin_ws/src/clover/clover/launch/aruco.launch` to `true`:
|
||||
|
||||
```xml
|
||||
<arg name="aruco_detect" default="true"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Clever 2 construction kit assembly instruction
|
||||
Clover 2 construction kit assembly instruction
|
||||
============================================
|
||||
|
||||

|
||||

|
||||
|
||||
## The constructor kit contents
|
||||
|
||||
@@ -78,7 +78,7 @@ Clever 2 construction kit assembly instruction
|
||||
|
||||
## Additional equipment
|
||||
|
||||
### This equipment is not part of the Clever 2 constructor kit, but it is required for the assembly process
|
||||
### This equipment is not part of the Clover 2 constructor kit, but it is required for the assembly process
|
||||
|
||||
1. Soldering iron
|
||||
2. Colophony/ Flux (neutral)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Assembly of Clever 3
|
||||
# Assembly of Clover 3
|
||||
|
||||
This manual discusses the assembly of the COEX Clever 3 kit with a 4 in 1 EDC circuit-board.
|
||||
This manual discusses the assembly of the COEX Clover 3 kit with a 4 in 1 EDC circuit-board.
|
||||
|
||||

|
||||

|
||||
|
||||
> **Caution** Before using soldering equipment, be sure to read the [safety precautions when soldering](tb.md).
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Clever 4 assembly
|
||||
# Clover 4 assembly
|
||||
|
||||
<img src="../assets/assembling_clever4/clover_assembly.png" width=900 class="zoom center">
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# Step-by-step guide on autonomous flight with Clever 4
|
||||
# Step-by-step guide on autonomous flight with Clover 4
|
||||
|
||||
> **Note** The following applies to [image version](image.md) **0.20** and up. See [previous version of the article](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/auto_setup.md) for older images.
|
||||
|
||||
This manual contains links to other articles in which each of the topics addressed is discussed in more detail. If you encounter difficulties while reading one of these articles, it is recommended that you return to this manual, since many operations here are described step by step and some unnecessary steps are skipped.
|
||||
|
||||
@@ -15,9 +17,9 @@ This manual contains links to other articles in which each of the topics address
|
||||
|
||||
- Connect to Wi-Fi and open the web interface ([this article](wifi.md)).
|
||||
|
||||
After the first power-up, the network appears with a delay. You need to wait until the system is fully loaded. If the Clever network does not appear in the list of networks for a long time, reopen the window with the network selection. Then the list of networks will be updated.
|
||||
After the first power-up, the network appears with a delay. You need to wait until the system is fully loaded. If the Clover network does not appear in the list of networks for a long time, reopen the window with the network selection. Then the list of networks will be updated.
|
||||
|
||||
> **Hint** Now if you have connected to the Clever's Wi-Fi network, it is recommended to open the [local version of this guide](http://192.168.11.1/docs/ru/auto_setup.html), otherwise the links will not work.
|
||||
> **Hint** Now if you have connected to the Clover's Wi-Fi network, it is recommended to open the [local version of this guide](http://192.168.11.1/docs/ru/auto_setup.html), otherwise the links will not work.
|
||||
|
||||
- Connect to Raspberry Pi via SSH.
|
||||
|
||||
@@ -47,7 +49,7 @@ This manual contains links to other articles in which each of the topics address
|
||||
|
||||
## Basic commands
|
||||
|
||||
You will need the basic Linux commands, as well as special Clever commands, to work efficiently in the system.
|
||||
You will need the basic Linux commands, as well as special Clover commands, to work efficiently in the system.
|
||||
|
||||
Show list of files and folders:
|
||||
|
||||
@@ -55,10 +57,10 @@ Show list of files and folders:
|
||||
ls
|
||||
```
|
||||
|
||||
Go to certain directory by entering the path too it (catkin_ws/src/clever/clever/launch/):
|
||||
Go to certain directory by entering the path too it (catkin_ws/src/clover/clover/launch/):
|
||||
|
||||
```bash
|
||||
cd catkin_ws/src/clever/clever/launch/
|
||||
cd catkin_ws/src/clover/clover/launch/
|
||||
```
|
||||
|
||||
Go to home directory:
|
||||
@@ -73,10 +75,10 @@ Open the file `file.py`:
|
||||
nano file.py
|
||||
```
|
||||
|
||||
Open the file clever.launch by entering the full path to it (it works even if you're in a different directory):
|
||||
Open the file clover.launch by entering the full path to it (it works even if you're in a different directory):
|
||||
|
||||
```bash
|
||||
nano ~/catkin_ws/src/clever/clever/launch/clever.launch
|
||||
nano ~/catkin_ws/src/clover/clover/launch/clover.launch
|
||||
```
|
||||
|
||||
Save file (press sequentially):
|
||||
@@ -103,16 +105,16 @@ Raspberry Pi complete reboot:
|
||||
sudo reboot
|
||||
```
|
||||
|
||||
Reboot only Clever package:
|
||||
Reboot only the `clover` service:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
Perform selfcheck:
|
||||
|
||||
```bash
|
||||
rosrun clever selfcheck.py
|
||||
rosrun clover selfcheck.py
|
||||
```
|
||||
|
||||
Stop a program:
|
||||
@@ -127,10 +129,10 @@ Start a program `myprogram.py` using Python:
|
||||
python myprogram.py
|
||||
```
|
||||
|
||||
Journal of the events related to Clever package. Scroll the list by pressing Enter or Ctrl+V (scrolls faster):
|
||||
Journal of the events related to `clover` package. Scroll the list by pressing Enter or Ctrl+V (scrolls faster):
|
||||
|
||||
```bash
|
||||
journalctl -u clever
|
||||
journalctl -u clover
|
||||
```
|
||||
|
||||
Open the sudoers file with super user rights (this particular file doesn't open without sudo. You can use sudo to open other locked files or run programs that require super user rights):
|
||||
@@ -141,45 +143,45 @@ sudo nano /etc/sudoers
|
||||
|
||||
## Setting Raspberry Pi for autonomous flight
|
||||
|
||||
Most of the parameters for autonomous flight are located in the following directory: `~/catkin_ws/src/clever/clever/launch/`.
|
||||
Most of the parameters for autonomous flight are located in the following directory: `~/catkin_ws/src/clover/clover/launch/`.
|
||||
|
||||
- Enter the directory:
|
||||
|
||||
```bash
|
||||
cd ~/catkin_ws/src/clever/clever/launch/
|
||||
cd ~/catkin_ws/src/clover/clover/launch/
|
||||
```
|
||||
|
||||
The `~` symbol stands for home directory of your user. If you are already in the directory, you can go with just the command:
|
||||
|
||||
```bash
|
||||
cd catkin_ws/src/clever/clever/launch/
|
||||
cd catkin_ws/src/clover/clover/launch/
|
||||
```
|
||||
|
||||
> **Hint** Tab can automatically complete the names of files, folders or commands. You need to start entering the desired name and press Tab. If there are no conflicts, the name will be auto completed. For example, to quickly enter the path to the `catkin_ws/src/clever/clever/launch/` directory, after entering `cd`, you can start typing the following key combination:`c-Tab-s-Tab-c-Tab-c-Tab-l-Tab`. This way you can save a lot of time when writing a long command, and also avoid possible mistakes in writing the path.
|
||||
> **Hint** Tab can automatically complete the names of files, folders or commands. You need to start entering the desired name and press Tab. If there are no conflicts, the name will be auto completed. For example, to quickly enter the path to the `catkin_ws/src/clover/clover/launch/` directory, after entering `cd`, you can start typing the following key combination:`c-Tab-s-Tab-c-Tab-c-Tab-l-Tab`. This way you can save a lot of time when writing a long command, and also avoid possible mistakes in writing the path.
|
||||
|
||||
- In this folder you need to configure three files:
|
||||
|
||||
- `clever.launch`
|
||||
- `clover.launch`
|
||||
- `aruco.launch`
|
||||
- `main_camera.launch`
|
||||
|
||||
- Open the file `clever.launch`:
|
||||
- Open the file `clover.launch`:
|
||||
|
||||
```bash
|
||||
nano clever.launch
|
||||
nano clover.launch
|
||||
```
|
||||
|
||||
You must be in the directory in which the file is located. If you are in other directory, you can open the file by writing the full path to it:
|
||||
|
||||
```bash
|
||||
nano ~/catkin_ws/src/clever/clever/launch/clever.launch
|
||||
nano ~/catkin_ws/src/clover/clover/launch/clover.launch
|
||||
```
|
||||
|
||||
If two users are editing a file at the same time, or if previously the file was closed incorrectly, nano will not display the file contents, it will ask for permission to display the file. To grant permission, press Y.
|
||||
|
||||
If the content of a file is still empty, you may have entered the file name incorrectly. You need to pay attention to the extension. If you entered a wrong name or extension, nano will create a new empty file named this way, which is undesirable. Such file should be deleted.
|
||||
|
||||
- Find the following line in clever.launch file:
|
||||
- Find the following line in clover.launch file:
|
||||
|
||||
```xml
|
||||
<arg name="aruco" default="false"/>
|
||||
@@ -222,7 +224,7 @@ Most of the parameters for autonomous flight are located in the following direct
|
||||
- the marker map numbering is from the top left corner (key `--top-left`)
|
||||
|
||||
```bash
|
||||
rosrun aruco_pose genmap.py 0.335 10 10 1 1 0 > ~/catkin_ws/src/clever/aruco_pose/map/map.txt --top-left
|
||||
rosrun aruco_pose genmap.py 0.335 10 10 1 1 0 > ~/catkin_ws/src/clover/aruco_pose/map/map.txt --top-left
|
||||
```
|
||||
|
||||
In most maps, numbering starts with a zero marker. Also, in most cases, numbering starts from the upper left corner, so when generating, it is very important to enter the key `--top-left`.
|
||||
@@ -269,10 +271,10 @@ and replace map.txt with your map name.
|
||||
Ctrl+x; y; Enter
|
||||
```
|
||||
|
||||
- Restart the `clever` service:
|
||||
- Restart the `clover` service:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
## Setting the flight controller
|
||||
@@ -289,7 +291,7 @@ and replace map.txt with your map name.
|
||||
|
||||
- Connect remotely to the flight controller through QGroundControl.
|
||||
|
||||
All the necessary settings for that are already set in Clever. Now you need to create a new connection in QGroundControl. Use the settings from [this article](gcs_bridge.md).
|
||||
All the necessary settings for that are already set in Clover. Now you need to create a new connection in QGroundControl. Use the settings from [this article](gcs_bridge.md).
|
||||
|
||||
## Remote controller setup
|
||||
|
||||
@@ -297,14 +299,14 @@ and replace map.txt with your map name.
|
||||
|
||||
Set channel 5 to SwC switch; channel 5 to SwA switch. Or you can use any other switches you like.
|
||||
|
||||
## Clever selfcheck
|
||||
## Clover selfcheck
|
||||
|
||||
Perform selfcheck when you have set up your drone or when you have faced problems. The selfcheck process is described in the article "[Automated self checks](selfcheck.md)"
|
||||
|
||||
- Run the command:
|
||||
|
||||
```bash
|
||||
rosrun clever selfcheck.py
|
||||
rosrun clover selfcheck.py
|
||||
```
|
||||
|
||||
## Writing a program
|
||||
@@ -368,7 +370,7 @@ The article "[Simple OFFBOARD](simple_offboard.md)" describes working with `simp
|
||||
|
||||
## Writing the program to the drone
|
||||
|
||||
The easiest way to send the program is to copy the content of the program, create a new file on the Clever command line and paste the program text into the file.
|
||||
The easiest way to send the program is to copy the content of the program, create a new file in the command line and paste the program text into the file.
|
||||
|
||||
- To create the file `myprogram.py`, run the command:
|
||||
|
||||
|
||||
@@ -1,36 +1,38 @@
|
||||
Software autorun
|
||||
===
|
||||
|
||||
> **Note** In the image version **0.20** `clever` package and service was renamed to `clover`. See [previous version of the article](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/autolaunch.md) for older images.
|
||||
|
||||
systemd
|
||||
---
|
||||
|
||||
Main documentation: [https://wiki.archlinux.org/index.php/Systemd_(Russian)](https://wiki.archlinux.org/index.php/Systemd_(Russian)).
|
||||
|
||||
All automatically started Clever software is launched as a `clever.service` systemd service.
|
||||
All automatically started Clover software is launched as a `clover.service` systemd service.
|
||||
|
||||
The service may be restarted by the `systemctl` command:
|
||||
|
||||
```(bash)
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
Text output of the software can be viewed using the `journalctl` command:
|
||||
|
||||
```(bash)
|
||||
journalctl -u clever
|
||||
journalctl -u clover
|
||||
```
|
||||
|
||||
To run Clever software directly in the current console session, you can use the `roslaunch` command:
|
||||
To run Clover software directly in the current console session, you can use the `roslaunch` command:
|
||||
|
||||
```(bash)
|
||||
sudo systemctl restart clever
|
||||
roslaunch clever clever.launch
|
||||
sudo systemctl restart clover
|
||||
roslaunch clover clover.launch
|
||||
```
|
||||
|
||||
You can disable Clever software autolaunch using the `disable` command:
|
||||
You can disable Clover software autolaunch using the `disable` command:
|
||||
|
||||
```(bash)
|
||||
sudo systemctl disable clever
|
||||
sudo systemctl disable clover
|
||||
```
|
||||
|
||||
roslaunch
|
||||
@@ -38,12 +40,12 @@ roslaunch
|
||||
|
||||
Main documentation: http://wiki.ros.org/roslaunch.
|
||||
|
||||
The list of nodes / programs declared for running is specified in file `/home/pi/catkin_ws/src/clever/clever/launch/clever.launch`.
|
||||
The list of nodes / programs declared for running is specified in file `/home/pi/catkin_ws/src/clover/clover/launch/clover.launch`.
|
||||
|
||||
You can add your own node to the list of automatically launched ones. To do this, place your executable file (e.g. `my_program.py`) into folder `/home/pi/catkin_ws/src/clever/clever/src`. Then add the start of your node to `clever.launch`, for example:
|
||||
You can add your own node to the list of automatically launched ones. To do this, place your executable file (e.g. `my_program.py`) into folder `/home/pi/catkin_ws/src/clover/clover/src`. Then add the start of your node to `clover.launch`, for example:
|
||||
|
||||
```xml
|
||||
<node name="my_program" pkg="clever" type="my_program.py" output="screen"/>
|
||||
<node name="my_program" pkg="clover" type="my_program.py" output="screen"/>
|
||||
```
|
||||
|
||||
The started file must have *permission* to run:
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# Working with the camera
|
||||
|
||||
Make sure the camera is enabled in the `~/catkin_ws/src/clever/clever/launch/clever.launch` file:
|
||||
> **Note** In the image version **0.20** `clever` package was renamed to `clover`. See [previous version of the article](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/camera.md) for older images.
|
||||
|
||||
Make sure the camera is enabled in the `~/catkin_ws/src/clover/clover/launch/clover.launch` file:
|
||||
|
||||
```xml
|
||||
<arg name="main_camera" default="true"/>
|
||||
@@ -8,10 +10,10 @@ Make sure the camera is enabled in the `~/catkin_ws/src/clever/clever/launch/cle
|
||||
|
||||
Also make sure that [position and orientation of the camera](camera_setup.md) is correct.
|
||||
|
||||
The `clever` package must be restarted after the launch-file has been edited:
|
||||
The `clover` service must be restarted after the launch-file has been edited:
|
||||
|
||||
```(bash)
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
You may use rqt or [web_video_server](web_video_server.md) to view the camera stream.
|
||||
@@ -20,10 +22,10 @@ You may use rqt or [web_video_server](web_video_server.md) to view the camera st
|
||||
|
||||
If the camera stream is missing, try using the [`raspistill`](https://www.raspberrypi.org/documentation/usage/camera/raspicam/raspistill.md) utility to check whether the camera works.
|
||||
|
||||
First, stop the Clever service:
|
||||
First, stop the `clover` service:
|
||||
|
||||
```bash
|
||||
sudo systemctl stop clever
|
||||
sudo systemctl stop clover
|
||||
```
|
||||
|
||||
Then use `raspistill` to capture an image from the camera:
|
||||
@@ -88,53 +90,66 @@ image_pub.publish(bridge.cv2_to_imgmsg(cv_image, 'bgr8'))
|
||||
|
||||
The obtained images can be viewed using [web_video_server](web_video_server.md).
|
||||
|
||||
#### Retrieving one frame
|
||||
|
||||
It's possibly to retrieve one camera frame at a time. This method works slower than normal topic subscribing and should not be used when it's necessary to process camera images continuously.
|
||||
|
||||
```python
|
||||
import rospy
|
||||
from sensor_msgs.msg import Image
|
||||
from cv_bridge import CvBridge
|
||||
|
||||
rospy.init_node('computer_vision_sample')
|
||||
bridge = CvBridge()
|
||||
|
||||
# ...
|
||||
|
||||
# Retrieve a frame:
|
||||
img = bridge.imgmsg_to_cv2(rospy.wait_for_message('main_camera/image_raw', Image), 'bgr8')
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
#### Working with QR codes
|
||||
|
||||
> **Hint** For high-speed recognition and positioning, it is better to use [ArUco markers](aruco.md).
|
||||
|
||||
To program actions of the copter upon detection of [QR codes](https://en.wikipedia.org/wiki/QR_code) you can use the [ZBar] library (http://zbar.sourceforge.net). It should be installed using pip:
|
||||
|
||||
```bash
|
||||
sudo pip install zbar
|
||||
```
|
||||
To program actions of the copter for the detection of [QR codes](https://en.wikipedia.org/wiki/QR_code) you can use the [pyZBar](https://pypi.org/project/pyzbar/). This lib is installed in the last image for Raspberry Pi.
|
||||
|
||||
QR codes recognition in Python:
|
||||
|
||||
```python
|
||||
import cv2
|
||||
import zbar
|
||||
import rospy
|
||||
from pyzbar import pyzbar
|
||||
from cv_bridge import CvBridge
|
||||
from sensor_msgs.msg import Image
|
||||
|
||||
bridge = CvBridge()
|
||||
scanner = zbar.ImageScanner()
|
||||
scanner.parse_config('enable')
|
||||
|
||||
rospy.init_node('barcode_test')
|
||||
|
||||
# Image subscriber callback function
|
||||
def image_callback(data):
|
||||
cv_image = bridge.imgmsg_to_cv2(data, 'bgr8') # OpenCV image
|
||||
gray = cv2.cvtColor(cv_image, cv2.COLOR_BGR2GRAY, dstCn=0)
|
||||
|
||||
pil = ImageZ.fromarray(gray)
|
||||
raw = pil.tobytes()
|
||||
|
||||
image = zbar.Image(320, 240, 'Y800', raw) # Image params
|
||||
scanner.scan(image)
|
||||
|
||||
for symbol in image:
|
||||
# print detected QR code
|
||||
print 'decoded', symbol.type, 'symbol', '"%s"' % symbol.data
|
||||
barcodes = pyzbar.decode(cv_image)
|
||||
for barcode in barcodes:
|
||||
b_data = barcode.data.encode("utf-8")
|
||||
b_type = barcode.type
|
||||
(x, y, w, h) = barcode.rect
|
||||
xc = x + w/2
|
||||
yc = y + h/2
|
||||
print ("Found {} with data {} with center at x={}, y={}".format(b_type, b_data, xc, yc))
|
||||
|
||||
image_sub = rospy.Subscriber('main_camera/image_raw', Image, image_callback, queue_size=1)
|
||||
|
||||
rospy.spin()
|
||||
```
|
||||
|
||||
The script will take up to 100% CPU capacity. To slow down the script artificially, you can use [throttling](http://wiki.ros.org/topic_tools/throttle) of frames from the camera, for example, at 5 Hz (`main_camera.launch`):
|
||||
|
||||
```xml
|
||||
<node pkg="topic_tools" name="cam_throttle" type="throttle"
|
||||
args="messages main_camera/image_raw 5.0 main_camera/image_raw/throttled"/>
|
||||
args="messages main_camera/image_raw 5.0 main_camera/image_raw_throttled"/>
|
||||
```
|
||||
|
||||
The topic for the subscriber in this case should be changed for `main_camera/image_raw/throttled`.
|
||||
The topic for the subscriber in this case should be changed for `main_camera/image_raw_throttled`.
|
||||
|
||||
228
docs/en/camera_calib.md
Normal file
228
docs/en/camera_calib.md
Normal file
@@ -0,0 +1,228 @@
|
||||
# Camera calibration
|
||||
|
||||
Computer vision is becoming more and more widespread. Often, computer vision algorithms are not precise and obtain distorted images from the camera, which is especially true for fisheye cameras.
|
||||
|
||||

|
||||
|
||||
> The image is "rounded" closer to the edge.
|
||||
|
||||
Any computer vision algorithm will perceive the picture incorrectly. To remove such distortion, the camera that receives the image is to be calibrated in accordance with its own peculiarities.
|
||||
|
||||
## Script installation
|
||||
|
||||
First, you have to install the necessary libraries:
|
||||
|
||||
```
|
||||
pip install numpy
|
||||
pip install opencv-python
|
||||
pip install glob
|
||||
pip install pyyaml
|
||||
pip install urllib.request
|
||||
```
|
||||
|
||||
Then download the script from the repository:
|
||||
|
||||
```(bash)
|
||||
git clone https://github.com/tinderad/clever_cam_calibration.git
|
||||
```
|
||||
|
||||
Go to the downloaded folder and install the script:
|
||||
|
||||
```(bash)
|
||||
cd clever_cam_calibration
|
||||
sudo python setup.py build
|
||||
sudo python setup.py install
|
||||
```
|
||||
|
||||
If you are using Windows, download the archive from the [repository](https://github.com/tinderad/clever_cam_calibration/archive/master.zip), unzip it and install:
|
||||
|
||||
```(bash)
|
||||
cd path\to\archive\clever_cam_calibration\
|
||||
python setup.py build
|
||||
python setup.py install
|
||||
```
|
||||
|
||||
> path\to\archive – path to unpacked archive.
|
||||
|
||||
## Preparing for calibration
|
||||
|
||||
You will have to prepare a calibration target. It looks like a chessboard. The file is available for downloading [here](https://www.oreilly.com/library/view/learning-opencv-3/9781491937983/assets/lcv3_ac01.png).
|
||||
Glue a printed target to any solid surface. Count the number of intersections on the board lengthwise and widthwise, measure the size of a cell (mm).
|
||||
|
||||

|
||||
|
||||
Turn on Clover and connect to its Wi-Fi.
|
||||
|
||||
> Navigate to 192.168.11.1:8080 and check whether the computer receives images from the image_raw topic.
|
||||
|
||||
## Calibration
|
||||
|
||||
Run script ***calibrate_cam***:
|
||||
|
||||
**Windows:**
|
||||
|
||||
```(bash)
|
||||
>path\to\python\Scripts\calibrate_cam.exe
|
||||
```
|
||||
|
||||
> path\to\Python – path to the Python folder
|
||||
|
||||
**Linux:**
|
||||
|
||||
```(bash)
|
||||
>calibrate_cam
|
||||
```
|
||||
|
||||
Specify board parameters:
|
||||
|
||||
```(bash)
|
||||
>calibrate_cam
|
||||
Chessboard width: # Intersections widthwise
|
||||
Chessboard height: # Intersections heightwise
|
||||
Square size: # Length of cell edge (mm)
|
||||
Saving mode (YES - on): # Save mode
|
||||
```
|
||||
|
||||
> Save mode: if enabled, all received pictures will be saved in the current folder.
|
||||
|
||||
The script will start running:
|
||||
|
||||
```
|
||||
Calibration started!
|
||||
Commands:
|
||||
help, catch (key: Enter), delete, restart, stop, finish
|
||||
```
|
||||
|
||||
To calibrate the camera, make at least 25 photos of the chessboard at various angles.
|
||||
|
||||

|
||||
|
||||
To make a photo, enter command ***catch***.
|
||||
|
||||
```(bash)
|
||||
>catch
|
||||
```
|
||||
|
||||
The program will inform you about the calibration status.
|
||||
|
||||
```(bash)
|
||||
...
|
||||
Chessboard not found, now 0 (25 required)
|
||||
> # Enter
|
||||
---
|
||||
Image added, now 1 (25 required)
|
||||
```
|
||||
|
||||
> Instead of entering command ***catch*** each time, you can just press ***Enter*** (enter a blank line).
|
||||
|
||||
After you have made a sufficient number of images, enter command ***finish***.
|
||||
|
||||
```(bash)
|
||||
...
|
||||
>finish
|
||||
Calibration successful!
|
||||
```
|
||||
|
||||
### Calibration by the existing images
|
||||
|
||||
If you already have images, you can calibrate the camera by them with the help of script ***calibrate_cam_ex***.
|
||||
|
||||
```(bash)
|
||||
>calibrate_cam_ex
|
||||
```
|
||||
|
||||
Specify target characteristics and the path to the folder with images:
|
||||
|
||||
```(bash)
|
||||
>calibrate_cam_ex
|
||||
Chessboard width: # Intersections widthwise
|
||||
Chessboard height: # Intersections heightwise
|
||||
Square size: # Length of cell edge (mm)
|
||||
Path: # Path to the folder with images
|
||||
```
|
||||
|
||||
Apart from that, this script works similarly to ***calibrate_cam***.
|
||||
|
||||
The program will process all received pictures, and create file ***camera_info.yaml*** in the current folder. Using this file, you can equalize distortions in the images obtained from this camera.
|
||||
|
||||
> If you change the resolution of the received image, you will have to re-calibrate the camera.
|
||||
|
||||
## Correcting distortions
|
||||
|
||||
Function ***get_undistorted_image(cv2_image, camera_info)*** is responsible for obtaining a corrected image:
|
||||
|
||||
* ***cv2_image***: An image encoded into a cv2 array.
|
||||
* ***camera_info***: The path to the calibration file.¬
|
||||
|
||||
The function returns a cv2 array, into which the corrected image is coded.
|
||||
|
||||
> If you are using a fisheye camera provided with Clover, for processing images with resolution 320x240 or 640x480, you can use the existing calibration settings. To do this, pass parameters ***clever_cam_calibration.clevercamcalib.CLEVER_FISHEYE_CAM_320*** or ***clever_cam_calibration.clevercamcalib.CLEVER_FISHEYE_CAM_640*** as argument ***camera_info***, respectively.
|
||||
|
||||
## Examples of operation
|
||||
|
||||
Source images:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Corrected images:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## An example of usage
|
||||
|
||||
**Processing image stream from the camera**.
|
||||
|
||||
This program receives images from the camera on Clover and displays them on the screen in corrected for, using the existing calibration file.
|
||||
|
||||
```python
|
||||
import clevercamcalib.clevercamcalib as ccc
|
||||
import cv2
|
||||
import urllib.request
|
||||
import numpy as np
|
||||
while True:
|
||||
req = urllib.request.urlopen('http://192.168.11.1:8080/snapshot?topic=/main_camera/image_raw')
|
||||
arr = np.asarray(bytearray(req.read()), dtype=np.uint8)
|
||||
image = cv2.imdecode(arr, -1)
|
||||
undistorted_img = ccc.get_undistorted_image(image, ccc.CLEVER_FISHEYE_CAM_640)
|
||||
cv2.imshow("undistort", undistorted_img)
|
||||
cv2.waitKey(33)
|
||||
cv2.destroyAllWindows()
|
||||
```
|
||||
|
||||
## The usage for ArUco
|
||||
|
||||
To apply the calibration parameters to the ArUco navigation system, move the calibration .yaml file to Raspberry Pi of Clover, and initialize it.
|
||||
|
||||
> Don't forget to connect to Wi-Fi of Clover.
|
||||
|
||||
The SFTP protocol is used for transferring the file. This example, WinSCP program is used.
|
||||
|
||||
Connect to Raspberry Pi via SFTP:
|
||||
|
||||
> Password: ***raspberry***
|
||||
|
||||

|
||||
|
||||
Press “Enter”. Go to ***/home/pi/catkin_ws/src/clever/clever/camera_info/***, and copy the calibration .yaml file to this folder:
|
||||
|
||||

|
||||
|
||||
Now we have to select this file in ArUco configuration. Connection via SSH is used for this purpose. This example, PuTTY program is used.
|
||||
|
||||
Connect to Raspberry Pi via SSH:
|
||||
|
||||

|
||||
|
||||
Log in with username ***pi*** and password ***raspberry***, go to directory ***/home/pi/catkin_ws/src/clever/clever/launch*** and start editing configuration ***main_camera.launch***:
|
||||
|
||||

|
||||
|
||||
In line ***camera node***, change parameter ***camera_info*** to ***camera_info.yaml***:
|
||||
|
||||

|
||||
|
||||
> Don't forget to change camera resolution.
|
||||
@@ -1,228 +1,45 @@
|
||||
# Camera calibration
|
||||
|
||||
Computer vision is becoming more and more widespread. Often, computer vision algorithms are not precise and obtain distorted images from the camera, which is especially true for fisheye cameras.
|
||||
Camera calibration can significantly improve the quality of nodes related to computer vision: [ArUco markers detection](aruco.md) and [optical flow](optical_flow.md).
|
||||
|
||||

|
||||
Camera calibration process allows to define the parameters reflecting the specific lens installed. These parameters include focal lengths, principal point (which depends on camera lens placement regarding the centre), distortion coefficient *D*. You can read more about camera distortion model used in the [OpenCV documentation](https://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html).
|
||||
|
||||
> The image is "rounded" closer to the edge.
|
||||
There are several tools allowing to calibrate the camera and store calculated parameters into the system. Usually they use calibration images, "chessboards" or combinations of "chessboards" and ArUco-marker grids ([ChArUco](https://docs.opencv.org/3.4/df/d4a/tutorial_charuco_detection.html)).
|
||||
|
||||
Any computer vision algorithm will perceive the picture incorrectly. To remove such distortion, the camera that receives the image is to be calibrated in accordance with its own peculiarities.
|
||||
## camera_calibration ROS-package
|
||||
|
||||
## Script installation
|
||||
Main tutorial: http://wiki.ros.org/camera_calibration/Tutorials/MonocularCalibration.
|
||||
|
||||
First, you have to install the necessary libraries:
|
||||
In order to calibrate the camera with the `camera_calibration` ROS-package you need a computer with OS GNU/Linux and [ROS Melodic](ros-install.md) installed.
|
||||
|
||||
```
|
||||
pip install numpy
|
||||
pip install opencv-python
|
||||
pip install glob
|
||||
pip install pyyaml
|
||||
pip install urllib.request
|
||||
```
|
||||
<img src="../assets/camera_calibration.png" alt="ROS Camera Calibrator" class="zoom center" width=600>
|
||||
|
||||
Then download the script from the repository:
|
||||
1. Using the Terminal, install `camera_calibration` package to your computer:
|
||||
|
||||
```(bash)
|
||||
git clone https://github.com/tinderad/clever_cam_calibration.git
|
||||
```
|
||||
```bash
|
||||
sudo apt-get install ros-melodic-camera-calibration
|
||||
```
|
||||
|
||||
Go to the downloaded folder and install the script:
|
||||
2. Download the chessboard – [chessboard.pdf](../assets/chessboard.pdf). Print the chessboard on paper or open it on the computer screen.
|
||||
|
||||
```(bash)
|
||||
cd clever_cam_calibration
|
||||
sudo python setup.py build
|
||||
sudo python setup.py install
|
||||
```
|
||||
3. Connect to the [Clover Wi-Fi network](wifi.md).
|
||||
|
||||
If you are using Windows, download the archive from the [repository](https://github.com/tinderad/clever_cam_calibration/archive/master.zip), unzip it and install:
|
||||
4. Run camera calibration (on your computer):
|
||||
|
||||
```(bash)
|
||||
cd path\to\archive\clever_cam_calibration\
|
||||
python setup.py build
|
||||
python setup.py install
|
||||
```
|
||||
```bash
|
||||
ROS_MASTER_URI=http://192.168.11.1:11311 rosrun camera_calibration cameracalibrator.py --size 6x8 --square 0.108 image:=/main_camera/image_raw camera:=/main_camera
|
||||
```
|
||||
|
||||
> path\to\archive – path to unpacked archive.
|
||||
> **Note** Change the value *0.108* to actual size a square on the chessboard in metres. For example, value *0.03* corresponds to 3 cm.
|
||||
|
||||
## Preparing for calibration
|
||||
5. When the calibration program starts, move the drone so the calibration board is observed from different angles:
|
||||
|
||||
You will have to prepare a calibration target. It looks like a chessboard. The file is available for downloading [here](https://www.oreilly.com/library/view/learning-opencv-3/9781491937983/assets/lcv3_ac01.png).
|
||||
Glue a printed target to any solid surface. Count the number of intersections on the board lengthwise and widthwise, measure the size of a cell (mm).
|
||||
* Place the chessboard in the left, right, top and bottom part of the frame.
|
||||
* Rotate the chessboard around all 3 axes.
|
||||
* Move camera toward and away from the chessboard, so that it is observed from different distance.
|
||||
|
||||

|
||||
6. Click the *CALIBRATE* button, when it's active. The process of calculation will take several minutes.
|
||||
|
||||
Turn on Clever and connect to its Wi-Fi.
|
||||
When the calculation is done, you'll see calculated parameters in the terminal. The corrected camera image view will be displayed as well. If calibration was successful all straight lines will remain straight on the image displayed.
|
||||
|
||||
> Navigate to 192.168.11.1:8080 and check whether the computer receives images from the image_raw topic.
|
||||
|
||||
## Calibration
|
||||
|
||||
Run script **_calibrate_cam_**:
|
||||
|
||||
**Windows:**
|
||||
|
||||
```(bash)
|
||||
>path\to\python\Scripts\calibrate_cam.exe
|
||||
```
|
||||
|
||||
> path\to\Python – path to the Python folder
|
||||
|
||||
**Linux:**
|
||||
|
||||
```(bash)
|
||||
>calibrate_cam
|
||||
```
|
||||
|
||||
Specify board parameters:
|
||||
|
||||
```(bash)
|
||||
>calibrate_cam
|
||||
Chessboard width: # Intersections widthwise
|
||||
Chessboard height: # Intersections heightwise
|
||||
Square size: # Length of cell edge (mm)
|
||||
Saving mode (YES - on): # Save mode
|
||||
```
|
||||
|
||||
> Save mode: if enabled, all received pictures will be saved in the current folder.
|
||||
|
||||
The script will start running:
|
||||
|
||||
```
|
||||
Calibration started!
|
||||
Commands:
|
||||
help, catch (key: Enter), delete, restart, stop, finish
|
||||
```
|
||||
|
||||
To calibrate the camera, make at least 25 photos of the chessboard at various angles.
|
||||
|
||||

|
||||
|
||||
To make a photo, enter command **_catch_**.
|
||||
|
||||
```(bash)
|
||||
>catch
|
||||
```
|
||||
|
||||
The program will inform you about the calibration status.
|
||||
|
||||
```(bash)
|
||||
...
|
||||
Chessboard not found, now 0 (25 required)
|
||||
> # Enter
|
||||
---
|
||||
Image added, now 1 (25 required)
|
||||
```
|
||||
|
||||
> Instead of entering command **_catch_** each time, you can just press **_Enter_** (enter a blank line).
|
||||
|
||||
After you have made a sufficient number of images, enter command **_finish_**.
|
||||
|
||||
```(bash)
|
||||
...
|
||||
>finish
|
||||
Calibration successful!
|
||||
```
|
||||
|
||||
### Calibration by the existing images
|
||||
|
||||
If you already have images, you can calibrate the camera by them with the help of script **_calibrate_cam_ex_**.
|
||||
|
||||
```(bash)
|
||||
>calibrate_cam_ex
|
||||
```
|
||||
|
||||
Specify target characteristics and the path to the folder with images:
|
||||
|
||||
```(bash)
|
||||
>calibrate_cam_ex
|
||||
Chessboard width: # Intersections widthwise
|
||||
Chessboard height: # Intersections heightwise
|
||||
Square size: # Length of cell edge (mm)
|
||||
Path: # Path to the folder with images
|
||||
```
|
||||
|
||||
Apart from that, this script works similarly to **_calibrate_cam_**.
|
||||
|
||||
The program will process all received pictures, and create file **_camera_info_****_._****_yaml_** in the current folder. Using this file, you can equalize distortions in the images obtained from this camera.
|
||||
|
||||
> If you change the resolution of the received image, you will have to re-calibrate the camera.
|
||||
|
||||
## Correcting distortions
|
||||
|
||||
Function **_get_undistorted_image(cv2_image, camera_info)_** is responsible for obtaining a corrected image:
|
||||
|
||||
* **_cv2_image_**: An image encoded into a cv2 array.
|
||||
* **_camera_****___****_info_**: The path to the calibration file.¬
|
||||
|
||||
The function returns a cv2 array, into which the corrected image is coded.
|
||||
|
||||
> If you are using a fisheye camera provided with Clever, for processing images with resolution 320x240 or 640x480, you can use the existing calibration settings. To do this, pass parameters **_clever_cam_calibration.clevercamcalib.CLEVER_FISHEYE_CAM_320_** or **_clever_cam_calibration.clevercamcalib.CLEVER_FISHEYE_CAM_640_** as argument **_camera_info_**, respectively.
|
||||
|
||||
## Examples of operation
|
||||
|
||||
Source images:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Corrected images:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## An example of usage
|
||||
|
||||
**Processing image stream from the camera**.
|
||||
|
||||
This program receives images from the camera on Clever and displays them on the screen in corrected for, using the existing calibration file.
|
||||
|
||||
```python
|
||||
import clevercamcalib.clevercamcalib as ccc
|
||||
import cv2
|
||||
import urllib.request
|
||||
import numpy as np
|
||||
while True:
|
||||
req = urllib.request.urlopen('http://192.168.11.1:8080/snapshot?topic=/main_camera/image_raw')
|
||||
arr = np.asarray(bytearray(req.read()), dtype=np.uint8)
|
||||
image = cv2.imdecode(arr, -1)
|
||||
undistorted_img = ccc.get_undistorted_image(image, ccc.CLEVER_FISHEYE_CAM_640)
|
||||
cv2.imshow("undistort", undistorted_img)
|
||||
cv2.waitKey(33)
|
||||
cv2.destroyAllWindows()
|
||||
```
|
||||
|
||||
## The usage for ArUco
|
||||
|
||||
To apply the calibration parameters to the ArUco navigation system, move the calibration .yaml file to Raspberry Pi of Clever, and initialize it.
|
||||
|
||||
> Don't forget to connect to Wi-Fi of Clever.
|
||||
|
||||
The SFTP protocol is used for transferring the file. This example, WinSCP program is used.
|
||||
|
||||
Connect to Raspberry Pi via SFTP:
|
||||
|
||||
> Password: _**raspberry**_
|
||||
|
||||

|
||||
|
||||
Press “Enter”. Go to _**/home/pi/catkin_ws/src/clever/clever/camera_info/**_, and copy the calibration .yaml file to this folder:
|
||||
|
||||

|
||||
|
||||
Now we have to select this file in ArUco configuration. Connection via SSH is used for this purpose. This example, PuTTY program is used.
|
||||
|
||||
Connect to Raspberry Pi via SSH:
|
||||
|
||||

|
||||
|
||||
Log in with username _**pi**_ and password _**raspberry**_, go to directory _**/home/pi/catkin_ws/src/clever/clever/launch**_ and start editing configuration _**main_camera.launch**_:
|
||||
|
||||

|
||||
|
||||
In line _**camera node**_, change parameter _**camera_info**_ to _**camera_info.yaml**_:
|
||||
|
||||

|
||||
|
||||
> Don't forget to change camera resolution.
|
||||
7. Click the *COMMIT* button to store calculated calibration parameters. The result will be stored in the main Clover camera calibration file: `/home/pi/catkin_ws/src/clover/clover/camera_info/fisheye_cam_320.yaml`.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# Camera setup
|
||||
|
||||
> **Note** The following applies to [image version](image.md) **0.15** and up. See [previous version of the article](https://github.com/CopterExpress/clever/blob/v0.14/docs/ru/camera_frame.md) (Russian only) for older images.
|
||||
> **Note** The following applies to [image version](image.md) **0.20** and up. See [previous version of the article](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/camera_frame.md) for older images.
|
||||
|
||||
Computer vision modules (like [ArUco markers](aruco.md) and [Optical Flow](optical_flow.md)) require adjusting the camrea focus and set up camera position and orientation relative to the drone body.
|
||||
Computer vision modules (like [ArUco markers](aruco.md) and [Optical Flow](optical_flow.md)) require adjusting the camera focus and set up camera position and orientation relative to the drone body. Optional camera calibration can improve their quality of performance.
|
||||
|
||||
## Focusing the camera lens
|
||||
## Focusing the camera lens {#focus}
|
||||
|
||||
In order to focus the camera lens, do the following:
|
||||
|
||||
@@ -19,10 +19,71 @@ In order to focus the camera lens, do the following:
|
||||
|
||||
## Setting the camera position {#frame}
|
||||
|
||||
Position and orientation of the main camera is [set in the](cli.md#editing) `~/catkin_ws/src/clever/clever/launch/main_camera.launch` file:
|
||||
Position and orientation of the main camera is [set in the](cli.md#editing) `~/catkin_ws/src/clover/clover/launch/main_camera.launch` file:
|
||||
|
||||
```xml
|
||||
<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0 0 -0.07 -1.5707963 0 3.1415926 base_link main_camera_optical"/>
|
||||
<arg name="direction_z" default="down"/> <!-- direction the camera points: down, up -->
|
||||
<arg name="direction_y" default="backward"/> <!-- direction the camera cable points: backward, forward -->
|
||||
```
|
||||
|
||||
To set the orientation, define:
|
||||
|
||||
* direction the camera lens points `direction_z`: `down` or `up`;
|
||||
* direction the camera cable points `direction_y`: `backward` or `forward`.
|
||||
|
||||
### Examples
|
||||
|
||||
### Camera faces downward, cable goes backward
|
||||
|
||||
```xml
|
||||
<arg name="direction_z" default="down"/>
|
||||
<arg name="direction_y" default="backward"/>
|
||||
```
|
||||
|
||||
<img src="../assets/camera_option_1_rviz.png" width=300>
|
||||
<img src="../assets/camera_option_1_clever.jpg" width=300>
|
||||
|
||||
### Camera faces downward, cable goes forward
|
||||
|
||||
```xml
|
||||
<arg name="direction_z" default="down"/>
|
||||
<arg name="direction_y" default="forward"/>
|
||||
```
|
||||
|
||||
<img src="../assets/camera_option_2_rviz.png" width=300>
|
||||
<img src="../assets/camera_option_2_clever.jpg" width=300>
|
||||
|
||||
### Camera faces upward, cable goes backward
|
||||
|
||||
```xml
|
||||
<arg name="direction_z" default="up"/>
|
||||
<arg name="direction_y" default="backward"/>
|
||||
```
|
||||
|
||||
<img src="../assets/camera_option_3_rviz.png" width=300>
|
||||
<img src="../assets/camera_option_3_clever.jpg" width=300>
|
||||
|
||||
### Camera faces upward, cable goes forward
|
||||
|
||||
```xml
|
||||
<arg name="direction_z" default="up"/>
|
||||
<arg name="direction_y" default="forward"/>
|
||||
```
|
||||
|
||||
<img src="../assets/camera_option_4_rviz.png" width=300>
|
||||
<img src="../assets/camera_option_4_clever.jpg" width=300>
|
||||
|
||||
> **Hint** The [`selfcheck.py` utility](selfcheck.md) will describe your current camera setup in a human-readable fashion. Be sure to check whether this description corresponds to your actual camera position.
|
||||
|
||||
### Custom camera position
|
||||
|
||||
It's possible to set arbitrary camera position and orientation. In order to do that uncomment node, marked as `Template for custom camera orientation`:
|
||||
|
||||
```xml
|
||||
<!-- Template for custom camera orientation -->
|
||||
<!-- Camera position and orientation are represented by base_link -> main_camera_optical transform -->
|
||||
<!-- static_transform_publisher arguments: x y z yaw pitch roll frame_id child_frame_id -->
|
||||
<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0.05 0 -0.07 -1.5707963 0 3.1415926 base_link main_camera_optical"/>
|
||||
```
|
||||
|
||||
This line describes how the camera is positioned relative to the drone body. Technically, it creates a static transform between the `base_link` frame ( which [corresponds to the flight controller housing](frames.md)) and the camera (`main_camera_optical`) in the following format:
|
||||
@@ -39,44 +100,6 @@ Camera frame (that is, [frame of reference](frames.md)) is aligned as follows:
|
||||
|
||||
Shifts are set in meters, angles are in radians. You can check the transform for correctness using [rviz](rviz.md).
|
||||
|
||||
## Presets for Clever
|
||||
## Calibration {#calibration}
|
||||
|
||||
The presets for usual camera orientations are available in the `main_camera.launch` file. The images should help you choose the one that is right for you: the first one is how your drone will be displayed in [rviz](rviz.md), the second is how the camera is actually mounted on the drone.
|
||||
|
||||
### 1. Camera faces downward, cable goes backward
|
||||
|
||||
```xml
|
||||
<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0.05 0 -0.07 -1.5707963 0 3.1415926 base_link main_camera_optical"/>
|
||||
```
|
||||
|
||||
<img src="../assets/camera_option_1_rviz.png" width=400>
|
||||
<img src="../assets/camera_option_1_clever.jpg" width=400>
|
||||
|
||||
### 2. Camera faces downward, cable goes forward
|
||||
|
||||
```xml
|
||||
<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0.05 0 -0.07 1.5707963 0 3.1415926 base_link main_camera_optical"/>
|
||||
```
|
||||
|
||||
<img src="../assets/camera_option_2_rviz.png" width=400>
|
||||
<img src="../assets/camera_option_2_clever.jpg" width=400>
|
||||
|
||||
### 3. Camera faces upward, cable goes backward
|
||||
|
||||
```xml
|
||||
<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0.05 0 0.07 1.5707963 0 0 base_link main_camera_optical"/>
|
||||
```
|
||||
|
||||
<img src="../assets/camera_option_3_rviz.png" width=400>
|
||||
<img src="../assets/camera_option_3_clever.jpg" width=400>
|
||||
|
||||
### 4. Camera faces upward, cable goes forward
|
||||
|
||||
```xml
|
||||
<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0.05 0 0.07 -1.5707963 0 0 base_link main_camera_optical"/>
|
||||
```
|
||||
|
||||
<img src="../assets/camera_option_4_rviz.png" width=400>
|
||||
<img src="../assets/camera_option_4_clever.jpg" width=400>
|
||||
|
||||
> **Hint** The [`selfcheck.py` utility](selfcheck.md) will describe your current camera setup in a human-readable fashion. Be sure to check whether this description corresponds to your actual camera position.
|
||||
To improve the quality of computer vision related algorithms it's recommended to perform camera calibration, which is described in the [appropriate article](camera_calibration.md).
|
||||
|
||||
18
docs/en/clever-show.md
Normal file
18
docs/en/clever-show.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# clever-show
|
||||
|
||||
Software for making the drone show controlled by Raspberry Pi, PX4 and COEX [Clover](https://github.com/CopterExpress/clover) package.
|
||||
|
||||
Create animation in Blender, convert it to drone paths, set up the drones and run your own show!
|
||||
|
||||
Project repository: https://github.com/CopterExpress/clever-show.
|
||||
|
||||
## Demo video
|
||||
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/HdHbZFz7nR0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
|
||||
12 drones perform in a show in Electrotheatre Stanislavsky, Moscow.
|
||||
|
||||
## Team
|
||||
|
||||
* Arthur Golubtsov, software engineer in COEX, https://github.com/goldarte
|
||||
* Artem Vasyunik, software engineer intern in COEX, https://github.com/artem30801
|
||||
@@ -15,7 +15,7 @@ ls
|
||||
Change current (working) directory:
|
||||
|
||||
```bash
|
||||
cd catkin_ws/src/clever/clever/launch
|
||||
cd catkin_ws/src/clover/clover/launch
|
||||
```
|
||||
|
||||
Go one directory level up:
|
||||
@@ -65,16 +65,16 @@ You can use **nano** to edit files on the Raspberry Pi. It is one of the more us
|
||||
For example:
|
||||
|
||||
```bash
|
||||
nano ~/catkin_ws/src/clever/clever/launch/clever.launch
|
||||
nano ~/catkin_ws/src/clover/clover/launch/clover.launch
|
||||
```
|
||||
|
||||
<img src="../assets/nano.png" alt="Editing files in nano" data-action="zoom">
|
||||
2. Edit the file.
|
||||
3. Press `Ctrl`+`X`, `Y`, `Enter` to save your file and exit.
|
||||
4. Restart the `clever` package if you've changed .launch files:
|
||||
4. Restart the `clover` service if you've changed .launch files:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
You may also use other editors like **vim** if you prefer.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# COEX Pix
|
||||
|
||||
The **COEX Pix** flight controller is a modified [Pixracer](https://docs.px4.io/v1.9.0/en/flight_controller/pixracer.html) FCU. It is a part of the **Clever 4** quadrotor kit.
|
||||
The **COEX Pix** flight controller is a modified [Pixracer](https://docs.px4.io/v1.9.0/en/flight_controller/pixracer.html) FCU. It is a part of the **Clover 4** quadrotor kit.
|
||||
|
||||
## Revision 1.1
|
||||
|
||||
@@ -43,7 +43,7 @@ The **COEX Pix** flight controller is a modified [Pixracer](https://docs.px4.io/
|
||||
|
||||
### Mounting suggestions
|
||||
|
||||
**Important**: The board is meant to be installed with a non-standard orientation (roll 180º, yaw 90º) on the Clever airframe. Therefore, the `SENS_BOARD_ROT` PX4 parameter should be set to `ROLL 180, YAW 90`.
|
||||
**Important**: The board is meant to be installed with a non-standard orientation (roll 180º, yaw 90º) on the Clover airframe. Therefore, the `SENS_BOARD_ROT` PX4 parameter should be set to `ROLL 180, YAW 90`.
|
||||
|
||||
### Usage notes
|
||||
|
||||
|
||||
@@ -20,22 +20,24 @@ USB connection is the preferred way to connect to the flight controller.
|
||||
|
||||
## UART connection
|
||||
|
||||
> **Note** In the image version **0.20** `clever` package and service was renamed to `clover`. See [previous version of the article](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/connection.md) for older images.
|
||||
|
||||
<!-- TODO: Connection scheme -->
|
||||
|
||||
UART connection is another way for the Raspberry Pi and FCU to communicate.
|
||||
|
||||
1. Connect Raspberry Pi to your FCU using a UART cable.
|
||||
2. [Connect to the Raspberry Pi over SSH](ssh.md).
|
||||
3. Change the connection type in `~/catkin_ws/src/clever/clever/launch/clever.launch` to UART:
|
||||
3. Change the connection type in `~/catkin_ws/src/clover/clover/launch/clover.launch` to UART:
|
||||
|
||||
```xml
|
||||
<arg name="fcu_conn" default="uart"/>
|
||||
```
|
||||
|
||||
Be sure to restart the `clever` service after editing the .launch file:
|
||||
Be sure to restart the `clover` service after editing the .launch file:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
> **Hint** Set the `SYS_COMPANION` PX4 parameter to 921600 to enable UART on the FCU.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# Contribution to Clever
|
||||
# Contribution to Clover
|
||||
|
||||
Clever is mostly an [open source](https://en.wikipedia.org/wiki/Open-source_software) and [open hardware](https://en.wikipedia.org/wiki/Open-source_hardware) project aimed at lowering the entry threshold to development of the projects related to flying robotics. You can contribute to the project by offering fixes and improvements for Clever documentation and software.
|
||||
Clover is mostly an [open source](https://en.wikipedia.org/wiki/Open-source_software) and [open hardware](https://en.wikipedia.org/wiki/Open-source_hardware) project aimed at lowering the entry threshold to development of the projects related to flying robotics. You can contribute to the project by offering fixes and improvements for Clover documentation and software.
|
||||
|
||||
> **Note** To offer changes to Clever documentation or SW, you should have an account at [GitHub](https://github.com).
|
||||
> **Note** To offer changes to Clover documentation or SW, you should have an account at [GitHub](https://github.com).
|
||||
|
||||
## Markdown
|
||||
|
||||
All Clever documentation is written in the widespread [Markdown](https://en.wikipedia.org/wiki/Markdown) format. There are many Markdown guides on the Internet.
|
||||
All Clover documentation is written in the widespread [Markdown](https://en.wikipedia.org/wiki/Markdown) format. There are many Markdown guides on the Internet.
|
||||
|
||||
In Russian: https://guides.hexlet.io/markdown/.
|
||||
|
||||
@@ -22,7 +22,7 @@ For a local build of a static documentation website, use the [`gitbook-cli`](htt
|
||||
|
||||
If you have found an error in the documentation or if you want to improve it, use the **Pull Request** mechanism.
|
||||
|
||||
1. Find a file with the article you want in the repository – https://github.com/CopterExpress/clever/tree/master/docs.
|
||||
1. Find a file with the article you want in the repository – https://github.com/CopterExpress/clover/tree/master/docs.
|
||||
2. Click "Edit".
|
||||
|
||||
<img src="../assets/github-edit.png" alt="GitHub Edit">
|
||||
@@ -36,18 +36,18 @@ More information about Pull Requests is available [at GitHub](https://help.githu
|
||||
|
||||
## Contributing a new article
|
||||
|
||||
> **Note** If you've made your own project based on Clever, you can add an article about it to the "Clever-based projects" section.
|
||||
> **Note** If you've made your own project based on Clover, you can add an article about it to the "Clover-based projects" section.
|
||||
|
||||
Prepare your article and send it as a pull request to the [Clever repository](https://github.com/CopterExpress/clever).
|
||||
Prepare your article and send it as a pull request to the [Clover repository](https://github.com/CopterExpress/clover).
|
||||
|
||||
1. Fork the Clever repository:
|
||||
1. Fork the Clover repository:
|
||||
|
||||
<img src="../assets/github-fork.png" alt="GitHub Fork">
|
||||
|
||||
2. Check out the freshly-forked repository on your computer:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/<USERNAME>/clever.git
|
||||
git clone https://github.com/<USERNAME>/clover.git
|
||||
```
|
||||
|
||||
3. Open the directory with the source code checkout and create a new branch for your article (for example, `new-article`):
|
||||
@@ -75,7 +75,7 @@ Prepare your article and send it as a pull request to the [Clever repository](ht
|
||||
|
||||
```bash
|
||||
git add docs/
|
||||
git commit -m "Add new article for Clever"
|
||||
git commit -m "Add new article for Clover"
|
||||
```
|
||||
|
||||
8. Upload your branch to your forked repository on GitHub:
|
||||
@@ -84,11 +84,15 @@ Prepare your article and send it as a pull request to the [Clever repository](ht
|
||||
git push -u origin new-article
|
||||
```
|
||||
|
||||
9. Open your repository on GitHub and send a `pull request` from your branch to Clever:
|
||||
9. Open your repository on GitHub and send a `pull request` from your branch to Clover:
|
||||
|
||||
<img src="../assets/github-pull-request.png" alt="GitHub Pull Request">
|
||||
|
||||
<img src="../assets/github-pull-request-create.png" alt="GitHub Create Pull">
|
||||
|
||||
10. Wait for the review, be ready to make changes if needed.
|
||||
11. Look at your new and useful article at https://clever.coex.tech !
|
||||
11. Look at your new and useful article at https://clover.coex.tech !
|
||||
|
||||
## Easy way
|
||||
|
||||
If the above instructions are too difficult for you, send your fixes and new articles by e-mail (<a href="mailto:okalachev@gmail.com">okalachev@gmail.com</a>) or in Telegram messenger (user <a href="tg://resolve?domain=okalachev">@okalachev</a>).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Copter Hack 2017
|
||||
===
|
||||
|
||||
On July 28 – 30, 2017, Copter Express held a hackathon named "Copter Hack 2017", where the objective was to program a Clever to dance-fly autonomously to random music.
|
||||
On July 28 – 30, 2017, Copter Express held a hackathon named "Copter Hack 2017", where the objective was to program a Clover to dance-fly autonomously to random music.
|
||||
|
||||
The team "Pangolins" became the winners.
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ Winning teams:
|
||||
|
||||
1. Starshine (Moscow) — controlling the drone using a "smart" glove.
|
||||
2. Alcopter (Moscow) — controlling the drone with gestures and pose change.
|
||||
3. Merry copter (Samara) — a Vkontakte bot for controlling the copter, a joint flight of "Zhuzha" and "Clever 3".
|
||||
3. Merry copter (Samara) — a Vkontakte bot for controlling the copter, a joint flight of "Zhuzha" and "Clover 3".
|
||||
4. International Post (Novosibirsk) — automatic scattering leaflets from the drone.
|
||||
5. LAMAR (Yekaterinburg) — an automatic quadcopter battery replacement station.
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ This parameter is used for *IMU* orientation correction.
|
||||
|
||||
### Suggested image versions
|
||||
|
||||
Raspberry Pi versions 3B+ and lower: [v0.18](https://github.com/CopterExpress/clever/releases/tag/v0.18)
|
||||
Raspberry Pi versions 3B+ and lower: [v0.18](https://github.com/CopterExpress/clover/releases/tag/v0.18)
|
||||
|
||||
Raspberry Pi version 4: [v0.19-alpha.1](https://github.com/CopterExpress/clever/releases/tag/v0.19-alpha.1)
|
||||
Raspberry Pi version 4: [v0.19-alpha.1](https://github.com/CopterExpress/clover/releases/tag/v0.19-alpha.1)
|
||||
|
||||
### Camera orientation
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ To display the settings of all ESCs simultaneously, you can use the ESC Overview
|
||||
|
||||
ESC firmware files are located [here](https://github.com/cleanflight/blheli-multishot/tree/master/BLHeli_S%20SiLabs/Hex%20Files).
|
||||
|
||||
To flesh ESCs, click on button Flash BLHeli and choose the firmware file with the type of the controller, the name of which is indicated in the firmware name frame on top of the screen in tab Silabs ESC Setup (for the controller that is used in Clever 2, it is A-H-70).
|
||||
To flesh ESCs, click on button Flash BLHeli and choose the firmware file with the type of the controller, the name of which is indicated in the firmware name frame on top of the screen in tab Silabs ESC Setup (for the controller that is used in Clover 2, it is A-H-70).
|
||||
|
||||
To re-flash an individual ESC, disable all other ESCs.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Introduction
|
||||
|
||||
Recently, face recognition systems have been getting a wider use, the application scope of this technology is really expansive: from regular selfie drones to police drones. Everywhere it is being integrated into various devices. The recognition process itself is really fascinating, and that's what inspired me to create a project associated with it. The purpose of my internship project was to create a simple open source system for face recognition with a Clever quadcopter. The program takes images from the quadcopter's camera and processes it on a PC. Therefore, all other instructions are executed on a PC.
|
||||
Recently, face recognition systems have been getting a wider use, the application scope of this technology is really expansive: from regular selfie drones to police drones. Everywhere it is being integrated into various devices. The recognition process itself is really fascinating, and that's what inspired me to create a project associated with it. The purpose of my internship project was to create a simple open source system for face recognition with a Clover quadcopter. The program takes images from the quadcopter's camera and processes it on a PC. Therefore, all other instructions are executed on a PC.
|
||||
|
||||
## Development
|
||||
|
||||
@@ -93,7 +93,7 @@ Further explanation of the code is available at GitHub of the used API in the co
|
||||
|
||||
## Using
|
||||
|
||||
It is enough to connect to "Clever" via Wi-Fi and check whether the video stream from the camera is working correctly.
|
||||
It is enough to connect to "Clover" via Wi-Fi and check whether the video stream from the camera is working correctly.
|
||||
|
||||
Then just run the script:
|
||||
|
||||
|
||||
@@ -3,17 +3,17 @@ Pixhawk / Pixracer firmware flashing
|
||||
|
||||
Pixhawk or Pixracer firmware may be flashed using QGroundControl or command line utilities.
|
||||
|
||||
Modified firmware for Clever
|
||||
Modified firmware for Clover
|
||||
---
|
||||
|
||||
It is advisable to use a specialized build of PX4 with the necessary fixes and better defaults for the Clever drone. Use the latest stable release in our [GitHub repository](https://github.com/CopterExpress/Firmware/releases) with the word `clever`, for example, `v1.8.2-clever.5`.
|
||||
It is advisable to use a specialized build of PX4 with the necessary fixes and better defaults for the Clover drone. Use the latest stable release in our [GitHub repository](https://github.com/CopterExpress/Firmware/releases) with the word `clover`, for example, `v1.8.2-clover.5`.
|
||||
|
||||
<div id="release" style="display:none">
|
||||
<p>Latest stable release: <strong><a id="download-latest-release"></a></strong>.</p>
|
||||
|
||||
<ul>
|
||||
<li>Firmware for Pixracer (<strong>Clever 4 / Clever 3</strong>) – <a id="firmware-pixracer" href=""><code>px4fmu-v4_default.px4</code></a>.</li>
|
||||
<li>Firmware for Pixhawk (<strong>Clever 2</strong>) – <a id="firmware-pixhawk" href=""><code>px4fmu-v2_lpe.px4</code></a>.</li>
|
||||
<li>Firmware for Pixracer (<strong>Clover 4 / Clover 3</strong>) – <a id="firmware-pixracer" href=""><code>px4fmu-v4_default.px4</code></a>.</li>
|
||||
<li>Firmware for Pixhawk (<strong>Clover 2</strong>) – <a id="firmware-pixhawk" href=""><code>px4fmu-v2_lpe.px4</code></a>.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -25,8 +25,8 @@ It is advisable to use a specialized build of PX4 with the necessary fixes and b
|
||||
// look for stable release
|
||||
let stable;
|
||||
for (let release of data) {
|
||||
let clever = release.name.indexOf('clever') != -1;
|
||||
if (clever && !release.prerelease && !release.draft) {
|
||||
let clover = (release.name.indexOf('clover') != -1) || (release.name.indexOf('clever') != -1);
|
||||
if (clover && !release.prerelease && !release.draft) {
|
||||
stable = release;
|
||||
break;
|
||||
}
|
||||
@@ -60,8 +60,8 @@ Firmware variants
|
||||
|
||||
The name of the firmware file contains information about the target flight controller and build variant. For example:
|
||||
|
||||
* `px4fmu-v4_default.px4` — firmware for Pixhawk with EKF2 and LPE (**Clever 3** / **Clever 4**).
|
||||
* `px4fmu-v2_lpe.px4` — firmware for Pixhawk with LPE (**Clever 2**).
|
||||
* `px4fmu-v4_default.px4` — firmware for Pixhawk with EKF2 and LPE (**Clover 3** / **Clover 4**).
|
||||
* `px4fmu-v2_lpe.px4` — firmware for Pixhawk with LPE (**Clover 2**).
|
||||
* `px4fmu-v2_default.px4` — firmware for Pixhawk with EKF2.
|
||||
* `px4fmu-v3_default.px4` — firmware for newer Pixhawk versions (rev. 3 chip, see Fig. + Bootloader v5) with EKF2 and LPE.
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
Coordinate systems (frames)
|
||||
===
|
||||
|
||||
> **Note** The following applies to [image](image.md) version 0.15 and up. See [previous version of the article](https://github.com/CopterExpress/clever/blob/v0.14/docs/ru/frames.md) (Russian only) for older images.
|
||||

|
||||
|
||||

|
||||
|
||||
Main frames in the `clever` package:
|
||||
Main frames in the `clover` package:
|
||||
|
||||
* `map` has its origin at the flight controller initialization point and may be considered stationary. It is shown as a white grid on the image above;
|
||||
* `base_link` is rigidly bound to the drone. It is shown by the simplified drone model on the image above;
|
||||
@@ -27,7 +25,7 @@ tf2
|
||||
|
||||
Read more at http://wiki.ros.org/tf2
|
||||
|
||||
tf2 ROS package is used extensively in the Clever platform. tf2 is a set of libraries for C++, Python and other programming languages that are used to work with the frames. Internally, ROS nodes publish `TransformStamped` messages to `/tf` topic with transforms between frames at certain points in time.
|
||||
tf2 ROS package is used extensively in the Clover platform. tf2 is a set of libraries for C++, Python and other programming languages that are used to work with the frames. Internally, ROS nodes publish `TransformStamped` messages to `/tf` topic with transforms between frames at certain points in time.
|
||||
|
||||
The [`simple_offboard`](simple_offboard.md) node can be used to request the drone position in an arbitrary frame by setting the `frame_id` argument appropriately in a call to `get_telemetry` service.
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@ Using QGroundControl via Wi-Fi
|
||||

|
||||
|
||||
You can monitor, control, calibrate and configure the flight controller of the quadcopter using QGroundControl via Wi-Fi.
|
||||
This requires [connecting to Wi-Fi](wifi.md) of the `CLEVER-xxxx` network.
|
||||
This requires [connecting to Wi-Fi](wifi.md) of the `clover-xxxx` network.
|
||||
|
||||
After that, in the Clever launch-file `/home/pi/catkin_ws/src/clever/clever/launch/clever.launch`, choose one of the preconfigured bridge modes.
|
||||
After that, in the Clover launch-file `/home/pi/catkin_ws/src/clover/clover/launch/clover.launch`, choose one of the preconfigured bridge modes.
|
||||
|
||||
After editing the launch-file, restart the clever service:
|
||||
After editing the launch-file, restart the `clover` service:
|
||||
|
||||
```(bash)
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
TCP bridge
|
||||
@@ -27,7 +27,7 @@ Then in the QGroundControl program, choose Application Settings > Comm Links > A
|
||||
|
||||

|
||||
|
||||
Then choose "Clever" from the list of connections, and click "Connect".
|
||||
Then choose the created connection from the list of connections, and click "Connect".
|
||||
|
||||
UDP bridge (with automated connection)
|
||||
---
|
||||
@@ -53,7 +53,7 @@ Then in the QGroundControl program, choose Application Settings > Comm Links > A
|
||||
|
||||

|
||||
|
||||
Then choose "CLEVER" from the list of connections, and click "Connect".
|
||||
Then choose the created connection from the list of connections, and click "Connect".
|
||||
|
||||
UDP broadcast bridge
|
||||
---
|
||||
|
||||
@@ -41,13 +41,13 @@ A rechargeable power source for the drone. Quadrotors typically use LiPo (lithiu
|
||||
|
||||
Single element of the battery pack. Typical drone batteries contain several (2 to 6) cells connected in series. Maximum LiPo cell voltage is 4.2 v; battery voltage is a sum of each cell's voltage (if they are connected in series). The number of cells connected in series is marked by the letter *S*, as in *2S* (two cells in series), *3S*, *4S*.
|
||||
|
||||
Clever kits typically use *3S* batteries.
|
||||
Clover kits typically use *3S* batteries.
|
||||
|
||||
## Remote control / radio control equipment
|
||||
|
||||
A radio-operated quadcopter remote control. Operation of the remote control requires connecting a receiver to the flight controller.
|
||||
|
||||
Clever may also be [controlled from a smartphone](rc.md).
|
||||
Clover may also be [controlled from a smartphone](rc.md).
|
||||
|
||||
## Telemetry
|
||||
|
||||
@@ -55,7 +55,7 @@ Clever may also be [controlled from a smartphone](rc.md).
|
||||
|
||||
**2\.** The data about the aircraft state (height, orientation, global coordinates, etc.).
|
||||
|
||||
**3\.** A system for transmitting the data about the aircraft state or commands to it over the air. Examples: radio modems (RFD900, 3DR Radio Modem), Wi-Fi modules (ESP-07). Raspberry Pi may also be used in Clever as a telemetry module: [the use of QGroundControl via Wi-Fi](gcs_bridge.md).
|
||||
**3\.** A system for transmitting the data about the aircraft state or commands to it over the air. Examples: radio modems (RFD900, 3DR Radio Modem), Wi-Fi modules (ESP-07). Raspberry Pi may also be used in Clover as a telemetry module: [the use of QGroundControl via Wi-Fi](gcs_bridge.md).
|
||||
|
||||
## Arming
|
||||
|
||||
@@ -65,17 +65,17 @@ The opposite state is Disarmed.
|
||||
|
||||
## PX4
|
||||
|
||||
A popular open source flight controller software that works with the Pixhawk series of flight controllers, Pixracer, and others. PX4 is recommended to be used with Clever.
|
||||
A popular open source flight controller software that works with the Pixhawk series of flight controllers, Pixracer, and others. PX4 is recommended to be used with Clover.
|
||||
|
||||
## Raspberry Pi
|
||||
|
||||
[A popular single-board computer](raspberry.md) that is used in the Clever kit.
|
||||
[A popular single-board computer](raspberry.md) that is used in the Clover kit.
|
||||
|
||||
## SD card image
|
||||
|
||||
A complete digital copy of SD card contents stored in a single file. This file may be written to an SD card using special software like Etcher. A Raspberry Pi's SD card is the only long-term memory of the single-board computer.
|
||||
|
||||
The Clever kit includes a [recommended SD card image](image.md)
|
||||
The Clover kit includes a [recommended SD card image](image.md)
|
||||
|
||||
## APM / ArduPilot
|
||||
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
# Hostname
|
||||
|
||||
[By default](image.md) the hostname of the Clever drone is set to `clever-xxxx`, where `xxxx` are random numbers. These numbers are the same as in the [Wi-Fi SSID](wifi.md).
|
||||
> **Note** The following applies to [image version](image.md) **0.20** and up. See [previous version of the article](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/hostname.md) for older images.
|
||||
|
||||
Thus, Clever is accessible on machines that support mDNS as `clever-xxxx.local`. You can use this name to access Clever over SSH:
|
||||
[By default](image.md) the hostname of the Clover drone is set to `clover-xxxx`, where `xxxx` are random numbers. These numbers are the same as in the [Wi-Fi SSID](wifi.md).
|
||||
|
||||
Thus, Clover is accessible on machines that support mDNS as `clover-xxxx.local`. You can use this name to access Clover over SSH:
|
||||
|
||||
```bash
|
||||
ssh pi@clever-xxxx.local
|
||||
ssh pi@clover-xxxx.local
|
||||
```
|
||||
|
||||
Also, this name can be used in place of IP-address to open Clever web pages in browser, accessing ROS master, etc.
|
||||
Also, this name can be used in place of IP-address to open Clover web pages in browser, accessing ROS master, etc.
|
||||
|
||||
## Changing hostname
|
||||
|
||||
In some situations it is necessary to change Clever's hostname. You can use the `hostnamectl` utility for that:
|
||||
In some situations it is necessary to change Clover's hostname. You can use the `hostnamectl` utility for that:
|
||||
|
||||
```bash
|
||||
sudo hostnamectl set-hostname newname
|
||||
|
||||
@@ -31,7 +31,7 @@ Before you test it you need to install on your laptop:
|
||||
- Install Nodejs from [here](https://nodejs.org/en/download/). For [Ubuntu installation](https://tecadmin.net/install-latest-nodejs-npm-on-ubuntu/)
|
||||
- Install Yarn package manager from [here](https://yarnpkg.com/lang/en/docs/install/). [Usual problem](https://github.com/yarnpkg/yarn/issues/3189) while installing and using yarn with Ubuntu.
|
||||
- Have an experience in manual control on the drone in case of any weird behavior happen.
|
||||
- Worked before with COEX drones, if this is your first time to work with COEX drones check [this](https://clever.coex.tech/en/).
|
||||
- Worked before with COEX drones, if this is your first time to work with COEX drones check [this](https://clover.coex.tech/en/).
|
||||
|
||||
and you are ready to build and use the required codes.
|
||||
|
||||
@@ -145,7 +145,7 @@ Animation is created by [this](https://justsketchme.web.app/)
|
||||
## References
|
||||
|
||||
- [Human pose estimation guide](https://blog.nanonets.com/human-pose-estimation-2d-guide/)
|
||||
- [Clever drones tutorials](https://clever.coex.tech/en/)
|
||||
- [Clover drones tutorials](https://clover.coex.tech/en/)
|
||||
- [Posenet GitHub repo](https://github.com/tensorflow/tfjs-models/tree/master/posenet)
|
||||
- [Posenet meduim article](https://medium.com/tensorflow/real-time-human-pose-estimation-in-the-browser-with-tensorflow-js-7dd0bc881cd5)
|
||||
- [Tensorflow.js demos](https://www.tensorflow.org/js/demos)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# Raspberry Pi image
|
||||
|
||||
The RPi image for Clever contains all the necessary software for working with Clever and [programming autonomous flights](simple_offboard.md). The Clever platform is based on [Raspbian OS](https://www.raspberrypi.org/downloads/raspbian/) and robotics framework [ROS](ros.md). The source code of the image builder and all the additional packages is [available on GitHub](https://github.com/CopterExpress/clever).
|
||||
The RPi image for Clover contains all the necessary software for working with Clover and [programming autonomous flights](simple_offboard.md). The Clover platform is based on [Raspbian OS](https://www.raspberrypi.org/downloads/raspbian/) and robotics framework [ROS](ros.md). The source code of the image builder and all the additional packages is [available on GitHub](https://github.com/CopterExpress/clover).
|
||||
|
||||
## Usage
|
||||
|
||||
1. Download the latest stable release of the image – **<a class="latest-image" href="https://github.com/CopterExpress/clever/releases">download</a>**.
|
||||
1. Download the latest stable release of the image – **<a class="latest-image" href="https://github.com/CopterExpress/clover/releases">download</a>**.
|
||||
2. Download and install [Etcher](https://www.balena.io/etcher/), the software for flashing images (available for Windows/Linux/macOS).
|
||||
3. Put the MicroSD-card into your computer (use an adapter if necessary).
|
||||
4. Flash the downloaded image to the card using Etcher.
|
||||
@@ -12,6 +12,6 @@ The RPi image for Clever contains all the necessary software for working with Cl
|
||||
|
||||
<img src="../assets/etcher.png" class="zoom">
|
||||
|
||||
After flashing the image on the MicroSD-card, you can [connect to the Clever over Wi-Fi](wifi.md), use [wireless connection in QGroundControl](gcs_bridge.md), gain access to the Raspberry [over SSH](ssh.md) and use all the other features.
|
||||
After flashing the image on the MicroSD-card, you can [connect to the Clover over Wi-Fi](wifi.md), use [wireless connection in QGroundControl](gcs_bridge.md), gain access to the Raspberry [over SSH](ssh.md) and use all the other features.
|
||||
|
||||
**Next:** [Connecting over Wi-Fi](wifi.md).
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Clever and Jetson Nano
|
||||
# Clover and Jetson Nano
|
||||
|
||||
## Jetson Nano overview
|
||||
|
||||
@@ -12,7 +12,7 @@ Jetson Nano developer kits come with a carrier board that has USB 3.0, CSI and E
|
||||
|
||||
## Setting up
|
||||
|
||||
Nvidia provides an SD card image with an operating system based on Ubuntu Linux 18.04 for Jetson Nano. This image is a good starting point for ROS and Clever installation.
|
||||
Nvidia provides an SD card image with an operating system based on Ubuntu Linux 18.04 for Jetson Nano. This image is a good starting point for ROS and Clover installation.
|
||||
|
||||
### Initial system setup
|
||||
|
||||
@@ -70,14 +70,14 @@ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
|
||||
sudo python ./get-pip.py
|
||||
```
|
||||
|
||||
### Building Clever nodes
|
||||
### Building Clover nodes
|
||||
|
||||
Create a "workspace" directory in your home folder and populate it with Clever packages:
|
||||
Create a "workspace" directory in your home folder and populate it with Clover packages:
|
||||
|
||||
```bash
|
||||
mkdir -p ~/catkin_ws/src
|
||||
cd ~/catkin_ws/src
|
||||
git clone https://github.com/CopterExpress/clever
|
||||
git clone https://github.com/CopterExpress/clover
|
||||
git clone https://github.com/CopterExpress/ros_led
|
||||
git clone https://github.com/okalachev/vl53l1x_ros
|
||||
```
|
||||
@@ -103,16 +103,16 @@ Install development libraries for OpenCV 3.2 (recent Jetson Nano images have Ope
|
||||
sudo apt install libopencv-dev=3.2.0+dfsg-4ubuntu0.1
|
||||
```
|
||||
|
||||
Finally, build the Clever nodes:
|
||||
Finally, build the Clover nodes:
|
||||
|
||||
```bash
|
||||
cd ~/catkin_ws
|
||||
catkin_make
|
||||
```
|
||||
|
||||
> **Hint** You may also want to add udev rules for PX4 flight controllers. Copy [the rules file](https://github.com/CopterExpress/clever/blob/master/clever/config/99-px4fmu.rules) to `/etc/udev/rules.d` and run `sudo udevadm control --reload-rules && sudo udevadm trigger`.
|
||||
> **Hint** You may also want to add udev rules for PX4 flight controllers. Copy [the rules file](https://github.com/CopterExpress/clover/blob/master/clover/config/99-px4fmu.rules) to `/etc/udev/rules.d` and run `sudo udevadm control --reload-rules && sudo udevadm trigger`.
|
||||
|
||||
### Running Clever nodes
|
||||
### Running Clover nodes
|
||||
|
||||
Set up the workspace environment:
|
||||
|
||||
@@ -124,10 +124,10 @@ source devel/setup.bash
|
||||
Configure the launch files to your taste and use `roslaunch` to launch the nodes:
|
||||
|
||||
```bash
|
||||
roslaunch clever clever.launch
|
||||
roslaunch clover clover.launch
|
||||
```
|
||||
|
||||
> **Hint** You may want to start the Clever nodes automatically. This can be done with `systemd`: look at service files for [`roscore`](https://github.com/CopterExpress/clever/blob/master/builder/assets/roscore.service) and [`clever`](https://github.com/CopterExpress/clever/blob/master/builder/assets/clever.service) that are used in our image and adjust them as necessary.
|
||||
> **Hint** You may want to start the Clover nodes automatically. This can be done with `systemd`: look at service files for [`roscore`](https://github.com/CopterExpress/clover/blob/master/builder/assets/roscore.service) and [`clover`](https://github.com/CopterExpress/clover/blob/master/builder/assets/clover.service) that are used in our image and adjust them as necessary.
|
||||
|
||||
## Caveats
|
||||
|
||||
|
||||
@@ -1,27 +1,16 @@
|
||||
# Working with a laser rangefinder
|
||||
|
||||
> **Note** Documentation for the [image](image.md), versions, starting with **0.18**. For older versions refer to [documentation for version **0.17**](https://github.com/CopterExpress/clever/blob/v0.17/docs/en/laser.md).
|
||||
> **Note** Documentation for the [image](image.md), versions, starting with **0.20**. For older versions refer to [documentation for version **0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/laser.md).
|
||||
|
||||
## VL53L1X Rangefinder
|
||||
|
||||
The rangefinder model recommended for Clever is STM VL53L1X. This rangefinder can measure distances from 0 to 4 m while ensuring high measurement accuracy.
|
||||
The rangefinder model recommended for Clover is STM VL53L1X. This rangefinder can measure distances from 0 to 4 m while ensuring high measurement accuracy.
|
||||
|
||||
The [image for Raspberry Pi](image.md) contains pre-installed corresponding ROS driver.
|
||||
|
||||
### Connecting to Raspberry Pi
|
||||
|
||||
> **Note** You need to flash a <a id="download-firmware" href="https://github.com/CopterExpress/Firmware/releases">custom PX4 firmware</a> on your flight controller for the rangefinder to work correctly. See more about firmware in the [corresponding article](firmware.md).
|
||||
|
||||
<script type="text/javascript">
|
||||
fetch('https://api.github.com/repos/CopterExpress/Firmware/releases').then(res => res.json()).then(function(data) {
|
||||
for (let release of data) {
|
||||
if (!release.prerelease && !release.draft && release.tag_name.includes('-clever.')) {
|
||||
document.querySelector('#download-firmware').href = release.html_url;
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
> **Hint** We recommend using our [custom PX4 firmware for Clover](firmware.md#modified-firmware-for-clover) for best laser rangefinder support.
|
||||
|
||||
Connect the rangefinder to the 3V, GND, SCL and SDA pins via the I²C interface:
|
||||
|
||||
@@ -33,7 +22,7 @@ If the pin marked GND is occupied, you can use any other ground pin (look at the
|
||||
|
||||
### Enabling the rangefinder
|
||||
|
||||
[Connect via SSH](ssh.md) and edit file `~/catkin_ws/src/clever/clever/launch/clever.launch` so that the VL53L1X driver is enabled:
|
||||
[Connect via SSH](ssh.md) and edit file `~/catkin_ws/src/clover/clover/launch/clover.launch` so that the VL53L1X driver is enabled:
|
||||
|
||||
```xml
|
||||
<arg name="rangefinder_vl53l1x" default="true"/>
|
||||
@@ -74,6 +63,16 @@ def range_callback(msg):
|
||||
rospy.Subscriber('rangefinder/range', Range, range_callback)
|
||||
```
|
||||
|
||||
Also it's possible to read one rangefinder measurement at a time:
|
||||
|
||||
```python
|
||||
from sensor_msgs.msg import Range
|
||||
|
||||
# ...
|
||||
|
||||
data = rospy.wait_for_message('rangefinder/range', Range)
|
||||
```
|
||||
|
||||
### Data visualization
|
||||
|
||||
You may use rqt_multiplot tool to plot rangefinder data.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Working with a LED strip
|
||||
|
||||
> **Note** The following applies to image version 0.18 and up. See [previous version of the article](leds_old.md) for older images.
|
||||
> **Note** Documentation for the [image](image.md) versions, starting with **0.20**. For older versions refer to [documentation for version **0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/leds.md).
|
||||
|
||||
Clever drone kits contain addressable LED strips based on *ws281x* drivers. Each LED may be set to any one of 16 million possible colors (each color is encoded by a 24-bit number). This allows making the Clever flight more spectacular, as well as show flight modes, display stages of current user program, and notify the pilot of other events.
|
||||
Clover drone kits contain addressable LED strips based on *ws281x* drivers. Each LED may be set to any one of 16 million possible colors (each color is encoded by a 24-bit number). This allows making the Clover flight more spectacular, as well as show flight modes, display stages of current user program, and notify the pilot of other events.
|
||||
|
||||
<img src="../assets/clever-led.png" class="center" width=600>
|
||||
|
||||
@@ -17,13 +17,13 @@ Our [Raspberry Pi image](image.md) contains preinstalled modules for interfacing
|
||||
## High-level control
|
||||
|
||||
1. Connect the +5v and GND leads of your LED to a power source and the DIN (data in) lead to GPIO21. Consult the [assembly instructions](assemble_4.md#Connecting-the-LED-strip-to-Raspberry-Pi) for details.
|
||||
2. Enable LED strip support in `~/catkin_ws/src/clever/clever/launch/clever.launch`:
|
||||
2. Enable LED strip support in `~/catkin_ws/src/clover/clover/launch/clover.launch`:
|
||||
|
||||
```xml
|
||||
<arg name="led" default="true"/>
|
||||
```
|
||||
|
||||
3. Configure the *ws281x* parameters in `~/catkin_ws/src/clever/clever/launch/led.launch`. Change the number of addressable LEDs and the GPIO pin used for control to match your configuration:
|
||||
3. Configure the *ws281x* parameters in `~/catkin_ws/src/clover/clover/launch/led.launch`. Change the number of addressable LEDs and the GPIO pin used for control to match your configuration:
|
||||
|
||||
```xml
|
||||
<param name="led_count" value="30"/> <!-- Number of LEDs in the strip -->
|
||||
@@ -50,7 +50,7 @@ Python example:
|
||||
|
||||
```python
|
||||
import rospy
|
||||
from clever.srv import SetLEDEffect
|
||||
from clover.srv import SetLEDEffect
|
||||
|
||||
# ...
|
||||
|
||||
@@ -88,7 +88,7 @@ rosservice call /led/set_effect "{effect: 'rainbow'}"
|
||||
|
||||
## Configuring event visualizations
|
||||
|
||||
It is possible to display current flight controller status and notify the user about some events with the LED strip. This is configured in the `~/catkin_ws/src/clever/clever/launch/led.launch` file in the *events effects table* section. Here is a sample configuration:
|
||||
It is possible to display current flight controller status and notify the user about some events with the LED strip. This is configured in the `~/catkin_ws/src/clover/clover/launch/led.launch` file in the *events effects table* section. Here is a sample configuration:
|
||||
|
||||
```xml
|
||||
startup: { r: 255, g: 255, b: 255 }
|
||||
@@ -99,7 +99,7 @@ disconnected: { effect: blink, r: 255, g: 50, b: 50 }
|
||||
|
||||
The left part is one of the possible events that the strip reacts to. The right part contains the effect description that you want to execute for this event. Here is the list of supported events:
|
||||
|
||||
* `startup` – Clever system startup;
|
||||
* `startup` – Clover system startup;
|
||||
* `connected` – successful connection to the flight controller;
|
||||
* `disconnected` – connection to the flight controller lost;
|
||||
* `armed` – flight controller transitioned to armed state;
|
||||
@@ -110,7 +110,7 @@ The left part is one of the possible events that the strip reacts to. The right
|
||||
|
||||
> **Note** You need to [calibrate the power sensor](power.md#calibrating-the-power-sensor) for the `low_battery` event to work properly.
|
||||
|
||||
In order to disable LED strip notifications set `led_notify` argument in `~/catkin_ws/src/clever/clever/launch/led.launch` to `false`:
|
||||
In order to disable LED strip notifications set `led_notify` argument in `~/catkin_ws/src/clover/clover/launch/led.launch` to `false`:
|
||||
|
||||
```xml
|
||||
<arg name="led_notify" default="false"/>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Connecting and determining the type of the strip
|
||||
|
||||
> **Note** The following is applicable to image versions 0.14 and up. For versions 0.13 and older see [an older revision of this article](https://github.com/CopterExpress/clever/blob/v0.16/docs/en/leds.md)
|
||||
> **Note** The following is applicable to image versions 0.14 and up. For versions 0.13 and older see [an older revision of this article](https://github.com/CopterExpress/clover/blob/v0.16/docs/en/leds.md)
|
||||
|
||||
Connect the +5v and GND leads of your LED to a power source and the DIN (data in) lead to GPIO18 or GPIO21.
|
||||
|
||||
@@ -103,7 +103,7 @@ Main strip control methods:
|
||||
|
||||
## Does it have to be this way?
|
||||
|
||||
The LED strip type used in the Clever kits use the following protocol: a data source (a Raspberry Pi, for example) sends a bit stream, 24 bits per LED. Each LED reads the first 24 bits from the stream and sets its color accordingly while passing the rest of the stream to the next LED. Zeroes and ones are encoded by different pulse lengths.
|
||||
The LED strip type used in the Clover kits use the following protocol: a data source (a Raspberry Pi, for example) sends a bit stream, 24 bits per LED. Each LED reads the first 24 bits from the stream and sets its color accordingly while passing the rest of the stream to the next LED. Zeroes and ones are encoded by different pulse lengths.
|
||||
|
||||
This LED strip is supported by the [rpi_ws281x](https://github.com/jgarff/rpi_ws281x) library. The library uses the DMA (direct memory access) module of the Raspberry CPU and can utilize one of the three periphery channels: PWM, PCM or SPI. This allows the library to drive the strip consistently in a multitasking environment.
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
# Theory
|
||||
|
||||
[**Lesson # 1** "Introduction. Principles of designing and building multicopters"](https://github.com/CopterExpress/clever/blob/master/docs/en/lesson1.md)
|
||||
[**Lesson # 1** "Introduction. Principles of designing and building multicopters"](https://github.com/CopterExpress/clover/blob/master/docs/en/lesson1.md)
|
||||
|
||||
[**Lesson # 2** "Fundamentals of electricity"](https://github.com/CopterExpress/clever/blob/master/docs/en/lesson2.md)
|
||||
[**Lesson # 2** "Fundamentals of electricity"](https://github.com/CopterExpress/clover/blob/master/docs/en/lesson2.md)
|
||||
|
||||
[**Lesson # 3** "Theory of soldering"](https://github.com/CopterExpress/clever/blob/master/docs/en/lesson3.md)
|
||||
[**Lesson # 3** "Theory of soldering"](https://github.com/CopterExpress/clover/blob/master/docs/en/lesson3.md)
|
||||
|
||||
[**Lesson # 4** "Aerodynamics of the flight. Propeller"](https://github.com/CopterExpress/clever/blob/master/docs/en/lesson4.md)
|
||||
[**Lesson # 4** "Aerodynamics of the flight. Propeller"](https://github.com/CopterExpress/clover/blob/master/docs/en/lesson4.md)
|
||||
|
||||
<!--[**Lesson # 5** "Brushless motors and controllers"](https://github.com/CopterExpress/clever/blob/master/docs/en/lesson5.md)-->
|
||||
<!--[**Lesson # 5** "Brushless motors and controllers"](https://github.com/CopterExpress/clover/blob/master/docs/en/lesson5.md)-->
|
||||
|
||||
[**Lesson 6** "Fundamentals of electromagnetism. Types of motors"](https://github.com/CopterExpress/clever/blob/master/docs/en/lesson6.md)
|
||||
[**Lesson 6** "Fundamentals of electromagnetism. Types of motors"](https://github.com/CopterExpress/clover/blob/master/docs/en/lesson6.md)
|
||||
|
||||
<!--[**Lesson # 7** "Operating principle, types and design of batteries"](https://github.com/CopterExpress/clever/blob/master/docs/en/lesson7.md)
|
||||
<!--[**Lesson # 7** "Operating principle, types and design of batteries"](https://github.com/CopterExpress/clover/blob/master/docs/en/lesson7.md)
|
||||
|
||||
[**Lesson # 8** "Controlling the flight of the multicopter. The flight controller operating principle. PID ESCs"](https://github.com/CopterExpress/clever/blob/master/docs/en/lesson8.md)
|
||||
[**Lesson # 8** "Controlling the flight of the multicopter. The flight controller operating principle. PID ESCs"](https://github.com/CopterExpress/clover/blob/master/docs/en/lesson8.md)
|
||||
|
||||
[**Lesson # 9** "Fundamentals of radio communication. Operation principle of radio control equipment"](https://github.com/CopterExpress/clever/blob/master/docs/en/lesson9.md)
|
||||
[**Lesson # 9** "Fundamentals of radio communication. Operation principle of radio control equipment"](https://github.com/CopterExpress/clover/blob/master/docs/en/lesson9.md)
|
||||
|
||||
[**Lesson # 10** "Analog and digital video streaming. Cameras, transmitters and receivers used"](https://github.com/CopterExpress/clever/blob/master/docs/en/lesson10.md)-->
|
||||
[**Lesson # 10** "Analog and digital video streaming. Cameras, transmitters and receivers used"](https://github.com/CopterExpress/clover/blob/master/docs/en/lesson10.md)-->
|
||||
|
||||
## Video lessons
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Basic documentation: https://mavlink.io/en/.
|
||||
|
||||
MAVLink is a communication protocol between autonomous aircraft and vehicle systems (drones, planes, vehicles). The MAVLink protocol lies at the base of interaction between Pixhawk and Raspberry Pi.
|
||||
|
||||
Clever contains two wrappers for this protocol: [MAVROS](mavros.md) and [simple_offboard](simple_offboard.md).
|
||||
Clover contains two wrappers for this protocol: [MAVROS](mavros.md) and [simple_offboard](simple_offboard.md).
|
||||
|
||||
The code for sending an arbitrary MAVLink message may be found in [the examples](snippets.md#mavlink).
|
||||
|
||||
@@ -35,7 +35,7 @@ A complete list of MAVLink messages is available in [MAVLink documentation] (htt
|
||||
|
||||
Each device (a drone, a base station, etc.) has an ID in the MAVLink network. In PX4 MAVLink, ID is changed using parameter `MAV_SYS_ID`. Each MAVLink message contains a field with the ID of the originating system. Besides, some messages (for example, `COMMAND_LONG`) also contain the ID of the target system.
|
||||
|
||||
In addition to IDs of the systems, the messages may contain IDs of the originating component and the target component. Examples of the system components: a flight controller, an external camera, a controlling onboard computer (Raspberry Pi in case of Clever), etc.
|
||||
In addition to IDs of the systems, the messages may contain IDs of the originating component and the target component. Examples of the system components: a flight controller, an external camera, a controlling onboard computer (Raspberry Pi in case of Clover), etc.
|
||||
|
||||
### An example of a package
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@ MAVROS \(MAVLink + ROS\) is a ROS package that allows controlling drones via the
|
||||
|
||||
MAVROS subscribes to certain ROS topics that can be used to send commands, publishes telemetry to other topics, and provides services.
|
||||
|
||||
The MAVROS node is automatically started in the Clever launch-file. In order to [set the type of connection](connection.md), change the `fcu_conn` argument.
|
||||
The MAVROS node is automatically started in the Clover launch-file. In order to [set the type of connection](connection.md), change the `fcu_conn` argument.
|
||||
|
||||
> **Hint** Simplified interaction with the drone is possible with the use of [`simple_offboard`] package (simple_offboard.md).
|
||||
|
||||
<!-- -->
|
||||
|
||||
> **Note** Some MAVROS plugins are disabled by default in the `clever` package in order to save resources. For more information, see the `plugin_blacklist` parameter in `/home/pi/catkin_ws/src/clever/clever/launch/mavros.launch`.
|
||||
> **Note** Some MAVROS plugins are disabled by default in the `clover` package in order to save resources. For more information, see the `plugin_blacklist` parameter in `/home/pi/catkin_ws/src/clover/clover/launch/mavros.launch`.
|
||||
|
||||
## Main services
|
||||
|
||||
|
||||
129
docs/en/migrate20.md
Normal file
129
docs/en/migrate20.md
Normal file
@@ -0,0 +1,129 @@
|
||||
# Migration to version 0.20
|
||||
|
||||
[Image](image.md) version v0.20 includes significant changes in comparison with the version 0.19. When transitioning please note the changes presented below.
|
||||
|
||||
## ROS package `clever` is renamed to `clover`
|
||||
|
||||
All the imports in Python scripts should be changed.
|
||||
|
||||
Before:
|
||||
|
||||
```python
|
||||
import rospy
|
||||
from clever import srv
|
||||
from std_srvs.srv import Trigger
|
||||
|
||||
rospy.init_node('flight')
|
||||
|
||||
get_telemetry = rospy.ServiceProxy('get_telemetry', srv.GetTelemetry)
|
||||
navigate = rospy.ServiceProxy('navigate', srv.Navigate)
|
||||
navigate_global = rospy.ServiceProxy('navigate_global', srv.NavigateGlobal)
|
||||
set_position = rospy.ServiceProxy('set_position', srv.SetPosition)
|
||||
set_velocity = rospy.ServiceProxy('set_velocity', srv.SetVelocity)
|
||||
set_attitude = rospy.ServiceProxy('set_attitude', srv.SetAttitude)
|
||||
set_rates = rospy.ServiceProxy('set_rates', srv.SetRates)
|
||||
land = rospy.ServiceProxy('land', Trigger)
|
||||
|
||||
# Take off 1 m
|
||||
navigate(x=0, y=0, z=1, frame_id='body', auto_arm=True)
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```python
|
||||
import rospy
|
||||
from clover import srv
|
||||
from std_srvs.srv import Trigger
|
||||
|
||||
rospy.init_node('flight')
|
||||
|
||||
get_telemetry = rospy.ServiceProxy('get_telemetry', srv.GetTelemetry)
|
||||
navigate = rospy.ServiceProxy('navigate', srv.Navigate)
|
||||
navigate_global = rospy.ServiceProxy('navigate_global', srv.NavigateGlobal)
|
||||
set_position = rospy.ServiceProxy('set_position', srv.SetPosition)
|
||||
set_velocity = rospy.ServiceProxy('set_velocity', srv.SetVelocity)
|
||||
set_attitude = rospy.ServiceProxy('set_attitude', srv.SetAttitude)
|
||||
set_rates = rospy.ServiceProxy('set_rates', srv.SetRates)
|
||||
land = rospy.ServiceProxy('land', Trigger)
|
||||
|
||||
# Take off 1 м
|
||||
navigate(x=0, y=0, z=1, frame_id='body', auto_arm=True)
|
||||
```
|
||||
|
||||
## systemd service `clever` is renamed to `clover`
|
||||
|
||||
For restarting the platform instead of:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart clever
|
||||
```
|
||||
|
||||
use command:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
## Path to platform's files changed
|
||||
|
||||
The `~/catkin_ws/src/clever/` directory is renamed to `~/catkin_ws/src/clover`. Thus, configuration files (`*.launch`) are to be edited using the new path.
|
||||
|
||||
For example, `~/catkin_ws/src/clever/clever/launch/clever.launch` file is now `~/catkin_ws/src/clover/clover/launch/clover.launch`.
|
||||
|
||||
<!--
|
||||
## Python 3 transition
|
||||
|
||||
Python 2 is depracated since, January 1st, 2020. The Clover platform moves to Python 3.
|
||||
|
||||
For running flight script instead of `python` command:
|
||||
|
||||
```bash
|
||||
python flight.py
|
||||
```
|
||||
|
||||
use `python3` command:
|
||||
|
||||
```bash
|
||||
python3 flight.py
|
||||
```
|
||||
|
||||
Python 3 has certain syntax differences in comparison with the old version. Instead of `print` *operator*:
|
||||
|
||||
```python
|
||||
print 'Clover is the best'
|
||||
```
|
||||
|
||||
use `print` *function*:
|
||||
|
||||
```python
|
||||
print('Clover is the best')
|
||||
```
|
||||
|
||||
The division operator operates floating points by default (instead of integer). Python 2:
|
||||
|
||||
```python
|
||||
>>> 10 / 4
|
||||
2
|
||||
```
|
||||
|
||||
Python 3:
|
||||
|
||||
```python
|
||||
>>> 10 / 4
|
||||
2.5
|
||||
```
|
||||
|
||||
For strings `unicode` type is used by default (instead of `str` type).
|
||||
|
||||
Encoding specification (`# coding: utf8`) is not necessary any more.
|
||||
|
||||
More details on all the language changes see in [appropriate article](https://sebastianraschka.com/Articles/2014_python_2_3_key_diff.html).
|
||||
-->
|
||||
|
||||
## Wi-Fi network configuration
|
||||
|
||||
Wi-Fi networks' SSID is changed to `clover-XXXX` (where X is a random number), password is changed to `cloverwifi`.
|
||||
|
||||
## The camera orientation configuration changed
|
||||
|
||||
See details in the "[Camera setup](camera_setup.md#frame)" article.
|
||||
@@ -6,31 +6,33 @@ This page contains models and drawings of some of the drone parts. They can be u
|
||||
|
||||
### 3D print
|
||||
|
||||
* Battery holder – [`battery_holder.stl`](https://github.com/CopterExpress/clever/raw/master/docs/assets/stl/battery_holder.stl). Filament: PLA/ABS/SBS. Infill: 50% or more.
|
||||
* Battery holder – [`battery_holder.stl`](https://github.com/CopterExpress/clover/raw/master/docs/assets/stl/battery_holder.stl). Filament: PLA/ABS/SBS. Infill: 50% or more.
|
||||
|
||||
### Laser cut
|
||||
|
||||
* Reinforcing Pad – [`reinforcing_pad.dxf`](https://github.com/CopterExpress/clever/raw/master/docs/assets/dxf/reinforcing_pad.dxf)
|
||||
* Reinforcing Pad – [`reinforcing_pad.dxf`](https://github.com/CopterExpress/clover/raw/master/docs/assets/dxf/reinforcing_pad.dxf)
|
||||
|
||||
## Clover 3
|
||||
|
||||
### 3D print
|
||||
|
||||
* Camera case – [`camera_case.stl`](https://github.com/CopterExpress/clever/raw/master/docs/assets/stl/camera_case.stl). Filament: PLA/ABS/SBS.
|
||||
* Camera mount – [`camera_mount.stl`](https://github.com/CopterExpress/clever/raw/master/docs/assets/stl/camera_mount.stl). Filament: PLA/ABS/SBS.
|
||||
* Camera plate – [`camera_plate.stl`](https://github.com/CopterExpress/clever/raw/master/docs/assets/stl/camera_plate.stl). Filament: PLA/ABS/SBS.
|
||||
* Camera case – [`camera_case.stl`](https://github.com/CopterExpress/clover/raw/master/docs/assets/stl/camera_case.stl). Filament: PLA/ABS/SBS.
|
||||
* Camera mount – [`camera_mount.stl`](https://github.com/CopterExpress/clover/raw/master/docs/assets/stl/camera_mount.stl). Filament: PLA/ABS/SBS.
|
||||
* Camera plate – [`camera_plate.stl`](https://github.com/CopterExpress/clover/raw/master/docs/assets/stl/camera_plate.stl). Filament: PLA/ABS/SBS.
|
||||
* Mounting deck small – [`mounting_deck_small.stl`](https://github.com/CopterExpress/clover/raw/master/docs/assets/stl/mounting_deck_small.stl). Filament: PLA/ABS/SBS.
|
||||
|
||||
### Laser cut
|
||||
|
||||
* Big leg – [`big_leg.dxf`](https://github.com/CopterExpress/clever/raw/master/docs/assets/dxf/big_leg.dxf).
|
||||
* Deck mount – [`deck.dxf`](https://github.com/CopterExpress/clever/raw/master/docs/assets/dxf/deck.dxf).
|
||||
* Prop guard – [`prop_guard.dxf`](https://github.com/CopterExpress/clever/raw/master/docs/assets/dxf/prop_guard.dxf).
|
||||
* Prop guard fork – [`prop_guard_mount.dxf`](https://github.com/CopterExpress/clever/raw/master/docs/assets/dxf/prop_guard_mount.dxf).
|
||||
* Spacer – [`grab_spacer.dxf`](https://github.com/CopterExpress/clever/raw/master/docs/assets/dxf/grab_spacer.dxf).
|
||||
* Leg – [`leg.dxf`](https://github.com/CopterExpress/clever/raw/master/docs/assets/dxf/leg.dxf).
|
||||
* LED mount plate – [`led_mount_plate.dxf`](https://github.com/CopterExpress/clever/raw/master/docs/assets/dxf/led_mount_plate.dxf).
|
||||
* Big leg – [`big_leg.dxf`](https://github.com/CopterExpress/clover/raw/master/docs/assets/dxf/big_leg.dxf).
|
||||
* Deck mount – [`deck.dxf`](https://github.com/CopterExpress/clover/raw/master/docs/assets/dxf/deck.dxf).
|
||||
* Prop guard – [`prop_guard.dxf`](https://github.com/CopterExpress/clover/raw/master/docs/assets/dxf/prop_guard.dxf).
|
||||
* Prop guard fork – [`prop_guard_mount.dxf`](https://github.com/CopterExpress/clover/raw/master/docs/assets/dxf/prop_guard_mount.dxf).
|
||||
* Spacer – [`grab_spacer.dxf`](https://github.com/CopterExpress/clover/raw/master/docs/assets/dxf/grab_spacer.dxf).
|
||||
* Leg – [`leg.dxf`](https://github.com/CopterExpress/clover/raw/master/docs/assets/dxf/leg.dxf).
|
||||
* LED mount plate – [`led_mount_plate.dxf`](https://github.com/CopterExpress/clover/raw/master/docs/assets/dxf/led_mount_plate.dxf).
|
||||
* Mounting deck small – [`mounting_deck_small.dxf`](https://github.com/CopterExpress/clover/raw/master/docs/assets/dxf/mounting_deck_small.dxf).
|
||||
|
||||
### Milling
|
||||
|
||||
* Central plate – [`central_plate.dxf`](https://github.com/CopterExpress/clever/raw/master/docs/assets/dxf/central_plate.dxf).
|
||||
* Arm – [`arm.dxf`](https://github.com/CopterExpress/clever/raw/master/docs/assets/dxf/arm.dxf).
|
||||
* Central plate – [`central_plate.dxf`](https://github.com/CopterExpress/clover/raw/master/docs/assets/dxf/central_plate.dxf).
|
||||
* Arm – [`arm.dxf`](https://github.com/CopterExpress/clover/raw/master/docs/assets/dxf/arm.dxf).
|
||||
|
||||
@@ -39,7 +39,7 @@ In manual mode the pilot controls the drone directly. GPS, computer vision data,
|
||||
|
||||
In autonomous flight modes the quadcopter ignores the control signals from the transmitter and uses a program to fly.
|
||||
|
||||
* **OFFBOARD** mode uses an external computer (like a [Raspberry Pi](raspberry.md)). This mode is used in Clever for [autonomous flights](simple_offboard.md).
|
||||
* **OFFBOARD** mode uses an external computer (like a [Raspberry Pi](raspberry.md)). This mode is used in Clover for [autonomous flights](simple_offboard.md).
|
||||
* **AUTO.MISSION** – PX4 uses the mission pre-loaded into the drone (the mission is uploaded using ground control station over [MAVLink](mavlink.md)). This mode is commonly used to move in a pre-planned path using GPS as a position source, for example, in photogrammetry.
|
||||
* **AUTO.RTL** – the copter automatically returns to the takeoff (launch) point.
|
||||
* **AUTO.LAND** – the copter lands at the current position.
|
||||
|
||||
@@ -20,7 +20,7 @@ On our [RPi image](image.md) the Wi-Fi adapter is configured to use the [access
|
||||
```txt
|
||||
network={
|
||||
ssid="my-super-ssid"
|
||||
psk="cleverwifi123"
|
||||
psk="cloverwifi123"
|
||||
mode=2
|
||||
proto=RSN
|
||||
key_mgmt=WPA-PSK
|
||||
@@ -90,8 +90,8 @@ On our [RPi image](image.md) the Wi-Fi adapter is configured to use the [access
|
||||
country=GB
|
||||
|
||||
network={
|
||||
ssid="CLEVER-1234"
|
||||
psk="cleverwifi"
|
||||
ssid="clover-1234"
|
||||
psk="cloverwifi"
|
||||
mode=2
|
||||
proto=RSN
|
||||
key_mgmt=WPA-PSK
|
||||
@@ -101,7 +101,7 @@ On our [RPi image](image.md) the Wi-Fi adapter is configured to use the [access
|
||||
}
|
||||
```
|
||||
|
||||
where `CLEVER-1234` is the network name and `cleverwifi` is the password.
|
||||
where `clover-1234` is the network name and `cloverwifi` is the password.
|
||||
|
||||
3. Enable the `dnsmasq` service.
|
||||
|
||||
@@ -155,8 +155,8 @@ update_config=1
|
||||
country=GB
|
||||
|
||||
network={
|
||||
ssid=\"CLEVER-SMIRNOV\"
|
||||
psk=\"cleverwifi\"
|
||||
ssid=\"my-clover\"
|
||||
psk=\"cloverwifi\"
|
||||
mode=2
|
||||
proto=RSN
|
||||
key_mgmt=WPA-PSK
|
||||
@@ -212,7 +212,7 @@ sudo apt install dnsmasq-base
|
||||
|
||||
```bash
|
||||
# Calling dnsmasq-base
|
||||
sudo dnsmasq --interface=wlan0 --address=/clever/coex/192.168.11.1 --no-daemon --dhcp-range=192.168.11.100,192.168.11.200,12h --no-hosts --filterwin2k --bogus-priv --domain-needed --quiet-dhcp6 --log-queries
|
||||
sudo dnsmasq --interface=wlan0 --address=/clover/coex/192.168.11.1 --no-daemon --dhcp-range=192.168.11.100,192.168.11.200,12h --no-hosts --filterwin2k --bogus-priv --domain-needed --quiet-dhcp6 --log-queries
|
||||
|
||||
# More about dnsmasq-base
|
||||
dnsmasq --help
|
||||
@@ -230,7 +230,7 @@ sudo apt install dnsmasq
|
||||
```bash
|
||||
cat << EOF | sudo tee -a /etc/dnsmasq.conf
|
||||
interface=wlan0
|
||||
address=/clever/coex/192.168.11.1
|
||||
address=/clover/coex/192.168.11.1
|
||||
dhcp-range=192.168.11.100,192.168.11.200,12h
|
||||
no-hosts
|
||||
filterwin2k
|
||||
|
||||
@@ -4,11 +4,11 @@ Running the technology "Optical Flow" offers the possibility of POSCTL flight mo
|
||||
|
||||
## Enabling
|
||||
|
||||
> **Hint** It is recommended to use [special PX4 firmware for Clever](firmware.md#прошивка-для-клевера).
|
||||
> **Hint** It is recommended to use [special PX4 firmware for Clover](firmware.md).
|
||||
|
||||
The use of a rangefinder is essential. [Connect and setup laser-ranging sensor VL53L1X](laser.md), according to the manual.
|
||||
|
||||
Enable Optical Flow in the file `~/catkin_ws/src/clever/clever/launch/clever.launch`:
|
||||
Enable Optical Flow in the file `~/catkin_ws/src/clover/clover/launch/clover.launch`:
|
||||
|
||||
```xml
|
||||
<arg name="optical_flow" default="true"/>
|
||||
@@ -20,7 +20,7 @@ Optical Flow publishes data in `mavros/px4flow/raw/send` topic. In the topic `op
|
||||
|
||||
## Setup of the flight controller
|
||||
|
||||
> **Hint** Suggested parameters are applied automatically in [our custom PX4 firmware](firmware.md#modified-firmware-for-clever).
|
||||
> **Hint** Suggested parameters are applied automatically in [our custom PX4 firmware](firmware.md#modified-firmware-for-clover).
|
||||
|
||||
When using **EKF2** (parameter `SYS_MC_EST_GROUP` = `ekf2`):
|
||||
|
||||
@@ -74,7 +74,7 @@ navigate(x=1.5, frame_id='body')
|
||||
|
||||
<!-- TODO: статья по пидам -->
|
||||
|
||||
If the copter has an unstable position using VPE, try to increase the *P* coefficient of speed PID controller - parameters are `MPC_XY_VEL_P` and `MPC_Z_VEL_P`.
|
||||
If the copter has an unstable position, try to increase the *P* coefficient of speed PID controller - parameters are `MPC_XY_VEL_P` and `MPC_Z_VEL_P`.
|
||||
|
||||
If the copter has an unstable height, try increasing `MPC_Z_VEL_P` coefficient or getting better hover throttle - `MPC_THR_HOVER`.
|
||||
|
||||
@@ -85,6 +85,8 @@ If the copter is consistently yawing, try:
|
||||
* different values for `EKF2_MAG_TYPE` parameter, that indicates how data from the magnetometer is used in EKF2;
|
||||
* changing values of `EKF2_MAG_NOISE`, `EKF2_GYR_NOISE`, `EKF2_GYR_B_NOISE` parameters.
|
||||
|
||||
> **Note** For better results perform gyro calibration directly before taking off, using [appropriate snippet](snippets.md#calibrate-gyro).
|
||||
|
||||
If the copter's height is deviating, try:
|
||||
|
||||
* increasing the value of `MPC_Z_VEL_P` coefficient;
|
||||
|
||||
@@ -6,9 +6,9 @@ Open the *Vehicle Setup* tab and select the *Power* menu.
|
||||
|
||||
> **Note** Power sensor calibration should be done with the battery pack connected to the drone.
|
||||
|
||||
If there is no voltage indicator or manual calibration is not possible, set the average value of the voltage divider for the Clever 4 kit (*Voltage divider* = 11).
|
||||
If there is no voltage indicator or manual calibration is not possible, set the average value of the voltage divider for the Clover 4 kit (*Voltage divider* = 11).
|
||||
|
||||
1. Set the *Number of cells* parameter according to the number of cells in your battery (*3* for the Clever 4 drone).
|
||||
1. Set the *Number of cells* parameter according to the number of cells in your battery (*3* for the Clover 4 drone).
|
||||
2. Calculate the voltage divider:
|
||||
* Measure voltage across the battery (you may use a battery voltage tester for that).
|
||||
* Press the *Calculate* button next to the *Voltage divider* label.
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
<img src="../assets/programming.png" width="250" align="right">
|
||||
|
||||
The Clever platform allows a [Raspberry Pi](raspberry.md) computer to be used for programming autonomous flights. The flight program is typically written using the Python programming language. The program may [receive telemetry data](simple_offboard.md#get_telemetry) (which includes battery data, attitude, position, and other parameters) and send commands like: [fly to a point in space](simple_offboard.md#navigate), [set attitude](simple_offboard.md#set_attitude), [set angular rates](simple_offboard.md#set_rates), and others.
|
||||
The Clover platform allows a [Raspberry Pi](raspberry.md) computer to be used for programming autonomous flights. The flight program is typically written using the Python programming language. The program may [receive telemetry data](simple_offboard.md#get_telemetry) (which includes battery data, attitude, position, and other parameters) and send commands like: [fly to a point in space](simple_offboard.md#navigate), [set attitude](simple_offboard.md#set_attitude), [set angular rates](simple_offboard.md#set_rates), and others.
|
||||
|
||||
The platform utilizes the [ROS framework](ros.md), which allows the user program to communicate with the Clever services that are running as a `clever` systemd daemon. The [MAVROS](mavros.md) package is used to interact with the flight controller.
|
||||
The platform utilizes the [ROS framework](ros.md), which allows the user program to communicate with the Clover services that are running as a `clover` systemd daemon. The [MAVROS](mavros.md) package is used to interact with the flight controller.
|
||||
|
||||
PX4 uses [OFFBOARD mode](modes.md#auto) for autonomous flights. The Clever API can be used to transition the drone to this flight mode automatically. If you need to interrupt the autonomous flight, use your flight mode stick on your RC controller to transition to any other flight mode.
|
||||
PX4 uses [OFFBOARD mode](modes.md#auto) for autonomous flights. The Clover API can be used to transition the drone to this flight mode automatically. If you need to interrupt the autonomous flight, use your flight mode stick on your RC controller to transition to any other flight mode.
|
||||
|
||||
## Positioning system {#positioning}
|
||||
|
||||
A drone has to use a positioning system to be able to hover still or to fly from point to point. The system should compute the drone position and feed this data into the flight controller. Clever allows using multiple positioning systems, such as [optical flow](optical_flow.md) (requires a [camera](camera.md) and a [rangefinder](laser.md)), [fiducial markers](aruco.md) (requires a camera and markers), GPS and others.
|
||||
A drone has to use a positioning system to be able to hover still or to fly from point to point. The system should compute the drone position and feed this data into the flight controller. Clover allows using multiple positioning systems, such as [optical flow](optical_flow.md) (requires a [camera](camera.md) and a [rangefinder](laser.md)), [fiducial markers](aruco.md) (requires a camera and markers), GPS and others.
|
||||
|
||||
### Optical flow
|
||||
|
||||
@@ -44,7 +44,7 @@ Below is a complete flight program that performs a takeoff, flies forward and la
|
||||
#coding: utf8
|
||||
|
||||
import rospy
|
||||
from clever import srv
|
||||
from clover import srv
|
||||
from std_srvs.srv import Trigger
|
||||
|
||||
rospy.init_node('flight')
|
||||
@@ -92,7 +92,7 @@ You can also use the ["Autonomous flight"](simple_offboard.md) article as an API
|
||||
|
||||
## Additional periphery
|
||||
|
||||
The Clever platform also exposes APIs for interacting with other peripherals. Read more in the following articles:
|
||||
The Clover platform also exposes APIs for interacting with other peripherals. Read more in the following articles:
|
||||
|
||||
* [LED strip](leds.md);
|
||||
* [laser rangefinder](laser.md);
|
||||
|
||||
@@ -4,7 +4,7 @@ Main article: https://dev.px4.io/en/advanced/parameter_reference.html
|
||||
|
||||
> **Note** This is a description some of the most important PX4 parameters as of version 1.8.0. The full list is available at the link above.
|
||||
|
||||
To change PX4 parameters, you can use the QGroundControl application [by connecting to Clever via Wi-Fi](gcs_bridge.md):
|
||||
To change PX4 parameters, you can use the QGroundControl application [by connecting to Clover via Wi-Fi](gcs_bridge.md):
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Raspberry Pi
|
||||
============
|
||||
|
||||
**Raspberry Pi** is a single-board computer that fits in the palm, created on the basis of ARM mobile microprocessor. It features low energy consumption, and it can even run on solar panels. Raspberry Pi 3 is included in the kits for programmable quadcopters "Clever".
|
||||
**Raspberry Pi** is a single-board computer that fits in the palm, created on the basis of ARM mobile microprocessor. It features low energy consumption, and it can even run on solar panels. Raspberry Pi 3 is included in the kits for programmable quadcopters "Clover".
|
||||
|
||||
<img src="../assets/raspberry.png" class="center zoom" alt="Raspberry Pi 3" width="400">
|
||||
|
||||
@@ -14,6 +14,6 @@ Technical specifications:
|
||||
* Four USB 2.0 ports.
|
||||
* An HDMI port.
|
||||
|
||||
Raspberry Pi is connected to the flight controller in the Clever kit and is used as a companion computer. It can be used to [connect to the drone over Wi-Fi](wifi.md), perform autonomous flights, access peripherals and much more.
|
||||
Raspberry Pi is connected to the flight controller in the Clover kit and is used as a companion computer. It can be used to [connect to the drone over Wi-Fi](wifi.md), perform autonomous flights, access peripherals and much more.
|
||||
|
||||
**Next**: [Raspberry Pi image](image.md)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
Controlling Clever from a smartphone
|
||||
Controlling Clover from a smartphone
|
||||
===
|
||||
|
||||
<a href="https://itunes.apple.com/ru/app/clever-rc/id1396166572?mt=8"><img src="../assets/appstore.svg"></a><a href="https://play.google.com/store/apps/details?id=express.copter.cleverrc"><img src="../assets/google_play.png" width="15%"></a>
|
||||
|
||||
To control Clever from a smartphone via Wi-Fi, you have to install the appropriate application – [iOS](https://itunes.apple.com/ru/app/clever-rc/id1396166572?mt=8), Android (https://play.google.com/store/apps/details?id=express.copter.cleverrc).
|
||||
To control Clover from a smartphone via Wi-Fi, you have to install the appropriate application – [iOS](https://itunes.apple.com/ru/app/clever-rc/id1396166572?mt=8), Android (https://play.google.com/store/apps/details?id=express.copter.cleverrc).
|
||||
|
||||

|
||||
|
||||
@@ -16,7 +16,7 @@ Configuring
|
||||
|
||||
> **Warning** An open QGroundControl or rviz connection sends large amounts of data over Wi-Fi, which can adversely affect responsiveness of the mobile transmitter. It is recommended not to use these applications together with it.
|
||||
|
||||
Install [Clever image on RPi](image.md). For running the application, settings `rosbridge` and `rc` in the launch file (`~/catkin_ws/src/clever/clever/launch/clever.launch`) should be enabled:
|
||||
Install [Clover image on RPi](image.md). For running the application, settings `rosbridge` and `rc` in the launch file (`~/catkin_ws/src/clover/clover/launch/clover.launch`) should be enabled:
|
||||
|
||||
```xml
|
||||
<arg name="rosbridge" default="true"/>
|
||||
@@ -26,10 +26,10 @@ Install [Clever image on RPi](image.md). For running the application, settings `
|
||||
<arg name="rc" default="true"/>
|
||||
```
|
||||
|
||||
After the launch-file is edited, restart package `clever`:
|
||||
After the launch-file is edited, restart package `clover`:
|
||||
|
||||
```(bash)
|
||||
sudo systemctl restart clever
|
||||
```bash
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
Also make sure that PX4-parameter `COM_RC_IN_MODE` is set to `0` (RC Transmitter).
|
||||
@@ -44,7 +44,7 @@ Additional PX4 parameters:
|
||||
Connection
|
||||
---
|
||||
|
||||
Connect the smartphone to Clever [Wi-Fi](wifi.md) network (`CLEVER-xxxx`). The application should connect to the copter automatically. Upon successful connection, the current [mode](modes.md) and the battery charge level should be displayed.
|
||||
Connect the smartphone to Clover [Wi-Fi](wifi.md) network (`clover-xxxx`). The application should connect to the copter automatically. Upon successful connection, the current [mode](modes.md) and the battery charge level should be displayed.
|
||||
|
||||
The sticks on the screen of the application work just like real sticks. To arm the copter, hold the left stick in the bottom right corner for several seconds. To disarm — in the bottom left corner.
|
||||
|
||||
|
||||
@@ -84,11 +84,11 @@ A service can be assimilated to the a function that can be called from one node,
|
||||
An example ROS service invoking from Python:
|
||||
|
||||
```python
|
||||
from clever.srv import GetTelemetry
|
||||
from clover.srv import GetTelemetry
|
||||
|
||||
# ...
|
||||
|
||||
# Creating a wrapper for the get_telemetry service of the clever package with the GetTelemetry type:
|
||||
# Creating a wrapper for the get_telemetry service of the clover package with the GetTelemetry type:
|
||||
get_telemetry = rospy.ServiceProxy('get_telemetry', srv.GetTelemetry)
|
||||
|
||||
# Invoking the service, and receiving the quadcopter telemetry:
|
||||
@@ -101,7 +101,7 @@ You can also work with the services using the `rosservice` utility. For instance
|
||||
rosservice call /get_telemetry "{frame_id: ''}"
|
||||
```
|
||||
|
||||
More examples of using the services for Clever quadcopter autonomous flights are available in the [documentation for node simple_offboard](simple_offboard.md).
|
||||
More examples of using the services for Clover quadcopter autonomous flights are available in the [documentation for node simple_offboard](simple_offboard.md).
|
||||
|
||||
Working on several PCs
|
||||
---
|
||||
|
||||
@@ -14,13 +14,13 @@ Install package `ros-melodic-desktop-full` or `ros-melodic-desktop` using the [i
|
||||
Start rviz
|
||||
---
|
||||
|
||||
To start еру visualization of the state of Clever in real time, connect to it via Wi-Fi (`CLEVER-xxx`) and run rviz, specifying an appropriate ROS_MASTER_URI:
|
||||
To start еру visualization of the state of Clover in real time, connect to it via Wi-Fi (`clover-xxx`) and run rviz, specifying an appropriate ROS_MASTER_URI:
|
||||
|
||||
```(bash)
|
||||
ROS_MASTER_URI=http://192.168.11.1:11311 rviz
|
||||
```
|
||||
|
||||
If connection is not established, make sure the `.bashrc` of Clever contains line:
|
||||
If connection is not established, make sure the `.bashrc` of Clover contains line:
|
||||
|
||||
```(bash)
|
||||
export ROS_HOSTNAME=`hostname`.local
|
||||
@@ -56,7 +56,7 @@ Starting the rqt toolkit
|
||||
|
||||

|
||||
|
||||
To start rqt for monitoring Clever status, use command:
|
||||
To start rqt for monitoring Clover status, use command:
|
||||
|
||||
```(bash)
|
||||
ROS_MASTER_URI=http://192.168.11.1:11311 rqt
|
||||
|
||||
@@ -7,7 +7,7 @@ It is generally a good idea to perform this check before flight, especially befo
|
||||
In order to run it, enter the following command in [the Raspberry Pi console](ssh.md):
|
||||
|
||||
```(bash)
|
||||
rosrun clever selfcheck.py
|
||||
rosrun clover selfcheck.py
|
||||
```
|
||||
|
||||
<img src="../assets/selfcheck.png">
|
||||
|
||||
@@ -27,7 +27,7 @@ Main article: https://docs.qgroundcontrol.com/en/SetupView/Firmware.html
|
||||
|
||||
> **Note** Do not connect your flight controller prior to flashing.
|
||||
|
||||
We recommend using the modified version of PX4 by CopterExpress for the Clever drone, especially for autonomous flights. Download the latest stable version **<a class="latest-firmware v4" href="https://github.com/CopterExpress/Firmware/releases">from our GitHub</a>**.
|
||||
We recommend using the modified version of PX4 by CopterExpress for the Clover drone, especially for autonomous flights. Download the latest stable version **<a class="latest-firmware v4" href="https://github.com/CopterExpress/Firmware/releases">from our GitHub</a>**.
|
||||
|
||||
Flash the flight controller with this firmware:
|
||||
|
||||
@@ -87,7 +87,7 @@ Press the *Save* button to save the changed value to the flight controller. Chan
|
||||
|
||||
#### Configuring PID regulators
|
||||
|
||||
##### Averaged PID coefficients for the Clever 4 drone
|
||||
##### Averaged PID coefficients for the Clover 4 drone
|
||||
|
||||
* `MC_PITCHRATE_P` = 0.087
|
||||
* `MC_PITCHRATE_I` = 0.037
|
||||
@@ -103,7 +103,7 @@ Press the *Save* button to save the changed value to the flight controller. Chan
|
||||
* `MPC_Z_VEL_P` = 0.24
|
||||
* `MPC_Z_P` = 1.2
|
||||
|
||||
##### Averaged PID coefficients for the Clever 3 drone
|
||||
##### Averaged PID coefficients for the Clover 3 drone
|
||||
|
||||
* `MC_PITCHRATE_P` = 0.145
|
||||
* `MC_PITCHRATE_I` = 0.050
|
||||
|
||||
@@ -86,7 +86,7 @@ After drying, the guard is ready for installation and for the first test flight!
|
||||
|
||||
## First flights
|
||||
|
||||
We have made a guard for the Clever 2 copter, which is a learning aid for quadcopters assembly and setup and is installed on it without modification. The guard weighs 70g more (139 grams) than the standard one, and almost does not affect controllability and flying time.
|
||||
We have made a guard for the Clover 2 copter, which is a learning aid for quadcopters assembly and setup and is installed on it without modification. The guard weighs 70g more (139 grams) than the standard one, and almost does not affect controllability and flying time.
|
||||
|
||||
It should also be said that excessive vibrations, if any, may be removed by more rigid attachment to the copter.
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
Simple OFFBOARD
|
||||
===
|
||||
|
||||
> **Note** The following applies to [image](image.md) versions **0.15** and up. Older documentation is still avaliable [for version **0.14**](https://github.com/CopterExpress/clever/blob/v0.14/docs/ru/simple_offboard.md) (Russian only).
|
||||
> **Note** In the image version **0.20** `clever` package was renamed to `clover`. See [previous version of the article](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/simple_offboard.md) for older images.
|
||||
|
||||
<!-- -->
|
||||
|
||||
> **Hint** We recommend using our [special PX4 firmware for Clever](firmware.md#modified-firmware-for-clever) for autonomous flights.
|
||||
> **Hint** We recommend using our [custom PX4 firmware for Clover](firmware.md#modified-firmware-for-clover) for autonomous flights.
|
||||
|
||||
The `simple_offboard` module of the `clever` package is intended for simplified programming of the autonomous drone flight (`OFFBOARD` [flight mode](modes.md)). It allows setting the desired flight tasks, and automatically transforms [coordinates between frames](frames.md).
|
||||
The `simple_offboard` module of the `clover` package is intended for simplified programming of the autonomous drone flight (`OFFBOARD` [flight mode](modes.md)). It allows setting the desired flight tasks, and automatically transforms [coordinates between frames](frames.md).
|
||||
|
||||
`simple_offboard` is a high level system for interacting with the flight controller. For a more low level system, see [mavros](mavros.md).
|
||||
|
||||
@@ -20,7 +20,7 @@ You need to create proxies for services before calling them. Use the following t
|
||||
|
||||
```python
|
||||
import rospy
|
||||
from clever import srv
|
||||
from clover import srv
|
||||
from std_srvs.srv import Trigger
|
||||
|
||||
rospy.init_node('flight') # 'flight' is name of your ROS node
|
||||
|
||||
@@ -361,4 +361,36 @@ rospy.loginfo('flip')
|
||||
flip()
|
||||
```
|
||||
|
||||
Requires the [special PX4 firmware for Clever](firmware.md#modified-firmware-for-clever). Before running a flip, take all necessary safty precautions.
|
||||
Requires the [special PX4 firmware for Clover](firmware.md#modified-firmware-for-clover). Before running a flip, take all necessary safty precautions.
|
||||
|
||||
### # {#calibrate-gyro}
|
||||
|
||||
Perform gyro calibration:
|
||||
|
||||
```python
|
||||
from pymavlink import mavutil
|
||||
from mavros_msgs.srv import CommandLong
|
||||
from mavros_msgs.msg import State
|
||||
|
||||
# ...
|
||||
|
||||
send_command = rospy.ServiceProxy('/mavros/cmd/command', CommandLong)
|
||||
|
||||
def calibrate_gyro():
|
||||
rospy.loginfo('Calibrate gyro')
|
||||
if not send_command(command=mavutil.mavlink.MAV_CMD_PREFLIGHT_CALIBRATION, param1=1).success:
|
||||
return False
|
||||
|
||||
calibrating = False
|
||||
while not rospy.is_shutdown():
|
||||
state = rospy.wait_for_message('mavros/state', State)
|
||||
if state.system_status == mavutil.mavlink.MAV_STATE_CALIBRATING or state.system_status == mavutil.mavlink.MAV_STATE_UNINIT:
|
||||
calibrating = True
|
||||
elif calibrating and state.system_status == mavutil.mavlink.MAV_STATE_STANDBY:
|
||||
rospy.loginfo('Calibrating finished')
|
||||
return True
|
||||
|
||||
calibrate_gyro()
|
||||
```
|
||||
|
||||
> **Note** In process of calibration the drone should not be moved.
|
||||
|
||||
@@ -24,7 +24,7 @@ Connect HC-SR04 to Raspberry Pi according to the connection diagram. Use 1.0 and
|
||||
|
||||
### Reading the data
|
||||
|
||||
To read the data from distance gage HC-SR04 library for working with <abbr title="General-Purpose Input/Output">GPIO</abbr> is used – [`pigpio`](http://abyz.me.uk/rpi/pigpio/index.html). This library is pre-installed in the [Clever image](image.md), starting with version **v0.14**. For older versions of the image, use [an installation guide](http://abyz.me.uk/rpi/pigpio/download.html).
|
||||
To read the data from distance gage HC-SR04 library for working with <abbr title="General-Purpose Input/Output">GPIO</abbr> is used – [`pigpio`](http://abyz.me.uk/rpi/pigpio/index.html). This library is pre-installed in the [Clover image](image.md), starting with version **v0.14**. For older versions of the image, use [an installation guide](http://abyz.me.uk/rpi/pigpio/download.html).
|
||||
|
||||
To work with `pigpio`, start appropriate daemon:
|
||||
|
||||
|
||||
34
docs/en/trainer_mode.md
Normal file
34
docs/en/trainer_mode.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# FlySky Trainer mode settings
|
||||
|
||||
The trainer mode is used for teaching students how to fly a drone. In trainer mode the experienced pilot is ready to take control of the drone in case of emergency situation during the flight.
|
||||
|
||||
For that we connect two remote controllers. The first controller (Slave) is for a student and the second (Trainer) is for a teacher.
|
||||
|
||||
## Wire pinout
|
||||
|
||||

|
||||
|
||||
To create a link between remote controllers, a connector is used at the back of the case (S-Video). Three contacts in the connector are used for receiving, transmitting information and for ground. The PPM-OUT (transmit) contact must be connected to the PPM-IN (receive) and vice versa. To avoid environmental interference, ground contacts must be interconnected.
|
||||
|
||||
This is how we need to solder the wires to the connector.
|
||||
|
||||

|
||||
|
||||
## Trainer’s settings
|
||||
|
||||
Go to settings (hold OK button). Then to the System setup and look for (Up / Down) Trainer mode.
|
||||
|
||||
To activate mode, the Mode line should be ‘ON’. Use the Up/Down buttons to change the parameter. To save the parameter, click OK.
|
||||
|
||||
Now select the switch for taking the control:
|
||||
|
||||
Do it in the Trainer mode menu. In the Switch line, select (you can change using Up/Down) any convenient switch (SwA, SwB, SwC, SwD). Trainer now will take control of the drone after toggling the switching.
|
||||
|
||||
To save the settings hold Cancel.
|
||||
|
||||
> **Hint** Both teacher’s and student’s remote controllers must be in the same flight mode.
|
||||
|
||||
## Student’s settings
|
||||
|
||||
Go to the settings, System setup and select the student mode (Student mode). Then click OK and use Up\Down to select ‘Yes’.
|
||||
Hold Cancel to save the settings. If everything is configured correctly, the letter S will appear on the main screen.
|
||||
@@ -69,7 +69,7 @@ sudo systemctl disable hciuart.service
|
||||
|
||||
## Default image configuration
|
||||
|
||||
In image CLEVER, we initially disabled Mini UART and the Bluetooth module.
|
||||
In the [Clover image for RPi](image.md), we initially disabled Mini UART and the Bluetooth module.
|
||||
|
||||
Bugs
|
||||
----
|
||||
|
||||
@@ -1,28 +1,12 @@
|
||||
# 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).
|
||||
|
||||
## Viewing in a browser
|
||||
|
||||
### Configuration
|
||||
|
||||
Make sure that in Clever launch-file \(`~/catkin_ws/src/clever/clever/launch/clever.launch`\), starting `web_video_server` is enabled:
|
||||
|
||||
```xml
|
||||
<arg name="web_video_server" default="true"/>
|
||||
```
|
||||
|
||||
After the launch-file is edited, restart package `clever`:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart clever
|
||||
```
|
||||
|
||||
### Viewing
|
||||
|
||||
To view a video-stream, you have to [connect to Wi-Fi](wifi.md) of Clever \(`CLEVER-xxxx`\), navigate to page [http://192.168.11.1:8080/](http://192.168.11.1:8080/), and choose the topic.
|
||||
To view a video-stream, you have to [connect to Wi-Fi network](wifi.md) of the Clover (`clover-xxxx`), navigate to page [http://192.168.11.1:8080/](http://192.168.11.1:8080/), and choose the topic.
|
||||
|
||||

|
||||
|
||||
@@ -38,7 +22,7 @@ Parameters `width`, `height`, etc. re also available. Read more about `web_video
|
||||
|
||||
To browse images with the rqt tools the user needs a computer with Ubuntu 18.04 and [ROS Melodic](http://wiki.ros.org/melodic/Installation/Ubuntu).
|
||||
|
||||
[Connect to the Clever Wi-Fi network](wifi.md) an run `rqt_image_view` with its IP-address:
|
||||
[Connect to the Clover Wi-Fi network](wifi.md) an run `rqt_image_view` with its IP-address:
|
||||
|
||||
```bash
|
||||
ROS_MASTER_URI=http://192.168.11.1:11311 rqt_image_view
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
Connecting to Clever via Wi-Fi
|
||||
Connecting to Clover via Wi-Fi
|
||||
===
|
||||
|
||||
[RPi image](image.md) provides a pre-configured Wi-Fi access point with SSID `CLEVER-xxxx`, where `xxxx` are four random numbers that are assigned when your Raspberry Pi is run for the first time.
|
||||
> **Note** The following applies to [image version](image.md) **0.20** and up. See [previous version of the article](https://github.com/CopterExpress/clover/blob/v0.19/docs/en/wifi.md) for older images.
|
||||
|
||||
Connect to this Wi-Fi using the password `cleverwifi`.
|
||||
[RPi image](image.md) provides a pre-configured Wi-Fi access point with SSID `clover-xxxx`, where `xxxx` are four random numbers that are assigned when your Raspberry Pi is run for the first time.
|
||||
|
||||
Connect to this Wi-Fi using the password `cloverwifi`.
|
||||
|
||||
<img src="../assets/ssid.png" width="300px" alt="Wi-Fi SSID">
|
||||
|
||||
@@ -11,8 +13,8 @@ To edit Wi-Fi settings, or to obtain more detailed information about the network
|
||||
|
||||
## Web interface
|
||||
|
||||
After connecting to Clever Wi-Fi, open http://192.168.11.1 in you web browser. It contains all the basic web tools of Clever: viewing image topics, web terminal (Butterfly), and the full copy of this documentation.
|
||||
After connecting to Clover Wi-Fi, open http://192.168.11.1 in you web browser. It contains all the basic web tools of Clover: viewing image topics, web terminal (Butterfly), and the full copy of this documentation.
|
||||
|
||||
<img src="../assets/web.png" alt="Веб-интерфейс Клевера" class="zoom">
|
||||
<img src="../assets/web.png" alt="Clover Web Interface" class="zoom">
|
||||
|
||||
**Next**: [Connecting Raspberry Pi to the flight controller](connection.md).
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
**«Клевер»** — это учебный конструктор программируемого квадрокоптера, состоящего из популярных открытых компонентов, а также набор необходимой документации и библиотек для работы с ним.
|
||||
|
||||
Набор включает в себя полетный контроллер Pixracer с полетным стеком PX4, [Raspberry Pi 3](raspberry.md) в качестве управляющего бортового компьютера, [модуль камеры](camera.md) для реализации полетов с использованием компьютерного зрения, а также набор различных датчиков и другой периферии.
|
||||
Набор включает в себя полетный контроллер Pixracer с полетным стеком PX4, [Raspberry Pi 4](raspberry.md) в качестве управляющего бортового компьютера, [модуль камеры](camera.md) для реализации полетов с использованием компьютерного зрения, а также набор различных датчиков и другой периферии.
|
||||
|
||||
Платформа Клевера также включает в себя преднастроенный [образ для Raspberry Pi](image.md) в полным набором необходимого ПО для работы со всей периферией и [программирования автономных полетов](simple_offboard.md). Исходный код платформы Клевера и данной документации открыт и [доступен на GitHub](https://github.com/CopterExpress/clever).
|
||||
Платформа Клевера также включает в себя преднастроенный [образ для Raspberry Pi](image.md) в полным набором необходимого ПО для работы со всей периферией и [программирования автономных полетов](simple_offboard.md). Исходный код платформы Клевера и данной документации открыт и [доступен на GitHub](https://github.com/CopterExpress/clover).
|
||||
|
||||
Если вы детально изучили документацию, но так и не нашли ответа на свой вопрос, напишите в чат техподдержки и наши специалисты вам с радостью ответят: [@COEXHelpdesk](tg://resolve?domain=COEXHelpdesk).
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
* [Имя хоста](hostname.md)
|
||||
* [Симулятор](sitl.md)
|
||||
* [Настройка PID](pid_tuning.md)
|
||||
* [Навигация по настенным маркерам](wall_aruco.md)
|
||||
* [CAD-модели Клевера](models.md)
|
||||
* [Docker-контейнер с симулятором](sitl_docker.md)
|
||||
* [Установка ROS Melodic](ros-install.md)
|
||||
@@ -66,11 +67,11 @@
|
||||
* [Использование мультиметра](test_connection.md)
|
||||
* [Неисправности радиоаппаратуры](radioerrors.md)
|
||||
* [Прошивка ESC контроллеров](esc_firmware.md)
|
||||
* [Настройка режима тренера](trainer_mode.md)
|
||||
* [Взаимодействие с Arduino](arduino.md)
|
||||
* [Подключение GPS](gps.md)
|
||||
* [Работа с ИК датчиками](ir_sensors.md)
|
||||
* [Установка FPV](fpv.md)
|
||||
* [Управление в режиме тренера](trainer_mode.md)
|
||||
* [Техника лужения](tinning.md)
|
||||
* [Подключение PX4FLOW](px4flow.md)
|
||||
* [Типы силовых разъемов](connectortypes.md)
|
||||
@@ -79,6 +80,7 @@
|
||||
* [Подключение регулятора 4 в 1](4in1.md)
|
||||
* [Светодиодная лента (legacy)](leds_old.md)
|
||||
* [Вклад в Клевер](contributing.md)
|
||||
* [Переход на версию 0.20](migrate20.md)
|
||||
* Мероприятия
|
||||
* [CopterHack-2019](copterhack2019.md)
|
||||
* [Олимпиада НТИ 2019](nti2019.md)
|
||||
@@ -86,6 +88,8 @@
|
||||
* [CopterHack-2018](copterhack2018.md)
|
||||
* [CopterHack-2017](copterhack2017.md)
|
||||
* Проекты на базе Клевера
|
||||
* [Шоу коптеров](clever-show.md)
|
||||
* [Олимпиада НТИ 2020 (P4DF2)](nti2020_p4df2.md)
|
||||
* [Генератор ArUco карт](arucogenmap.md)
|
||||
* [Модель аэротакси в городе](bigchallenges.md)
|
||||
* [Шаровая защита коптера](shield.md)
|
||||
|
||||
@@ -15,11 +15,11 @@ git clone https://github.com/Tennessium/android
|
||||
|
||||
## Обертка
|
||||
|
||||
Начнем с самого простого - внешнего вида нашего приложения. На [**гитхабе**](https://github.com/CopterExpress/clever/tree/master/apps/android/app/src/main/assets) вы можете найти *HTML*, *CSS* и *JavaScript* файлы, это и есть веб страница с которой будет происходить управление коптером. Чтобы эта страница отображалась у нас в приложении надо:
|
||||
Начнем с самого простого - внешнего вида нашего приложения. На [**гитхабе**](https://github.com/CopterExpress/clover/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)
|
||||
2. Добавить в нее файлы все файлы [отсюда](https://github.com/CopterExpress/clover/tree/master/apps/android/app/src/main/assets)
|
||||
|
||||
Если вы дошли до этого этапа то у вас уже есть необходимая веб страница, поздравляю! Теперь нам надо её как-то отобразить в приложении. Для этого в классе вашего *activity* в методе **onCreate** необходимо написать следующий код:
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ rosrun rosserial_arduino make_libraries.py .
|
||||
|
||||
## Настройка Raspberry Pi
|
||||
|
||||
Для запуска `rosserial` создайте файл `arduino.launch` в каталоге `~/catkin_ws/src/clever/clever/launch/` со следующим содержимым:
|
||||
Для запуска `rosserial` создайте файл `arduino.launch` в каталоге `~/catkin_ws/src/clover/clover/launch/` со следующим содержимым:
|
||||
|
||||
```xml
|
||||
<launch>
|
||||
@@ -31,19 +31,19 @@ rosrun rosserial_arduino make_libraries.py .
|
||||
Чтобы единоразово запустить программу на Arduino, можно будет воспользоваться командой:
|
||||
|
||||
```bash
|
||||
roslaunch clever arduino.launch
|
||||
roslaunch clover arduino.launch
|
||||
```
|
||||
|
||||
Чтобы запускать связку с Arduino при старте системы автоматически, необходимо добавить запуск созданного launch-файла в основной launch-файл Клевера (`~/catkin_ws/src/clever/clever/launch/clever.launch`). Добавьте в конец этого файла строку:
|
||||
Чтобы запускать связку с Arduino при старте системы автоматически, необходимо добавить запуск созданного launch-файла в основной launch-файл Клевера (`~/catkin_ws/src/clover/clover/launch/clover.launch`). Добавьте в конец этого файла строку:
|
||||
|
||||
```xml
|
||||
<include file="$(find clever)/launch/arduino.launch"/>
|
||||
<include file="$(find clover)/launch/arduino.launch"/>
|
||||
```
|
||||
|
||||
При изменении launch-файла необходимо перезапустить пакет `clever`:
|
||||
При изменении launch-файла необходимо перезапустить пакет `clover`:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
## Задержки
|
||||
@@ -79,11 +79,11 @@ for(int i=0; i<8; i++) {
|
||||
// Подключение библиотек для работы с rosseral
|
||||
#include <ros.h>
|
||||
|
||||
// Подключение заголовочных файлов сообщений пакета Clever и MAVROS
|
||||
#include <clever/Navigate.h>
|
||||
// Подключение заголовочных файлов сообщений пакета clover и MAVROS
|
||||
#include <clover/Navigate.h>
|
||||
#include <mavros_msgs/SetMode.h>
|
||||
|
||||
using namespace clever;
|
||||
using namespace clover;
|
||||
using namespace mavros_msgs;
|
||||
|
||||
ros::NodeHandle nh;
|
||||
@@ -184,7 +184,7 @@ void loop()
|
||||
|
||||
// ...
|
||||
|
||||
#include <clever/GetTelemetry.h>
|
||||
#include <clover/GetTelemetry.h>
|
||||
|
||||
// ...
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user