Skip to content

Latest commit

 

History

History
63 lines (41 loc) · 2.66 KB

camera_frame.md

File metadata and controls

63 lines (41 loc) · 2.66 KB

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"/>