Clock/Time synchronization
Confirm Setting is Correct on Raspberry Pi
Open a terminal, type:
roscd mavros
cd launch
nano apm_config.yaml
Config the connection and time settings are same as following:
conn:
timesync_rate: 10.0
system_time_rate: 1.0
time:
timesync_mode: MAVLINK
Such that the Raspberry Pi will synchronize once for every seconds
Ensure sys_time
plugin is installed on mavros
roscd mavros
nano mavros_plugins.xml
Connect the Cube to ground station (eg: Mission Planner). Go to Config/Tunning > Full Parameter List
and modify the following parameter:
BRD_RTC_TYPES = 2 (Mavlink system time)
If there is no BRD_RTC_TYPES
in Mission Planner, update your Mission Planner to a newer version.
Set Time Interval with Mavproxy
Time interval can also be set by Mavproxy if it is installed on the Raspberry Pi.
Connect to Mavproxy and type:
module load system_time
Check current time of the device by typing:
time
Set update interval by typing:
system_time set interval <sec>
Pi Camera and Cube Parameter Setup
Enable the Pi Camera
Detailed procedure can be found here
Connect your Camera to the camera port at the centre of Raspberry Pi
Open a terminal, type:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install raspi-config rpi-update
Type
sudo raspi-config
then select Enable Camera
Open a terminal and type:
sudo nano /boot/config.txt
Ensure the setting is same as below:
start_x=1
gpu_mem=128
Run
rpi-update
Test the Camera
Open a terminal and type:
raspivid -p 0,0,640,480 -t 0
A 640x480 window should pop up at the top-left corner and shows the real time image from camera.
Mount the Camera
You are supposed to mount your camera in default orientation:
(
If you need to mount the camera in different orientation, you may modify the parameters in a GUI. This will be mentioned in the part Run all Components.
Since the system calculates position of the camera, not the aircraft itself. It is recommended to mount the camera at the bottom, and face to the ground.
Setup the Cube
Connect the Cube to ground station (eg: Mission Planner). Go to Config/Tunning > Full Parameter List
and modify the following parameters:
AHRS_EKF_TYPE = 2
BRD_RTC_TYPES = 2
EK2_ENABLE = 1
EK3_ENABLE = 0
EK2_GPS_TYPE = 3
EK2_POSNE_M_NSE = 0.1
EK2_VELD_M_NSE = 0.1
EK2_VELNE_M_NSE = 0.1
GPS_TYPE = 0
COMPASS_USE = 0
COMPASS_USE2 = 0
COMPASS_USE3 = 0
SERIAL2_BAUD = 57 (the serial port used to connect to Raspberry Pi)
SERIAL2_PROTOCOL = 1
SYSID_MYGCS = 1 (to accept control from mavros)
VISO_TYPE = 0