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.
The first image — how a copter model looks in rviz with these settings, the second image — how Clever looks with the same settings.
<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"/>
<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"/>
<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"/>
<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"/>