Robofly setup for P1 projects
Preparation
- Download and install the Raspberry Pi Imager.
- Download the SD card image https://drive.google.com/file/d/1UCWfJRqWckL_UfICQ4vAHmAU54ZltRW-/view?usp=drive_link
- The image does not need to be unzipped
- Clone the installation guide repository
git clone git@github.com:fly4future/robofly_installation_guide.git
- Clone the uav_custom_files
git clone git@github.com:fly4future/uav_custom_files.git
SD card for Raspberry Pi 5
- Use a 128 GB SD card
- Plug the SD card into your laptop
- Run the Raspberry Pi Imager with sudo:
sudo rpi-imager - Choose Device -> Raspberry Pi 5
- Choose OS -> Use custom -> select the downloaded SD card image
- Choose Storage -> select the SD card
- Next -> writing can easily take an hour
- Verify (progress bar turns green) -> can be skipped
- Put the SD card into the Raspberry
Camera focusing
- Connect power to the Raspberry (USB-C or battery/adapter to the drone)
- LED on the Raspberry should turn green. If the light is solid red, press the power button next to it
- The computer will connect to wifi
f4f_robotwith IP address192.168.12.101 - On your laptop:
ping 192.168.12.101and wait until ping response - On your laptop: open browser and enter
192.168.12.101:9443into the address bar - Username: admin, pass: admin
- Open the environment robofly and navigate to Stacks
- Open the sensor_diagnostics stack, click the green button Start this stack
- If the button is not green, click Stop this stack and then wait for the green button to appear
- Navigate to
robofly_installation_guiderobofly_installation_guide/testing_sessions/camera_focusing ./run.sh uav1 192.168.12.101- Check that both cameras are publishing images (these may be blurry)
- Point each camera at an object ~2m away from you, and turn the camera lens until the image is in focus
- The front camera lens is held by a counter-locking nut, loosen it before turning the lens
- Kindly ask the hardware guys to hot glue the lenses in place
Camera calibration
- Take the RoboFly to the big calibration pattern near the stairs
- Power on the drone (use a very long cable or a battery)
- On your laptop or phone, connect to
f4f_robotwifi and open Portainer in your browser (192.168.12.101:9443) - Environment robofly -> Stacks -> calibration_rosbag_down
- Start the stack
- Point the down-facing camera at the calibration pattern and slowly do the calibration dance
- Collect at least 2 minutes of data
- Stop the stack
- Repeat the same for the front camera (stack calibration_rosbag_front)
- In Portainer side panel select Volumes and click the browse button next to calibration_bag_files
- Download both calibration files (
camera_down_TIMESTAMP.bag,camera_front_TIMESTAMP.bag) - On your laptop: Move or symlink the .bag files to
robofly_installation_guide/install_scripts/data_calibration - Rename the files to
camera_down.bagandcamera_front.bag - Navigate to
robofly_installation_guide/install_scriptsand run./calibrate_cameras.sh - Three calibration procedures will be executed. After each one, a GUI will open and the results can be reviewed. Closing the GUI will continue with the next procedure
Raspberry Pi setup
- From robofly_installation_guide/install_scripts copy the following files to the drone:
- initial_config.sh
- update_portainer_stacks.sh
- clean_docker_volumes.sh
scp initial_config.sh uav@192.168.12.101:~/.
scp update_portainer_stacks.sh uav@192.168.12.101:~/.
scp clean_docker_volumes.sh uav@192.168.12.101:~/.
- Navigate to the uav_custom_files and generate a new ID:
./generate_new_id.py - Copy the generated UAV_ID
- Edit the uav_custom_files/uavs.txt and add a new line
- Write the name of the project, a new UAV_NAME (e.g. uav80) and the unique ID produced by the generator
- ssh to the drone
ssh uav@192.168.12.101 - On the drone: run
sudo ./initial_config.sh uav80(or your desired UAV_NAME) - On the drone: run
./update_portainer_stacks.sh uav80 1a2b3c(use your UAV_NAME and the unique UAV_ID) - On the drone:
sudo reboot - The hostname will now be UAV_NAME, and the IP address will be
192.168.12.1XX(uav80 -> 192.168.12.180, uav2 -> 192.168.12.102...) - Navigate to
uav_custom_files/data/robofly - Create a copy of an existing folder and use the unique UAV_ID as its name
- Inside this folder, replace
camera_calibrations/camera_front.yamlwith the calibration outputrobofly_installation_guide/install_scripts/calibration_output/camera_front.yaml - Replace
camera_calibrations/camera_down.yamlwith the calibration outputrobofly_installation_guide/install_scripts/calibration_output/camera_down.yaml - Edit
open_vins/open_vins.yamland replace the values forcam0_distortion_coeffsandcam0_intrinsicswith the values fromrobofly_installation_guide/install_scripts/calibration_output/open_vins_params.yaml - Create a folder
~/docker - Navigate to
uav_custom_filesand run./build_image.shand then./export_image.sh - If all succeeds,
git add,git commitandgit pushthe new and updated files - Open Portainer and access the drone using the new IP address (e.g.
192.168.12.180:9443) - Environment robofly -> Images -> click the Import button
- Select file ->
~/docker/uav_custom_files.tar.gz-> click the Upload button - Go back to the Images panel and Remove all images without a tag
- Go to Stacks -> camera_test_bottom -> start
- On your laptop: navigate to
robofly_installation_guide/testing_sessions/test_camera_bottom - Start rviz with
./run uav80 192.168.12.180 - Show this AprilTag to the camera, check if the apriltag detector is tracking it (an overlay coordinate system should be visible in rviz)
- Stop the stack on the drone, run
./stop.shon the laptop - Repeat for the front camera
- Check AI object detection by running stacks sensor_diagnostics and hailo_ai_yolo
- Use testing session
robofly_installation_guide/testing_sessions/test_hailoand verify in RVIZ that the neural network is labeling objects shown to the camera - Stop all stacks, stop all testing sessions
Preparing for test flights
- Use Portainer to start the mrs_uav_system_vio stack
- Navigate to
robofly_installation_guide/testing_sessions/test_flight - Run
./run uav80 192.168.12.180and check the OpenVINS overlay for the camera - Lift the drone into the air and check if the OpenVINS starts tracking features (red tracks should turn into green points)
- Verify in Portainer that no container besides
..._copy_shared_data,..._copy_uav_custom_fileshas exited with an error ./stop.shon the laptop and stop the stack on the drone- Run the mrs_uav_system_gnss stack and check that no container besides
..._copy_shared_data,..._copy_uav_custom_fileshas exited with an error - Run the user_session stack while the gnss stack is still running
- Check that all containers in user session are running
- Stop all stacks
Kakute H7 v1.5 + PX4 v1.14.4
- Clone the repo with a custom firmware v1.14.4-robofly
- Go to the cloned directory and run
make holybro_kakuteh7_default - Use QGroundControl to update firmware
- Connect the flight controller to the laptop using USB-C
- Go to Vehicle Configuration -> Firmware
- Unplug the USB cable and plug it back in
- Select custom firmware ->
px4_firmware_robofly/build/holybro_kakuteh7_default/holybro_kakuteh7_default.px4 - Remove the SD card from the flight controller, plug it into your laptop
- Make sure there is a file
etc/extras.txtwith this content - Put the SD card back to the flight controller
Prepare for shipping
Do this after all test flights
- Remove the
./initial_config.shand./update_portainer_stacks.shfiles - Run
./clean_docker_volumes.sh - Make sure all stacks are stopped in Portainer
- Connect to the flight controller using USB and run QGroundControl
- Go to Analyze Tools -> Log Download -> Refresh -> Erase All
- Vehicle configuration -> Parameters -> Tools -> Save to file...
- Upload the parameters to google drive