mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-26 11:43:25 +00:00
docs: rename package and service to clover
This commit is contained in:
@@ -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 Clover 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
|
||||
@@ -70,10 +70,10 @@ An example of a program that controls the copter by position using the `navigate
|
||||
#include <ros.h>
|
||||
|
||||
// Connecting Clover and MAVROS package message header files
|
||||
#include <clever/Navigate.h>
|
||||
#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>
|
||||
|
||||
// ...
|
||||
|
||||
|
||||
@@ -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/clover/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,5 +1,7 @@
|
||||
# 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.
|
||||
|
||||
## Raspberry Pi initial setup
|
||||
@@ -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
|
||||
@@ -304,7 +306,7 @@ Perform selfcheck when you have set up your drone or when you have faced problem
|
||||
- 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 Clover 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 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 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:
|
||||
|
||||
@@ -42,4 +42,4 @@ In order to calibrate the camera with the `camera_calibration` ROS-package you n
|
||||
|
||||
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.
|
||||
|
||||
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/clever/clever/camera_info/fisheye_cam_320.yaml`.
|
||||
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`.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -6,7 +6,7 @@ Pixhawk or Pixracer firmware may be flashed using QGroundControl or command line
|
||||
Modified firmware for Clover
|
||||
---
|
||||
|
||||
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 `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>
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ Coordinate systems (frames)
|
||||
|
||||

|
||||
|
||||
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;
|
||||
|
||||
@@ -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 Clover 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 "Clover" 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
|
||||
---
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
# Hostname
|
||||
|
||||
[By default](image.md) the hostname of the Clover 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, Clover is accessible on machines that support mDNS as `clever-xxxx.local`. You can use this name to access Clover 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 Clover web pages in browser, accessing ROS master, etc.
|
||||
|
||||
@@ -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 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 [`clever`](https://github.com/CopterExpress/clover/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,6 +1,6 @@
|
||||
# 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/clover/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
|
||||
|
||||
@@ -10,18 +10,7 @@ The [image for Raspberry Pi](image.md) contains pre-installed corresponding ROS
|
||||
|
||||
### 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"/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 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).
|
||||
|
||||
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.
|
||||
|
||||
@@ -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 }
|
||||
@@ -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"/>
|
||||
|
||||
@@ -12,7 +12,7 @@ The MAVROS node is automatically started in the Clover launch-file. In order to
|
||||
|
||||
<!-- -->
|
||||
|
||||
> **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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -8,7 +8,7 @@ Running the technology "Optical Flow" offers the possibility of POSCTL flight mo
|
||||
|
||||
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`):
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
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 Clover 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 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.
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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 [Clover 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 [Clover 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 Clover [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:
|
||||
|
||||
@@ -14,7 +14,7 @@ Install package `ros-melodic-desktop-full` or `ros-melodic-desktop` using the [i
|
||||
Start rviz
|
||||
---
|
||||
|
||||
To start еру visualization of the state of Clover 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
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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/clover/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 Clover](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,7 +361,7 @@ rospy.loginfo('flip')
|
||||
flip()
|
||||
```
|
||||
|
||||
Requires the [special PX4 firmware for Clover](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}
|
||||
|
||||
|
||||
@@ -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 Clover 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 Clover \(`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.
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
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">
|
||||
|
||||
@@ -13,6 +15,6 @@ To edit Wi-Fi settings, or to obtain more detailed information about the network
|
||||
|
||||
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).
|
||||
|
||||
@@ -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>
|
||||
|
||||
// ...
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
|
||||
## Конфигурирование
|
||||
|
||||
Аргумент `aruco` в файле `~/catkin_ws/src/clever/clever/launch/clever.launch` должен быть в значении `true`:
|
||||
Аргумент `aruco` в файле `~/catkin_ws/src/clover/clover/launch/clover.launch` должен быть в значении `true`:
|
||||
|
||||
```xml
|
||||
<arg name="aruco" default="true"/>
|
||||
```
|
||||
|
||||
Для включения распознавания карт маркеров аргументы `aruco_map` и `aruco_detect` в файле `~/catkin_ws/src/clever/clever/launch/aruco.launch` должны быть в значении `true`:
|
||||
Для включения распознавания карт маркеров аргументы `aruco_map` и `aruco_detect` в файле `~/catkin_ws/src/clover/clover/launch/aruco.launch` должны быть в значении `true`:
|
||||
|
||||
```xml
|
||||
<arg name="aruco_detect" default="true"/>
|
||||
@@ -45,12 +45,12 @@ id_маркера размер_маркера x y z угол_z угол_y уго
|
||||
<param name="map" value="$(find aruco_pose)/map/map.txt"/>
|
||||
```
|
||||
|
||||
Смотрите примеры карт маркеров в каталоге [`~/catkin_ws/src/clever/aruco_pose/map`](https://github.com/CopterExpress/clover/tree/master/aruco_pose/map).
|
||||
Смотрите примеры карт маркеров в каталоге [`~/catkin_ws/src/clover/aruco_pose/map`](https://github.com/CopterExpress/clover/tree/master/aruco_pose/map).
|
||||
|
||||
Файл карты может быть сгенерирован с помощью инструмента `genmap.py`:
|
||||
|
||||
```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` – размер маркера, `x` – количество маркеров по оси *x*, `y` - количество маркеров по оси *y*, `dist_x` – расстояние между центрами маркеров по оси *x*, `y` – расстояние между центрами маркеров по оси *y*, `first` – ID первого (левого нижнего) маркера, `test_map.txt` – название файла с картой. Дополнительный ключ `--bottom-left` позволяет нумеровать маркеры с левого нижнего угла.
|
||||
@@ -58,7 +58,7 @@ rosrun aruco_pose genmap.py length x y dist_x dist_y first > ~/catkin_ws/src/cle
|
||||
Пример:
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
Дополнительную информацию по утилите можно получить по ключу `-h`: `rosrun aruco_pose genmap.py -h`.
|
||||
@@ -154,7 +154,7 @@ navigate(frame_id='aruco_5', x=0, y=0, z=1)
|
||||
|
||||
Для навигации по маркерам, расположенным на потолке, необходимо поставить основную камеру так, чтобы она смотрела вверх и [установить соответствующий фрейм камеры](camera_setup.md#frame).
|
||||
|
||||
Также в файле `~/catkin_ws/src/clever/clever/launch/aruco.launch` необходимо установить параметр `known_tilt` в секциях `aruco_detect` и `aruco_map` в значение `map_flipped`:
|
||||
Также в файле `~/catkin_ws/src/clover/clover/launch/aruco.launch` необходимо установить параметр `known_tilt` в секциях `aruco_detect` и `aruco_map` в значение `map_flipped`:
|
||||
|
||||
```xml
|
||||
<param name="known_tilt" value="map_flipped"/>
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
|
||||
## Настройка
|
||||
|
||||
Аргумент `aruco` в файле `~/catkin_ws/src/clever/clever/launch/clever.launch` должен быть в значении `true`:
|
||||
Аргумент `aruco` в файле `~/catkin_ws/src/clover/clover/launch/clover.launch` должен быть в значении `true`:
|
||||
|
||||
```xml
|
||||
<arg name="aruco" default="true"/>
|
||||
```
|
||||
|
||||
Для включения распознавания маркеров аргумент `aruco_detect` в файле `~/catkin_ws/src/clever/clever/launch/aruco.launch` должен быть в значении `true`:
|
||||
Для включения распознавания маркеров аргумент `aruco_detect` в файле `~/catkin_ws/src/clover/clover/launch/aruco.launch` должен быть в значении `true`:
|
||||
|
||||
```xml
|
||||
<arg name="aruco_detect" default="true"/>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# Пошаговая инструкция по настройке автономного полета Клевера 4
|
||||
|
||||
> **Note** Документация для версий [образа](image.md), начиная с **0.20**. Для более ранних версий см. [документацию для версии **0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/ru/auto_setup.md).
|
||||
|
||||
Данная инструкция содержит ссылки на другие статьи, в которых каждая из затронутых тем разобрана более подробно. Если вы столкнулись с трудностями во время прочтения одной из таких статей, рекомендуется вернуться к данной инструкции, так как здесь многие операции описаны пошагово, а также отсутствуют ненужные шаги.
|
||||
|
||||
## Первоначальная настройка Raspberry Pi
|
||||
@@ -58,7 +60,7 @@ ls
|
||||
Перейти в папку с прописыванием пути к ней:
|
||||
|
||||
```bash
|
||||
cd catkin_ws/src/clever/clever/launch/
|
||||
cd catkin_ws/src/clover/clover/launch/
|
||||
```
|
||||
|
||||
Перейти в домашнюю директорию:
|
||||
@@ -73,10 +75,10 @@ cd
|
||||
nano file.py
|
||||
```
|
||||
|
||||
Открыть файл clever.launch с прописыванием полного пути к нему (сработает, если вы находитесь в другой папке):
|
||||
Открыть файл clover.launch с прописыванием полного пути к нему (сработает, если вы находитесь в другой папке):
|
||||
|
||||
```bash
|
||||
nano ~/catkin_ws/src/clever/clever/launch/clever.launch
|
||||
nano ~/catkin_ws/src/clover/clover/launch/clover.launch
|
||||
```
|
||||
|
||||
Сохранить файл (нажимать последовательно):
|
||||
@@ -106,13 +108,13 @@ sudo reboot
|
||||
Перезапуск только систем Клевера:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
Выполнить самопроверку Клевера:
|
||||
|
||||
```bash
|
||||
rosrun clever selfcheck.py
|
||||
rosrun clover selfcheck.py
|
||||
```
|
||||
|
||||
Остановить программу
|
||||
@@ -130,7 +132,7 @@ python myprogram.py
|
||||
Журнал событий процессов Клевера. Пролистывать список можно нажатием Enter или сочетанием клавиш Ctrl+V (пролистывает быстрее):
|
||||
|
||||
```bash
|
||||
journalctl -u clever
|
||||
journalctl -u clover
|
||||
```
|
||||
|
||||
Открыть файл sudoers от имени администратора (он не откроется без прописывания sudo. Через sudo можно запускать другие команды, если они не открываются без прав администратора):
|
||||
@@ -141,42 +143,42 @@ sudo nano /etc/sudoers
|
||||
|
||||
## Настройка параметров Raspberry Pi для автономного полета
|
||||
|
||||
Большинство параметров, необходимых для полета, хранится в папке `~/catkin_ws/src/clever/clever/launch/`.
|
||||
Большинство параметров, необходимых для полета, хранится в папке `~/catkin_ws/src/clover/clover/launch/`.
|
||||
|
||||
- Зайти в папку:
|
||||
|
||||
```bash
|
||||
cd ~/catkin_ws/src/clever/clever/launch/
|
||||
cd ~/catkin_ws/src/clover/clover/launch/
|
||||
```
|
||||
|
||||
Символ `~` обозначает домашнюю директорию вашего пользователя. Если вы уже находитесь в ней, можно обойтись командой:
|
||||
`cd catkin_ws/src/clever/clever/launch/`
|
||||
`cd catkin_ws/src/clover/clover/launch/`
|
||||
|
||||
> **Hint** Клавишей Tab можно автоматически дополнить названия файлов, папок или команд. Нужно начать вводить желаемое название и нажать Tab. Если не будет конфликтов, название напишется полностью. Например, чтобы быстро ввести путь к папке с настройками, после ввода `cd` можно начать вводить следующую комбинацию клавиш: `c-Tab-s-Tab-c-Tab-c-Tab-l-Tab`. Таким образом можно сэкономить много времени при написании длинной команды, а также избежать возможных ошибок в написании пути.
|
||||
|
||||
- В этой папке необходимо сконфигурировать несколько файлов:
|
||||
|
||||
- `clever.launch`
|
||||
- `clover.launch`
|
||||
- `aruco.launch`
|
||||
- `main_camera.launch`
|
||||
|
||||
- Открыть файл `clever.launch`:
|
||||
- Открыть файл `clover.launch`:
|
||||
|
||||
```bash
|
||||
nano clever.launch
|
||||
nano clover.launch
|
||||
```
|
||||
|
||||
Вы должны находиться в папке, в которой располагается файл. Если вы находитесь в другой папке, файл можно открыть, прописав полный путь к нему:
|
||||
|
||||
```bash
|
||||
nano ~/catkin_ws/src/clever/clever/launch/clever.launch
|
||||
nano ~/catkin_ws/src/clover/clover/launch/clover.launch
|
||||
```
|
||||
|
||||
Если файл одновременно редактируют два пользователя, а также если в прошлый раз закрытие файла произошло некорректно, программа nano не отобразит файл сразу, а попросит дополнительное разрешение. Для этого нужно нажать клавишу Y.
|
||||
|
||||
Если содержимое файла все равно пусто, возможно, вы неверно ввели имя файла. Нужно обращать внимание на расширение и вписывать его полностью. Если вы вписали неверное имя или расширение, программа nano создаст пустой файл с этим названием, что нежелательно. Такой файл следует удалить.
|
||||
|
||||
- В файле clever.launch найти строчку:
|
||||
- В файле clover.launch найти строчку:
|
||||
|
||||
```
|
||||
<arg name="aruco" default="false"/>
|
||||
@@ -214,7 +216,7 @@ sudo nano /etc/sudoers
|
||||
- нумерация идет с верхнего левого угла (ключ `--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
|
||||
```
|
||||
|
||||
В большинстве полей нумерация начинается с нулевой метки. Также в большинстве случаев нумерация начинается с верхнего левого угла, поэтому при генерации очень важно указывать ключ `--top-left`.
|
||||
@@ -264,7 +266,7 @@ sudo nano /etc/sudoers
|
||||
- Перезагрузите модуль Клевер:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
## Настройка полетного контроллера для автономного полета
|
||||
@@ -295,7 +297,7 @@ sudo nano /etc/sudoers
|
||||
- Выполнить команду:
|
||||
|
||||
```bash
|
||||
rosrun clever selfcheck.py
|
||||
rosrun clover selfcheck.py
|
||||
```
|
||||
|
||||
## Написание программы
|
||||
|
||||
@@ -1,36 +1,38 @@
|
||||
Автозапуск ПО
|
||||
===
|
||||
|
||||
> **Note** В версии образа **0.20** пакет и сервис `clever` был переименован в `clover`. Для более ранних версий см. документацию для версии [**0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/ru/autolaunch.md).
|
||||
|
||||
systemd
|
||||
---
|
||||
|
||||
Основная документация: [https://wiki.archlinux.org/index.php/Systemd_(Русский)](https://wiki.archlinux.org/index.php/Systemd_(Русский)).
|
||||
|
||||
Все автоматически стартуемое ПО Клевера запускается в виде systemd-сервиса `clever.service`.
|
||||
Все автоматически стартуемое ПО Клевера запускается в виде systemd-сервиса `clover.service`.
|
||||
|
||||
Сервис может быть перезапущен командой `systemctl`:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
Текстовый вывод ПО можно просмотреть с помощью команды `journalctl`:
|
||||
|
||||
```bash
|
||||
journalctl -u clever
|
||||
journalctl -u clover
|
||||
```
|
||||
|
||||
Для того, запустить ПО Клевера непосредственно в текущей консольной сессии, вы можете использовать `roslaunch`:
|
||||
|
||||
```bash
|
||||
sudo systemctl stop clever
|
||||
roslaunch clever clever.launch
|
||||
sudo systemctl stop clover
|
||||
roslaunch clover clover.launch
|
||||
```
|
||||
|
||||
Вы можете выключить автозапуск ПО Клевера с помощью команды `disable`:
|
||||
|
||||
```bash
|
||||
sudo systemctl disable clever
|
||||
sudo systemctl disable clover
|
||||
```
|
||||
|
||||
roslaunch
|
||||
@@ -38,12 +40,12 @@ roslaunch
|
||||
|
||||
Основная документация: http://wiki.ros.org/roslaunch.
|
||||
|
||||
Список объявленных для запуска нод / программ указывается в файле `/home/pi/catkin_ws/src/clever/clever/launch/clever.launch`.
|
||||
Список объявленных для запуска нод / программ указывается в файле `/home/pi/catkin_ws/src/clover/clover/launch/clover.launch`.
|
||||
|
||||
Вы можете добавить собственную ноду в список автозапускаемых. Для этого разместите ваш запускаемый файл (например, `my_program.py`) в каталог `/home/pi/catkin_ws/src/clever/clever/src`. Затем добавьте запуск вашей ноды в `clever.launch`, например:
|
||||
Вы можете добавить собственную ноду в список автозапускаемых. Для этого разместите ваш запускаемый файл (например, `my_program.py`) в каталог `/home/pi/catkin_ws/src/clover/clover/src`. Затем добавьте запуск вашей ноды в `clover.launch`, например:
|
||||
|
||||
```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"/>
|
||||
```
|
||||
|
||||
Запускаемый файл должен иметь *permission* на запуск:
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# Работа с камерой
|
||||
|
||||
> **Note** В версии образа **0.20** пакет и сервис `clever` был переименован в `clover`. Для более ранних версий см. документацию для версии [**0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/ru/camera.md).
|
||||
|
||||
<!-- TODO: физическое подключение -->
|
||||
|
||||
Для работы с основной камерой необходимо убедиться что она включена в файле `~/catkin_ws/src/clever/clever/launch/clever.launch`:
|
||||
Для работы с основной камерой необходимо убедиться что она включена в файле `~/catkin_ws/src/clover/clover/launch/clover.launch`:
|
||||
|
||||
```xml
|
||||
<arg name="main_camera" default="true"/>
|
||||
@@ -10,10 +12,10 @@
|
||||
|
||||
Также нужно убедиться, что камера [сфокусирована и для нее указано корректное расположение и ориентация](camera_setup.md).
|
||||
|
||||
При изменении launch-файла необходимо перезапустить пакет `clever`:
|
||||
При изменении launch-файла необходимо перезапустить пакет `clover`:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
Для мониторинга изображения с камеры можно использовать [rqt](rviz.md) или [web_video_server](web_video_server.md).
|
||||
@@ -25,7 +27,7 @@ sudo systemctl restart clever
|
||||
Остановите сервисы Клевера:
|
||||
|
||||
```bash
|
||||
sudo systemctl stop clever
|
||||
sudo systemctl stop clover
|
||||
```
|
||||
|
||||
Получите картинку с камеры утилитой `raspistill`:
|
||||
@@ -90,7 +92,7 @@ image_pub.publish(bridge.cv2_to_imgmsg(cv_image, 'bgr8'))
|
||||
|
||||
Получаемые изображения можно просматривать используя [web_video_server](web_video_server.md).
|
||||
|
||||
> **Warning** По умолчанию web_video_server показывает изображения из топиков со сжатием (например, /main_camera/image_raw/compressed). Ноды на Python не публикуют такие топики, поэтому для их просмотра следует добавлять `&type=mjpeg` в адресную стоку страницы web_video_server или изменить параметр `default_stream_type` на `mjpeg` в файле `clever.launch`.
|
||||
> **Warning** По умолчанию web_video_server показывает изображения из топиков со сжатием (например, /main_camera/image_raw/compressed). Ноды на Python не публикуют такие топики, поэтому для их просмотра следует добавлять `&type=mjpeg` в адресную стоку страницы web_video_server или изменить параметр `default_stream_type` на `mjpeg` в файле `clover.launch`.
|
||||
|
||||
#### Получение одного кадра
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ cv2.destroyAllWindows()
|
||||
|
||||

|
||||
|
||||
Нажимаем “Войти”. Переходим в ***/home/pi/catkin_ws/src/clever/clever/camera_info/*** и копируем туда калибровочный .yaml файл:
|
||||
Нажимаем “Войти”. Переходим в ***/home/pi/catkin_ws/src/clover/clover/camera_info/*** и копируем туда калибровочный .yaml файл:
|
||||
|
||||

|
||||
|
||||
@@ -234,7 +234,7 @@ cv2.destroyAllWindows()
|
||||
|
||||

|
||||
|
||||
Войдем под логином ***pi*** и паролем ***raspberry***, перейдем в директорию ***/home/pi/catkin_ws/src/clever/clever/launch*** и начнем редактировать конфигурацию ***main_camera.launch***:
|
||||
Войдем под логином ***pi*** и паролем ***raspberry***, перейдем в директорию ***/home/pi/catkin_ws/src/clover/clover/launch*** и начнем редактировать конфигурацию ***main_camera.launch***:
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -43,4 +43,4 @@
|
||||
Когда калибровка завершится, в терминале вы увидите полученные параметры. В окне отобразится изображение с выправленными искажениями. При успешной калибровке все реальные прямые линии должны остаться прямыми на полученном изображении.
|
||||
|
||||
7. Нажмите *COMMIT*, чтобы сохранить полученные параметры калибровки. Результат будет записан в файл калибровки основной камеры Клевера:
|
||||
`/home/pi/catkin_ws/src/clever/clever/camera_info/fisheye_cam_320.yaml`.
|
||||
`/home/pi/catkin_ws/src/clover/clover/camera_info/fisheye_cam.yaml`.
|
||||
|
||||
@@ -15,7 +15,7 @@ ls
|
||||
Перейти в директорию:
|
||||
|
||||
```bash
|
||||
cd catkin_ws/src/clever/clever/launch/
|
||||
cd catkin_ws/src/clover/clover/launch/
|
||||
```
|
||||
|
||||
Перейти на директорию выше:
|
||||
@@ -65,16 +65,16 @@ sudo reboot
|
||||
Например:
|
||||
|
||||
```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="Редактирование файла в nano" data-action="zoom">
|
||||
2. Отредактируйте файл.
|
||||
3. Для выхода с сохранением нажмите `Ctrl`+`X`, `Y`, `Enter`.
|
||||
4. При изменении .launch-файлов необходимо перезапустить пакет `clever`:
|
||||
4. При изменении .launch-файлов необходимо перезапустить пакет `clover`:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
Для редактирования файлов также можно использовать и другие редакторы, например, **vim**.
|
||||
|
||||
@@ -20,22 +20,24 @@
|
||||
|
||||
## Подключение по UART
|
||||
|
||||
> **Note** В версии образа **0.20** пакет и сервис `clever` был переименован в `clover`. Для более ранних версий см. документацию для версии [**0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/ru/connection.md).
|
||||
|
||||
<!-- TODO схема подключения -->
|
||||
|
||||
Дополнительным способом подключения является подключение подключение по интерфейсу UART.
|
||||
|
||||
1. Подключите Raspberry Pi к полетному контроллеру по UART.
|
||||
2. [Подключитесь в Raspberry Pi по SSH](ssh.md).
|
||||
3. Поменяйте в launch-файле Клевера (`~/catkin_ws/src/clever/clever/launch/clever.launch`) тип подключения на UART:
|
||||
3. Поменяйте в launch-файле Клевера (`~/catkin_ws/src/clover/clover/launch/clover.launch`) тип подключения на UART:
|
||||
|
||||
```xml
|
||||
<arg name="fcu_conn" default="uart"/>
|
||||
```
|
||||
|
||||
При изменении launch-файла необходимо перезапустить пакет `clever`:
|
||||
При изменении launch-файла необходимо перезапустить сервис `clover`:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
> **Hint** Для корректной работы подключения Raspberry Pi и полетного контроллера по UART необходимо установить значение параметра `SYS_COMPANION` на 921600.
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
2. Склонируйте форк на компьютер:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/<USERNAME>/clever.git
|
||||
git clone https://github.com/<USERNAME>/clover.git
|
||||
```
|
||||
|
||||
3. Перейдите в директорию с форком и создайте новую ветку с названием вашей статьи (например `new-article`):
|
||||
|
||||
@@ -6,7 +6,7 @@ Pixhawk или Pixracer можно прошить, используя QGroundCon
|
||||
Прошивка для Клевера
|
||||
---
|
||||
|
||||
Для Клевера рекомендуется использование специальной сборки PX4, которая содержит необходимые исправления и более подходящие параметры по умолчанию. Используйте последний стабильный релиз в [GitHub-репозитории](https://github.com/CopterExpress/Firmware/releases), содержащий слово `clever`, например `v1.8.2-clever.4`.
|
||||
Для Клевера рекомендуется использование специальной сборки PX4, которая содержит необходимые исправления и более подходящие параметры по умолчанию. Используйте последний стабильный релиз в [GitHub-репозитории](https://github.com/CopterExpress/Firmware/releases), содержащий слово `clover`, например `v1.8.2-clover.4`.
|
||||
|
||||
<div id="release" style="display:none">
|
||||
<p>Последний стабильный релиз: <strong><a id="download-latest-release"></a></strong>.</p>
|
||||
@@ -25,8 +25,8 @@ Pixhawk или Pixracer можно прошить, используя QGroundCon
|
||||
// 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;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||

|
||||
|
||||
Основные фреймы в пакете `clever`:
|
||||
Основные фреймы в пакете `clover`:
|
||||
|
||||
* `map` — координаты относительно точки инициализации полетного контроллера: белая сетка на иллюстрации;
|
||||
* `base_link` — координаты относительно квадрокоптера: схематичное изображение квадрокоптера на иллюстрации;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Подключение QGroundControl по Wi-Fi
|
||||
|
||||
Возможны контроль, управление, калибровка и настройка полетного контроллера квадрокоптера с помощью программы QGroundControl по Wi-Fi. Для этого необходимо [подключиться к Wi-Fi](wifi.md) сети `CLEVER-xxxx`.
|
||||
Возможны контроль, управление, калибровка и настройка полетного контроллера квадрокоптера с помощью программы QGroundControl по Wi-Fi. Для этого необходимо [подключиться к Wi-Fi](wifi.md) сети `clover-xxxx`.
|
||||
|
||||
## Подключение
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
|
||||
## UDP
|
||||
|
||||
Также возможна настройка подключения по протоколу UDP. Для выбора различных вариантов подключения по UDP необходимо отредактировать параметр `gcs_bridge` в launch-файле `/home/pi/catkin_ws/src/clever/clever/launch/clever.launch`.
|
||||
Также возможна настройка подключения по протоколу UDP. Для выбора различных вариантов подключения по UDP необходимо отредактировать параметр `gcs_bridge` в launch-файле `/home/pi/catkin_ws/src/clover/clover/launch/clover.launch`.
|
||||
|
||||
После изменения launch-файла необходимо перезагрузить сервис clever:
|
||||
После изменения launch-файла необходимо перезагрузить сервис clover:
|
||||
|
||||
```(bash)
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
## UDP-бридж с автоматическим подключением
|
||||
@@ -40,7 +40,7 @@ sudo systemctl restart clever
|
||||
|
||||

|
||||
|
||||
3. Выберите в списке подключений *CLEVER* и нажмите *Connect*.
|
||||
3. Выберите созданное подключение и нажмите *Connect*.
|
||||
|
||||
## UDP broadcast-бридж
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
# Имя хоста
|
||||
|
||||
[По умолчанию](image.md) на Клевере установлено имя хоста (hostname) `clever-xxxx`, где `xxxx` – случайные цифры. Имя хоста соответствует SSID [точки доступа Wi-Fi](wifi.md).
|
||||
> **Note** Документация для версий [образа](image.md), начиная с **0.20**. Для более ранних версий см. [документацию для версии **0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/ru/hostname.md).
|
||||
|
||||
Таким образом, Клевер доступен на машинах, поддерживающих mDNS, под именем `clever-xxxx.local`. Вы можете использовать это имя для SSH-доступа на Клевер:
|
||||
[По умолчанию](image.md) на Клевере установлено имя хоста (hostname) `clover-xxxx`, где `xxxx` – случайные цифры. Имя хоста соответствует SSID [точки доступа Wi-Fi](wifi.md).
|
||||
|
||||
Таким образом, Клевер доступен на машинах, поддерживающих mDNS, под именем `clover-xxxx.local`. Вы можете использовать это имя для SSH-доступа на Клевер:
|
||||
|
||||
```bash
|
||||
ssh pi@clever-xxxx.local
|
||||
ssh pi@clover-xxxx.local
|
||||
```
|
||||
|
||||
Также это имя может быть использовано вместо IP-адреса для открытия страницы Клевера в браузере и т. д.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Автоматическая сборка и модификация образа Клевера
|
||||
|
||||
Иногда возникает необходимость в сборке модифицированного образа системы, например для [своего проекта](https://github.com/artem30801/CleverSwarm) на базе [Клевера](https://github.com/copterexpress/clover). За основу можно взять, например, чистый образ Raspbian Stretch и модифицировать его с нуля, пройдя те же этапы, через который проходит сборка образа Клевера, добавив свои модификации. Однако на данный момент времени сборка образа Клевера занимает [чуть больше часа](https://travis-ci.org/CopterExpress/clever), что превышает ограничения бесплатной сборки в Travis \(50 минут\). Соответственно для проектов на базе Клевера имеет смысл брать за основу уже готовый образ и кастомизировать его. Концепция и основные этапы для автоматизированной сборки изложены ниже.
|
||||
Иногда возникает необходимость в сборке модифицированного образа системы, например для [своего проекта](https://github.com/artem30801/CleverSwarm) на базе [Клевера](https://github.com/copterexpress/clover). За основу можно взять, например, чистый образ Raspbian Stretch и модифицировать его с нуля, пройдя те же этапы, через который проходит сборка образа Клевера, добавив свои модификации. Однако на данный момент времени сборка образа Клевера занимает [чуть больше часа](https://travis-ci.org/CopterExpress/clover), что превышает ограничения бесплатной сборки в Travis \(50 минут\). Соответственно для проектов на базе Клевера имеет смысл брать за основу уже готовый образ и кастомизировать его. Концепция и основные этапы для автоматизированной сборки изложены ниже.
|
||||
|
||||
## Концепция
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ cd ~/catkin_ws
|
||||
catkin_make
|
||||
```
|
||||
|
||||
> **Hint** При подключении полётных контроллеров на базе PX4 через USB следует также добавить правила udev в систему. Скопируйте [файл с правилами](https://github.com/CopterExpress/clover/blob/master/clever/config/99-px4fmu.rules) в `/etc/udev/rules.d` и выполните команду `sudo udevadm control --reload-rules && sudo udevadm trigger`.
|
||||
> **Hint** При подключении полётных контроллеров на базе PX4 через USB следует также добавить правила udev в систему. Скопируйте [файл с правилами](https://github.com/CopterExpress/clover/blob/master/clover/config/99-px4fmu.rules) в `/etc/udev/rules.d` и выполните команду `sudo udevadm control --reload-rules && sudo udevadm trigger`.
|
||||
|
||||
### Запуск Клеверных нод
|
||||
|
||||
@@ -124,10 +124,10 @@ source devel/setup.bash
|
||||
Поменяйте launch-файлы так, чтобы это соответствовало вашей конфигурации, и запустите ноды с помощью `roslaunch`:
|
||||
|
||||
```bash
|
||||
roslaunch clever clever.launch
|
||||
roslaunch clover clover.launch
|
||||
```
|
||||
|
||||
> **Hint** Вы можете настроить `systemd` так, чтобы ноды Клевера запускались автоматически. Примером такой настройки может служить образ Клевера для Raspberry Pi: там созданы сервисы [`roscore`](https://github.com/CopterExpress/clover/blob/master/builder/assets/roscore.service) и [`clever`](https://github.com/CopterExpress/clover/blob/master/builder/assets/clever.service). Их можно подкорректировать и использовать в Jetson Nano.
|
||||
> **Hint** Вы можете настроить `systemd` так, чтобы ноды Клевера запускались автоматически. Примером такой настройки может служить образ Клевера для Raspberry Pi: там созданы сервисы [`roscore`](https://github.com/CopterExpress/clover/blob/master/builder/assets/roscore.service) и [`clover`](https://github.com/CopterExpress/clover/blob/master/builder/assets/clover.service). Их можно подкорректировать и использовать в Jetson Nano.
|
||||
|
||||
## Возможные проблемы
|
||||
|
||||
|
||||
@@ -10,18 +10,7 @@
|
||||
|
||||
### Подключение к Raspberry Pi
|
||||
|
||||
> **Note** Для корректной работы лазерного дальномера с полетным контроллером необходима <a id="download-firmware" href="https://github.com/CopterExpress/Firmware/releases">кастомная прошивка PX4</a>. Подробнее про прошивку см. [соответствующую статью](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** Для корректной работы лазерного дальномера с полетным контроллером рекомендуется использование [специальной сборки PX4 для Клевера](firmware.md#прошивка-для-клевера).
|
||||
|
||||
Подключите дальномер по интерфейсу I²C к пинам 3V, GND, SCL и SDA:
|
||||
|
||||
@@ -33,7 +22,7 @@
|
||||
|
||||
### Включение
|
||||
|
||||
[Подключитесь по SSH](ssh.md) и отредактируйте файл `~/catkin_ws/src/clever/clever/launch/clever.launch` так, чтобы драйвер VL53L1X был включен:
|
||||
[Подключитесь по SSH](ssh.md) и отредактируйте файл `~/catkin_ws/src/clover/clover/launch/clover.launch` так, чтобы драйвер VL53L1X был включен:
|
||||
|
||||
```xml
|
||||
<arg name="rangefinder_vl53l1x" default="true"/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Работа со светодиодной лентой
|
||||
|
||||
> **Note** Документация для версии образа, начиная с 0.18. Для более ранних версий см. [предыдущую версию статьи](leds_old.md).
|
||||
> **Note** Документация для версий [образа](image.md), начиная с **0.20**. Для более ранних версий см. [документацию для версии **0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/ru/leds.md).
|
||||
|
||||
Адресуемая RGB-светодиодная лента типа *ws281x*, которая входит в наборы "Клевер", позволяет выставлять произвольные 24-битные цвета на каждый из отдельных светодиодов. Это позволяет сделать полет Клевера более ярким, а также визуально получать информацию о полетных режимах, этапе выполнения пользовательской программы и других событиях.
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
## Высокоуровневое управление лентой
|
||||
|
||||
1. Для работы с лентой подключите ее к питанию +5v – 5v, земле GND – GND и сигнальному порту DIN – GPIO21. Обратитесь [к инструкции по сборке](assemble_4.md#Подключение-светодиодной-ленты-к-Raspberry-Pi) для подробностей.
|
||||
2. Включите поддержку LED-ленты в файле `~/catkin_ws/src/clever/clever/launch/clever.launch`:
|
||||
2. Включите поддержку LED-ленты в файле `~/catkin_ws/src/clover/clover/launch/clover.launch`:
|
||||
|
||||
```xml
|
||||
<arg name="led" default="true"/>
|
||||
```
|
||||
|
||||
3. Настройте параметры подключения ленты *ws281x* в файле `~/catkin_ws/src/clever/clever/launch/led.launch`. Необходимо ввести верное количество светодиодов в ленте и GPIO-пин, использованный для подключения (если он отличается от *GPIO21*):
|
||||
3. Настройте параметры подключения ленты *ws281x* в файле `~/catkin_ws/src/clover/clover/launch/led.launch`. Необходимо ввести верное количество светодиодов в ленте и GPIO-пин, использованный для подключения (если он отличается от *GPIO21*):
|
||||
|
||||
```xml
|
||||
<param name="led_count" value="30"/> <!-- количество светодиодов в ленте -->
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
```python
|
||||
import rospy
|
||||
from clever.srv import SetLEDEffect
|
||||
from clover.srv import SetLEDEffect
|
||||
|
||||
# ...
|
||||
|
||||
@@ -88,7 +88,7 @@ rosservice call /led/set_effect "{effect: 'rainbow'}"
|
||||
|
||||
## Настройка реакции ленты на события
|
||||
|
||||
Клевер умеет показывать LED-лентой текущее состояние полетного контроллера и сигнализировать о событиях. Данная функция настраивается в файле `~/catkin_ws/src/clever/clever/launch/led.launch` в разделе *events effects table*. Пример настройки:
|
||||
Клевер умеет показывать LED-лентой текущее состояние полетного контроллера и сигнализировать о событиях. Данная функция настраивается в файле `~/catkin_ws/src/clover/clover/launch/led.launch` в разделе *events effects table*. Пример настройки:
|
||||
|
||||
```xml
|
||||
startup: { r: 255, g: 255, b: 255 }
|
||||
@@ -110,7 +110,7 @@ disconnected: { effect: blink, r: 255, g: 50, b: 50 }
|
||||
|
||||
> **Note** Для корректной работы сигнализации LED-лентой о низком заряде батареи необходимо корректная [калибровка электропитания](power.md#Калибровка-делителя-напряжения).
|
||||
|
||||
Для того, чтобы отключить реакцию светодиодной ленты на события, установите аргумент `led_notify` в файле `~/catkin_ws/src/clever/clever/launch/led.launch` в значение `false`:
|
||||
Для того, чтобы отключить реакцию светодиодной ленты на события, установите аргумент `led_notify` в файле `~/catkin_ws/src/clover/clover/launch/led.launch` в значение `false`:
|
||||
|
||||
```xml
|
||||
<arg name="led_notify" default="false"/>
|
||||
|
||||
@@ -12,7 +12,7 @@ MAVROS подписывается на определенные ROS-топики
|
||||
|
||||
<!-- -->
|
||||
|
||||
> **Note** В пакете `clever` некоторые плагины MAVROS отключены (в целях сохранения ресурсов). Подробнее см. параметр `plugin_blacklist` в файле `/home/pi/catkin_ws/src/clever/clever/launch/mavros.launch`.
|
||||
> **Note** В пакете `clover` некоторые плагины MAVROS отключены (в целях сохранения ресурсов). Подробнее см. параметр `plugin_blacklist` в файле `/home/pi/catkin_ws/src/clover/clover/launch/mavros.launch`.
|
||||
|
||||
## Основные сервисы
|
||||
|
||||
|
||||
@@ -400,7 +400,7 @@
|
||||
| -- |:---------------------------------| :----------------------------------|
|
||||
| 1 | Введение | Поприветствовать учеников. Провести опрос или тестирование по пройденным темам. Сформулировать тему и цель урока. Сделать упор на то, что на занятии будет решаться задача написания программы для настоящего автономного полета. |
|
||||
| 2 | Системы координат | Рассказать про локальную и глобальную систему координат. Объяснить почему ориентации по локальной системе координат недостаточно. Рассказать о дополнительных системах координат, которые появляются благодаря получению дополнительной информации с камеры и внешних датчиков. |
|
||||
| 3 | Включение и использование камеры | Необходимо попросить учащихся убедиться, что в launch-файле Клевера (~/catkin_ws/src/clever/clever/clever.launch) включен запуск aruco_pose и нижней камеры для компьютерного зрения: <arg name="bottom_camera" default="true"/> <arg name="aruco" default="true"/> При изменении launch-файла необходимо перезапустить пакет clever: sudo systemctl restart clever Проверить видео, полученное с камеры перейдя по адресу http://192.168.11.1:8080/. |
|
||||
| 3 | Включение и использование камеры | Необходимо попросить учащихся убедиться, что в launch-файле Клевера (~/catkin_ws/src/clover/clover/clover.launch) включен запуск aruco_pose и нижней камеры для компьютерного зрения: <arg name="bottom_camera" default="true"/> <arg name="aruco" default="true"/> При изменении launch-файла необходимо перезапустить пакет clover: sudo systemctl restart clover Проверить видео, полученное с камеры перейдя по адресу http://192.168.11.1:8080/. |
|
||||
| 4 | Распознавание меток | Рассказать каким образом распознаются метки и как они образуют систему координат. Спросить у учащихся есть ли вопросы на текущий момент. |
|
||||
| 5 | Программирование и автономный полет | Предложить учащимся написать программу для взлета над меткой и посадки на нее. Рассказать о структуре программы, которая может выполнить эту задачу и привести пример кода с использованием функций: ● navigate, ● set_position ● set_velocity. Проверить и скорректировать программы, написанные учащимися. Рассказать, каким образом осуществляется перехват коптера в ручное управление. Протестировать написанные программы. |
|
||||
| 6 | Заключение | Подвести итоги занятия, спросить, есть ли у класса вопросы, их должно быть много, нужно заранее продумать ответы на них. Попросить учеников ответить на контрольные вопросы. Предложить ученикам по желанию провести в интернете дополнительное исследование на пройденную тему. Сообщить ученикам, какую тему они будут проходить на следующем занятии. |
|
||||
|
||||
@@ -20,7 +20,7 @@ Wi-Fi адаптер на Raspberry Pi имеет два основных реж
|
||||
```txt
|
||||
network={
|
||||
ssid="my-super-ssid"
|
||||
psk="cleverwifi123"
|
||||
psk="cloverwifi123"
|
||||
mode=2
|
||||
proto=RSN
|
||||
key_mgmt=WPA-PSK
|
||||
@@ -90,8 +90,8 @@ Wi-Fi адаптер на Raspberry Pi имеет два основных реж
|
||||
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 @@ Wi-Fi адаптер на Raspberry Pi имеет два основных реж
|
||||
}
|
||||
```
|
||||
|
||||
где `CLEVER-1234` – название сети, а `cleverwifi` – пароль.
|
||||
где `clover-1234` – название сети, а `cloverwifi` – пароль.
|
||||
|
||||
3. Включите службу `dnsmasq`.
|
||||
|
||||
@@ -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
|
||||
# Вызов 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
|
||||
|
||||
# Подробнее о 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
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
Необходимо использование дальномера. [Подключите и настройте дальномер VL53L1X](laser.md), используя инструкцию.
|
||||
|
||||
Включите Optical Flow в файле `~/catkin_ws/src/clever/clever/launch/clever.launch`:
|
||||
Включите Optical Flow в файле `~/catkin_ws/src/clover/clover/launch/clover.launch`:
|
||||
|
||||
```xml
|
||||
<arg name="optical_flow" default="true"/>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
Платформа Клевера позволяет использовать [Raspberry Pi](raspberry.md) для того, чтобы запрограммировать автономный полет дрона. Чаще всего программа для автономного полета пишется на языке Python. Программа может [получать телеметрию](simple_offboard.md#get_telemetry) (заряд батареи, ориентацию, расположение и т. д.) и отправлять команды: [полететь в точку](simple_offboard.md#navigate), [установить ориентацию](simple_offboard.md#set_attitude), [угловую скорость](simple_offboard.md#set_rates) и т. д.
|
||||
|
||||
Платформа основывается на [фреймворке ROS](ros.md), который обеспечивает связь между пользовательской программой и сервисами Клевера, которые запущены в фоне в виде systemd-демона `clever`. Для связи с полетным контроллером используется пакет [MAVROS](mavros.md).
|
||||
Платформа основывается на [фреймворке ROS](ros.md), который обеспечивает связь между пользовательской программой и сервисами Клевера, которые запущены в фоне в виде systemd-демона `clover`. Для связи с полетным контроллером используется пакет [MAVROS](mavros.md).
|
||||
|
||||
Для автономного полета в PX4 используется [режим OFFBOARD](modes.md#auto). API Клевера переводит дрон в этом режим автоматически. В случае необходимости прерывания автономного полета, необходимо перевести дрон в любой другой режим, используя стик переключения режимов на пульте.
|
||||
|
||||
@@ -44,7 +44,7 @@ python flight.py
|
||||
# coding: utf8
|
||||
|
||||
import rospy
|
||||
from clever import srv
|
||||
from clover import srv
|
||||
from std_srvs.srv import Trigger
|
||||
|
||||
rospy.init_node('flight')
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
> **Warning** Открытое соединение QGroundControl или rviz пересылает большие объемы данных по Wi-Fi, что может негативно сказаться на отзывчивости мобильного пульта. Рекомендуется не использовать эти приложения одновременно с ним.
|
||||
|
||||
Установите [образ Clover на RPi](image.md). Для работы приложения параметры `rosbridge` и `rc` в launch-файле (`~/catkin_ws/src/clever/clever/launch/clever.launch`) должны быть включены:
|
||||
Установите [образ Clover на RPi](image.md). Для работы приложения параметры `rosbridge` и `rc` в launch-файле (`~/catkin_ws/src/clover/clover/launch/clover.launch`) должны быть включены:
|
||||
|
||||
```xml
|
||||
<arg name="rosbridge" default="true"/>
|
||||
@@ -26,10 +26,10 @@
|
||||
<arg name="rc" default="true"/>
|
||||
```
|
||||
|
||||
При изменении launch-файла необходимо перезапустить пакет `clever`:
|
||||
При изменении launch-файла необходимо перезапустить пакет `clover`:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart clever
|
||||
sudo systemctl restart clover
|
||||
```
|
||||
|
||||
Также необходимо убедиться, что PX4-параметр `COM_RC_IN_MODE` установлен в значение `0` (RC Transmitter).
|
||||
@@ -44,7 +44,7 @@ sudo systemctl restart clever
|
||||
Подключение
|
||||
---
|
||||
|
||||
Подключите смартфон к [Wi-Fi](wifi.md) сети Клевера (`CLEVER-xxxx`). Приложение должно подключиться с коптеру автоматически. При успешном подключении должны отобразиться текущий [режим](modes.md) и заряд батареи.
|
||||
Подключите смартфон к [Wi-Fi](wifi.md) сети Клевера (`clover-xxxx`). Приложение должно подключиться с коптеру автоматически. При успешном подключении должны отобразиться текущий [режим](modes.md) и заряд батареи.
|
||||
|
||||
Стики на экране приложения работают так же, как и реальные стики. Для арма коптера подержите левый стик в правом нижнем углу на протяжении нескольких секунд. Для дизарма – в левом нижнем углу.
|
||||
|
||||
|
||||
@@ -84,11 +84,11 @@ rostopic echo /mavros/state
|
||||
Пример вызова ROS-сервиса из языка Python:
|
||||
|
||||
```python
|
||||
from clever.srv import GetTelemetry
|
||||
from clover.srv import GetTelemetry
|
||||
|
||||
# ...
|
||||
|
||||
# Создаем обертку над сервисом get_telemetry пакета clever с типом GetTelemetry:
|
||||
# Создаем обертку над сервисом get_telemetry пакета clover с типом GetTelemetry:
|
||||
get_telemetry = rospy.ServiceProxy('get_telemetry', srv.GetTelemetry)
|
||||
|
||||
# Вызываем сервис и получаем телеметрию квадрокоптера:
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
Запуск rviz
|
||||
---
|
||||
|
||||
Для запуска визуализация состояния Клевера в реальном времени, необходимо подключиться к нему по Wi-Fi (`CLEVER-xxx`) и запустить rviz, указав соответствующий ROS_MASTER_URI:
|
||||
Для запуска визуализация состояния Клевера в реальном времени, необходимо подключиться к нему по Wi-Fi (`clover-xxx`) и запустить rviz, указав соответствующий ROS_MASTER_URI:
|
||||
|
||||
```bash
|
||||
ROS_MASTER_URI=http://192.168.11.1:11311 rviz
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
Для запуска наберите в [консоли Raspberry Pi](ssh.md):
|
||||
|
||||
```bash
|
||||
rosrun clever selfcheck.py
|
||||
rosrun clover selfcheck.py
|
||||
```
|
||||
|
||||
<img src="../assets/selfcheck.png">
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
Автономный полет (OFFBOARD)
|
||||
===
|
||||
|
||||
> **Note** Документация для версий [образа](image.md), начиная с **0.15**. Для более ранних версий см. [документацию для версии **0.14**](https://github.com/CopterExpress/clover/blob/v0.14/docs/ru/simple_offboard.md).
|
||||
> **Note** В версии образа **0.20** пакет `clever` был переименован в `clover`. Для более ранних версий см. документацию для версии [**0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/ru/simple_offboard.md).
|
||||
|
||||
<!-- -->
|
||||
|
||||
> **Hint** Для автономных полетов рекомендуется использование [специальной сборки PX4 для Клевера](firmware.md#прошивка-для-клевера).
|
||||
|
||||
Модуль `simple_offboard` пакета `clever` предназначен для упрощенного программирования автономного полета дрона ([режим](modes.md) `OFFBOARD`). Он позволяет устанавливать желаемые полетные задачи и автоматически трансформирует [систему координат](frames.md).
|
||||
Модуль `simple_offboard` пакета `clover` предназначен для упрощенного программирования автономного полета дрона ([режим](modes.md) `OFFBOARD`). Он позволяет устанавливать желаемые полетные задачи и автоматически трансформирует [систему координат](frames.md).
|
||||
|
||||
`simple_offboard` является высокоуровневым способом взаимодействия с полетным контроллером. Для более низкоуровневой работы см. [mavros](mavros.md).
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
```python
|
||||
import rospy
|
||||
from clever import srv
|
||||
from clover import srv
|
||||
from std_srvs.srv import Trigger
|
||||
|
||||
rospy.init_node('flight')
|
||||
|
||||
@@ -194,11 +194,11 @@ rosdep install -y --from-paths src --ignore-src -r
|
||||
catkin_make
|
||||
```
|
||||
|
||||
Если сборка прошла успешно то вы можете запустить ноду клевера и пользоваться пакетом `Clover` точно так же, как и на реальном коптере:
|
||||
Если сборка прошла успешно то вы можете запустить ноду клевера и пользоваться пакетом `clover` точно так же, как и на реальном коптере:
|
||||
|
||||
```bash
|
||||
. devel/setup.bash
|
||||
roslaunch clever sitl.launch
|
||||
roslaunch clover sitl.launch
|
||||
```
|
||||
|
||||
Для того, чтобы воспользоваться функциями предоставляемыми нашим пакетом, в новом окне терминала подтяните зависимости из файла `setup`:
|
||||
|
||||
@@ -16,19 +16,19 @@
|
||||
|
||||
## Настройка расположения камеры
|
||||
|
||||
Чтобы установить расположение камеры под необходимым углом, откройте файл `main_camera.launch`, расположенный в *~/catkin_ws/src/clever/clover/launch/*.
|
||||
Чтобы установить расположение камеры под необходимым углом, откройте файл `main_camera.launch`, расположенный в `~/catkin_ws/src/clover/clover/launch/`.
|
||||
|
||||
```bash
|
||||
nano ~/catkin_ws/src/clever/clover/launch/main_camera.launch
|
||||
nano ~/catkin_ws/src/clover/clover/launch/main_camera.launch
|
||||
```
|
||||
|
||||
### Версии 0.20>
|
||||
|
||||
В параметрах *direction_x*, *direction_y*, установите пустые значения вручную или введите строки:
|
||||
В параметрах `direction_x`, `direction_y`, установите пустые значения вручную или введите строки:
|
||||
|
||||
```bash
|
||||
sed -i "/direction_z/s/default=\".*\"/default=\"\"/" /home/pi/catkin_ws/src/clever/clover/launch/main_camera.launch
|
||||
sed -i "/direction_y/s/default=\".*\"/default=\"\"/" /home/pi/catkin_ws/src/clever/clover/launch/main_camera.launch
|
||||
sed -i "/direction_z/s/default=\".*\"/default=\"\"/" /home/pi/catkin_ws/src/clover/clover/launch/main_camera.launch
|
||||
sed -i "/direction_y/s/default=\".*\"/default=\"\"/" /home/pi/catkin_ws/src/clover/clover/launch/main_camera.launch
|
||||
```
|
||||
|
||||
Отредактируйте одну из конфигурационных строк или добавьте строку представленную ниже:
|
||||
@@ -39,7 +39,7 @@ sed -i "/direction_y/s/default=\".*\"/default=\"\"/" /home/pi/catkin_ws/src/clev
|
||||
|
||||
> **Note** Единовременно может использоваться только одна конфигурация камеры, если вы вставляете представленную выше строку, не забудьте закомментировать активную на данный момент. Для определения этого, вам поможет подсветка синтаксиса, используемая строка будет подсвечена другим цветом, нежели комментарии. Для комментирования в начало и конец строки добавьте символы *<!-- и -->* соответственно.
|
||||
|
||||
Если используемая вами карта маркеров имеет равномерные расстояния между ними, можете воспользоваться [утилитой для создания карт *gen_map.py*](aruco_map.md#настройка-карты-маркеров). В случае если ваши маркеры расположены в случайном порядке вам потребуется задать их вручную, для этого перейдите в директорию *~/catkin_ws/src/clever/aruco_map/map* и создайте файл карты *map_name.txt*. Заполните вашу карту в соответствии с [синтаксисом карт](aruco_map.md#настройка-карты-маркеров). Пример карты маркеров со случайным расположением маркеров:
|
||||
Если используемая вами карта маркеров имеет равномерные расстояния между ними, можете воспользоваться [утилитой для создания карт `gen_map.py`](aruco_map.md#настройка-карты-маркеров). В случае если ваши маркеры расположены в случайном порядке вам потребуется задать их вручную, для этого перейдите в директорию `~/catkin_ws/src/clover/aruco_map/map` и создайте файл карты `map_name.txt`. Заполните вашу карту в соответствии с [синтаксисом карт](aruco_map.md#настройка-карты-маркеров). Пример карты маркеров со случайным расположением маркеров:
|
||||
|
||||
> **Hint** При введении карты, выберите один из маркеров, как начало координат, и относительно него отмеряйте расстояние до всех остальных маркеров. Вы можете не указывать все 8 параметров, в случае если все ваши маркеры ориентированы одинаково, можно указывать только первые 5: индекс маркера, размер и его расположение в пространстве по осям x, y, z соответственно.
|
||||
|
||||
@@ -49,12 +49,12 @@ sed -i "/direction_y/s/default=\".*\"/default=\"\"/" /home/pi/catkin_ws/src/clev
|
||||
153 0.40 -0.56 1.36 0
|
||||
```
|
||||
|
||||
После того, как карта введена, необходимо применить ее, для этого отредактируйте файл `aruco.launch`, расположенный в *~/catkin_ws/src/clever/clever/launch/*. Измените в нем строку `<param name="map" value="$(find aruco_pose)/map/map_name.txt"/>`, где `map_name.txt` название вашего файла с картой.
|
||||
После того, как карта введена, необходимо применить ее, для этого отредактируйте файл `aruco.launch`, расположенный в `~/catkin_ws/src/clover/clover/launch/`. Измените в нем строку `<param name="map" value="$(find aruco_pose)/map/map_name.txt"/>`, где `map_name.txt` название вашего файла с картой.
|
||||
|
||||
При использовании маркеров не привязанных к горизонтальным плоскостям(пол, потолок), необходимо отключить параметр `known_tilt`, как в модуле `aruco_detect`, так и в модуле `aruco_map` в том же файле. Для того, чтобы сделать это автоматически, введите:
|
||||
|
||||
```bash
|
||||
sed -i "/known_tilt/s/value=\".*\"/value=\"\"/" /home/pi/catkin_ws/src/clever/clever/launch/aruco.launch
|
||||
sed -i "/known_tilt/s/value=\".*\"/value=\"\"/" /home/pi/catkin_ws/src/clover/clover/launch/aruco.launch
|
||||
```
|
||||
|
||||
После всех настроек вызовите `sudo systemctl restart clover` для перезагрузки сервиса *clover*.
|
||||
После всех настроек вызовите `sudo systemctl restart clover` для перезагрузки сервиса `clover`.
|
||||
|
||||
@@ -1,28 +1,12 @@
|
||||
# Просмотр изображений с камер
|
||||
|
||||
Для просмотра изображений с камер (или других ROS-топиков) можно воспользоваться [rviz](rviz.md), rqt, или смотреть их через браузер, используя web\_video\_server.
|
||||
Для просмотра изображений с камер (или других ROS-топиков) можно воспользоваться [rviz](rviz.md), rqt, или смотреть их через браузер, используя web_video_server.
|
||||
|
||||
См. подробнее про [использование rqt](rviz.md).
|
||||
|
||||
## Просмотр через браузер
|
||||
|
||||
### Настройка
|
||||
|
||||
Необходимо убедиться, что в launch-файле Клевера \(`~/catkin_ws/src/clever/clever/launch/clever.launch`\) включен запуск `web_video_server`:
|
||||
|
||||
```xml
|
||||
<arg name="web_video_server" default="true"/>
|
||||
```
|
||||
|
||||
При изменении launch-файла необходимо перезапустить пакет `clever`:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart clever
|
||||
```
|
||||
|
||||
### Просмотр
|
||||
|
||||
Для просмотра видеострима нужно [подключиться к Wi-Fi](wifi.md) Клевера \(`CLEVER-xxxx`\), перейти на страницу [http://192.168.11.1:8080/](http://192.168.11.1:8080/) и выбрать топик.
|
||||
Для просмотра видеострима нужно [подключиться к Wi-Fi](wifi.md) Клевера \(`clover-xxxx`\), перейти на страницу [http://192.168.11.1:8080/](http://192.168.11.1:8080/) и выбрать топик.
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# Подключение к Клеверу по Wi-Fi
|
||||
|
||||
На [образе для RPi](image.md) преднастроена раздача Wi-Fi с SSID `CLEVER-xxxx`, где xxxx – 4 случайных цифры, назначаемых при первом включении Raspberry Pi.
|
||||
> **Note** Документация для версий [образа](image.md), начиная с **0.20**. Для более ранних версий см. [документацию для версии **0.19**](https://github.com/CopterExpress/clover/blob/v0.19/docs/ru/wifi.md).
|
||||
|
||||
Подключитесь к Wi-Fi, используя пароль `cleverwifi`.
|
||||
На [образе для RPi](image.md) преднастроена раздача Wi-Fi с SSID `clover-xxxx`, где xxxx – 4 случайных цифры, назначаемых при первом включении Raspberry Pi.
|
||||
|
||||
Подключитесь к Wi-Fi, используя пароль `cloverwifi`.
|
||||
|
||||
<img src="../assets/ssid.png" width="300px" alt="Подключение по Wi-Fi">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user