mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-26 21:19:35 +00:00
* docs: Add CLI article (en) * docs: Update frames article (en) * docs: Add article about part models (en) * docs: Update Raspberry Pi article (en) * docs: Remove unused raspberry3.jpg * docs: Add COEX Pix article (en) * docs: Add CopterHack 2019 article (en) * docs: Update connection article (en) * docs: Add programming overview (en) * docs: Add anchor in modes article * docs: Fix link in auto_setup, add editing ID (en) * docs: Rearrange summary to match Russian version (en) * docs/camera_frame: Add link to cli#editing (en) * docs/wifi: Fix link to next article (en) * docs: Add "next" links where appropriate (en)
2.7 KiB
2.7 KiB
Adjusting the position of the main camera
Note
Documentation for the versions of image, starting with 0.15. For earlier versions, see documentation for version 0.14.
Position and orientation of the main camera is set in file ~/catkin_ws/src/clever/clever/launch/main_camera.launch:
<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) and the camera (main_camera_optical) in format:
shift_x shift_y shift_z yaw_angle pitch_angle roll_angle
The frame of the camera is set so that:
- x points to the right in the picture;
- y points down in the picture;
- z 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.
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
<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"/>
2. The camera is facing downwards, the flat cable — forward
<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"/>
3. The camera is facing upward, the flat cable — backward
<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"/>
4. The camera is facing upward, the flat cable — forward
<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"/>