mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-26 11:43:25 +00:00
docs: add info on focusing camera (en)
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
* [Viewing images from cameras](web_video_server.md)
|
||||
* Programming
|
||||
* [Overview](programming.md)
|
||||
* [Camera orientation](camera_frame.md)
|
||||
* [Camera setup](camera_setup.md)
|
||||
* Fiducial markers (ArUco)
|
||||
* [Overview](aruco.md)
|
||||
* [Marker detection](aruco_marker.md)
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
# Adjusting the position of the main camera
|
||||
|
||||
> **Note** Documentation for the versions [of image](image.md), starting with **0.15**. For earlier versions, see [documentation for version **0.14**](https://github.com/CopterExpress/clever/blob/v0.14/docs/ru/camera_frame.md).
|
||||
|
||||
Position and orientation of the main camera is [set in file](cli.md#editing) `~/catkin_ws/src/clever/clever/launch/main_camera.launch`:
|
||||
|
||||
```xml
|
||||
<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0 0 -0.07 -1.5707963 0 3.1415926 base_link main_camera_optical"/>
|
||||
```
|
||||
|
||||
This line sets static transformation between frame `base_link` ([corresponds to the flight controller housing](frames.md)) and the camera (`main_camera_optical`) in format:
|
||||
|
||||
```txt
|
||||
shift_x shift_y shift_z yaw_angle pitch_angle roll_angle
|
||||
```
|
||||
|
||||
The frame of the camera is set so that:
|
||||
|
||||
* **<font color=red>x</font>** points to the right in the picture;
|
||||
* **<font color=green>y</font>** points down in the picture;
|
||||
* **<font color=blue>z</font>** points away from the camera matrix plane.
|
||||
|
||||
Shifts are set in meters, angles — in radians. Correctness of the transformation set may be checked using [rviz](rviz.md).
|
||||
|
||||
## Settings for Clever
|
||||
|
||||
The first image — how a copter model looks in rviz with these settings, the second image — how Clever looks with the same settings.
|
||||
|
||||
### 1. The camera is facing downward, the flat cable — backward
|
||||
|
||||
```xml
|
||||
<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0.05 0 -0.07 -1.5707963 0 3.1415926 base_link main_camera_optical"/>
|
||||
```
|
||||
|
||||
<img src="../assets/camera_option_1_rviz.png" width=400>
|
||||
<img src="../assets/camera_option_1_clever.jpg" width=400>
|
||||
|
||||
### 2. The camera is facing downwards, the flat cable — forward
|
||||
|
||||
```xml
|
||||
<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0.05 0 -0.07 1.5707963 0 3.1415926 base_link main_camera_optical"/>
|
||||
```
|
||||
|
||||
<img src="../assets/camera_option_2_rviz.png" width=400>
|
||||
<img src="../assets/camera_option_2_clever.jpg" width=400>
|
||||
|
||||
### 3. The camera is facing upward, the flat cable — backward
|
||||
|
||||
```xml
|
||||
<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0.05 0 0.07 1.5707963 0 0 base_link main_camera_optical"/>
|
||||
```
|
||||
|
||||
<img src="../assets/camera_option_3_rviz.png" width=400>
|
||||
<img src="../assets/camera_option_3_clever.jpg" width=400>
|
||||
|
||||
### 4. The camera is facing upward, the flat cable — forward
|
||||
|
||||
```xml
|
||||
<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0.05 0 0.07 -1.5707963 0 0 base_link main_camera_optical"/>
|
||||
```
|
||||
|
||||
<img src="../assets/camera_option_4_rviz.png" width=400>
|
||||
<img src="../assets/camera_option_4_clever.jpg" width=400>
|
||||
84
docs/en/camera_setup.md
Normal file
84
docs/en/camera_setup.md
Normal file
@@ -0,0 +1,84 @@
|
||||
# Camera setup
|
||||
|
||||
> **Note** The following applies to [image version](image.md) **0.15** and up. See [previous version of the article](https://github.com/CopterExpress/clever/blob/v0.14/docs/ru/camera_frame.md) (Russian only) for older images.
|
||||
|
||||
Computer vision modules (like [ArUco markers](aruco.md) and [Optical Flow](optical_flow.md)) require adjusting the camrea focus and set up camera position and orientation relative to the drone body.
|
||||
|
||||
## Focusing the camera lens
|
||||
|
||||
In order to focus the camera lens, do the following:
|
||||
|
||||
1. Open the live camera stream in your browser using [web_video_server](web_video_server.md).
|
||||
2. Rotate the lens to adjust the image. Make sure the objects that are 2-3 m from the camera are in focus.
|
||||
|
||||
Example of an image with lens out of focus:
|
||||
|
||||
<img src="../assets/unfocused.png" width=300>
|
||||
|
||||
Image with properly adjusted lens:
|
||||
|
||||
<img src="../assets/focused.png" width=300>
|
||||
|
||||
## Setting the camera position {#frame}
|
||||
|
||||
Position and orientation of the main camera is [set in the](cli.md#editing) `~/catkin_ws/src/clever/clever/launch/main_camera.launch` file:
|
||||
|
||||
```xml
|
||||
<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0 0 -0.07 -1.5707963 0 3.1415926 base_link main_camera_optical"/>
|
||||
```
|
||||
|
||||
This line describes how the camera is positioned relative to the drone body. Technically, it creates a static transform between the `base_link` frame ( which [corresponds to the flight controller housing](frames.md)) and the camera (`main_camera_optical`) in the following format:
|
||||
|
||||
```txt
|
||||
shift_x shift_y shift_z yaw_angle pitch_angle roll_angle
|
||||
```
|
||||
|
||||
Camera frame (that is, [frame of reference](frames.md)) is aligned as follows:
|
||||
|
||||
* **<font color=red>x</font>** points to the right side of the image;
|
||||
* **<font color=green>y</font>** points to the bottom of the image;
|
||||
* **<font color=blue>z</font>** points away from the camera matrix plane.
|
||||
|
||||
Shifts are set in meters, angles are in radians. You can check the transform for correctness using [rviz](rviz.md).
|
||||
|
||||
## Presets for Clever
|
||||
|
||||
The presets for usual camera orientations are available in the `main_camera.launch` file. The images should help you choose the one that is right for you: the first one is how your drone will be displayed in [rviz](rviz.md), the second is how the camera is actually mounted on the drone.
|
||||
|
||||
### 1. Camera faces downward, cable goes backward
|
||||
|
||||
```xml
|
||||
<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0.05 0 -0.07 -1.5707963 0 3.1415926 base_link main_camera_optical"/>
|
||||
```
|
||||
|
||||
<img src="../assets/camera_option_1_rviz.png" width=400>
|
||||
<img src="../assets/camera_option_1_clever.jpg" width=400>
|
||||
|
||||
### 2. Camera faces downward, cable goes forward
|
||||
|
||||
```xml
|
||||
<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0.05 0 -0.07 1.5707963 0 3.1415926 base_link main_camera_optical"/>
|
||||
```
|
||||
|
||||
<img src="../assets/camera_option_2_rviz.png" width=400>
|
||||
<img src="../assets/camera_option_2_clever.jpg" width=400>
|
||||
|
||||
### 3. Camera faces upward, cable goes backward
|
||||
|
||||
```xml
|
||||
<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0.05 0 0.07 1.5707963 0 0 base_link main_camera_optical"/>
|
||||
```
|
||||
|
||||
<img src="../assets/camera_option_3_rviz.png" width=400>
|
||||
<img src="../assets/camera_option_3_clever.jpg" width=400>
|
||||
|
||||
### 4. Camera faces upward, cable goes forward
|
||||
|
||||
```xml
|
||||
<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0.05 0 0.07 -1.5707963 0 0 base_link main_camera_optical"/>
|
||||
```
|
||||
|
||||
<img src="../assets/camera_option_4_rviz.png" width=400>
|
||||
<img src="../assets/camera_option_4_clever.jpg" width=400>
|
||||
|
||||
> **Hint** The [`selfcheck.py` utility](selfcheck.md) will describe your current camera setup in a human-readable fashion. Be sure to check whether this description corresponds to your actual camera position.
|
||||
Reference in New Issue
Block a user