Drone Setup
Hardware Setup
This section takes you through the hardware setup process for the OmniNXT Drone. The bill of materials can be found here.
3D print all of the necessary items that are labelled with the manufacturer "Self".
Flight Controller and ESC
Soldering
- Insert the antivibration rubber pieces into the four holes of both the ESC and the flight controller. On the ESC, the shorter side should be on the side with the eight pin connection port. On the flight controller, the shorter side of the rubber piece should be on the SD card side.
- Cut each of the motor wires to 55mm. Measure from the foot of the heatshrink.
- Cut a orin power cable from the base of the female side:
- 10cm on the red wire
- 9.5cm on the black wire
- Take the XT60 Cable (CAB-004) and cut it to the following lengths:
- Red: 11cm from the edge of the connector
- Black: 10cm from the edge of the connector
- Strip around 5mm from each wire of CAB-004 and add solder to each wire
- Strip around 5mm from each wire of the orin power cable and add solder to each wire
- Solder the red wires of CAB-004 and the orin power cable together on the positive pad of the ESC
- Solder the black wires of CAB-004 and the orin power cable together on the negative pad of the ESC
- Solder each of the motors to one triad of pins on the ESC.
Warning
Ensure that each motor's wires are connected to three consecutive pads on the ESC, with one of them in the corner. It does not matter which motor wire goes on which pin other than this.
Fastening Assembly to Frame
- Stack the ESC and flight controller such that the big side of the rubber stoppers are touching. The MicroSD Card slot should be above the ESC power connection.
- Prepare the assembly:
- With the flight controller on the bottom, insert two M2X? bolts on the side with the USB-C port. The head of the bolt should be on the same side as the flight controller
- Insert two M2x? bolts on the opposite side of the USB-C port.
- Place the 6mm nylon spacers over all of the bolts.
- Orient the center of the frame over the assembly. The USB-C port should be facing towards the side if the frame with the cutout. The side with the divets for the nuts should be on the top.
- Loosely thread the M2 nuts onto each of the bolts
- For each of the bolts, hold the nut with your finger in the divet, and use a screwdriver to tighten the bolt. It should be snug, and equally tight across the four bolts. Do not overtighten, the ESC can contact the flight controller!
- Fasten the motors to the frame with the shorter bolts that were included in the packaging. Ensure that the cables are close to the frame, you can twist them together to ensure this.
- Connect the RC receiver to the appropriate port on the flight controller, and tape it down to the frame as shown
Orin Connection
- Insert the NVME SSD to the corresponding port, and bolt it down with an M2x6 bolt.
- Attach the Wi-Fi antenna to the adapter. It does not matter which port goes into which antenna. YouTube Video
-
Insert the Wi-Fi adapter to the corresponding port, and bolt it down using an M2x4 bolt.
-
Attach the carrier board and Orin to the other side of the frame as the flight controller. Use 5mm nylon spacers between the carrier board and the frame, and M3x12 bolts on the top.
- Remove the orange covers off of the bolt holes on the carrier board.
- Bolt the orin down to the carrier board with 2 M2x6 Nylon bolts
- Remove the protective film from the double sided tape on the Wi-Fi antenna, and attach it to the front of the drone.
Frame Preparation
-
Bolt (M3x8) the five oddity RC standoffs at the marked locations in the image below. They should be protruding on the side with the flight controller.
-
Bolt four M3 40mm standoffs with M3x10 bolts. These should be on the Orin side.
-
Bolt the prop guard onto the Oddity RC standoffs with M3x8 bolts.
Warning
Do not install the propellers yet! They will be installed during the software setup section.
Optitrack Markers
If the optitrack system is used for odometry, five markers (MSC-008) must be placed on the drone.
- Identify the locations that you will place the five markers. The pattern they are in must be:
- assymmetric
- sufficiently unique compared to the other drones
- For each marker, use hot glue to adhere it to the drone body.
Camera Assembly
Cameras
For each of the cameras, perform the following tasks:
Cable Preparation
- Insert the camera cable into the camera. The side with the pads labelled FSIN and STROBE should be on the side of the camera.
- Use a flathead screwdriver to pull out the retaining clip from the connector.
- Insert the cable with the exposed contacts facing the PCB, push until it hits the back of the connector
- Secure the cable by pushing the retaining clip back in
- Cut the microwire to a length of 30mm.
- Scratch around 4mm of coating off of both ends. The colour should change, and you can check with a magnifying glass or microscope.
- Apply some solder to both sides of the microwire
- Solder one side of the microwire to the port labelled
F
on the camera board. The wire should come out on the opposite side of the camera. - Solder the other side to the pad lablled
FSIN
on the cable. - Use the Kapton tape to secure the microwire, ensuring that the tape is providing strain relief for the solder connection
Lens Switch
- Unscrew the lens that the camera ships with, and discard.
- Unbolt the existing lens mount.
- Bolt the lens mount that came with the fisheye lens.
- Screw in the fisheye lens into the mount.
Test and Focus
Note
This step can be done anytime. However, it is suggested to test the camera setup now before things are bolted in more permanently.
- Insert all of the camera cables into the OAK camera board.
- Plug in the OAK camera board via USB-C to a laptop computer with ROS installed
- Download and install the driver package:
- Check for focus on each of the cameras, and change the focus by turning the lenses on their holders.
Camera Mounts
Warning
Be careful not to tug on the cables too much. They can tear.
- Use a soldering iron at 215℃ to insert the M2 threaded inserts into the six holes of each camera mount
- Bolt each camera to a mount by using four M2x? bolts. The cables should be exiting towards the flange on the mount.
- Bolt the camera mounts to the camera holder frame.
OAK Board
- Connect the four camera cables to the OAK board. Ensure that the orientation of the board is as it would be in the final assembly, and do not allow any camera cable to be twisted.
- Put the two halves of the cover around the OAK board, and bolt the assembly to the frame with 4 M2x14 bolts.
- Put the camera frame on the metal standoffs above the orin, and bolt down with four M3x6 bolts.
Flight Controller Setup
Flashing Firmware
Important
Ensure you have fully run the host computer setup in the IT Infrastructure Setup Guide
Bootloader
- Ensure the flight controller is powered off, unplug any power from the drone.
- While pressing the BOOT button beside the MicroSD card, connect the USB-C cable to the PC and release the boot button.
- Open the STM32CubeProgrammer by navigating to where it was installed in a terminal (
/usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin
by default), and runningsudo ./STM32CubeProgrammer
- On the blue dropdown next to the green connect button, select USB.
- Click the refresh button until a port is automatically selected under port. If it doesn't show up, ensure the board is in DFU mode by unplugging the USB-C cable, and holding the BOOT button while plugging it in again.
- Click Connect.
- Open the menu on the left side and select "Erasing & Programming"
- Under file path, click browse and find the bootloader bin file. It was built in the automatable dependencies playbook. It will be in
{host_fc_path}/PX4-Autopilot/build/hkust_nxt-dual_bootloader/hkust_nxt-dual_bootloader.bin
where{host_fc_path}
is specified in theansible/group_vars/all
. - Check Verify programming, and Run after programming. Ensure the start address is
0x08000000
. - Click on Start Programming.
Main Program
- Navigate to
{host_fc_path}
in a terminal - Open QGroundControl:
./QGroundControl.AppImage
. - Click on the Q symbol on the top left, and click on vehicle setup.
- Click on the firmware tab, and unplug and replug the USB cable to the flight controller.
- A pop-up should come up named "Firmware Setup". Select PX4 Pro, and check advanced settings. Select "Custom firmware file..." and click Ok
- In the file picker, navigate to
{host_fc_path}/PX4-Autopilot/build/hkust_nxt-dual_default
and select thehkust_nxt-dual_default.px4
file. - You should see tabs such as "Airframe" and "Sensors" once the flash is complete.
Apply Parameter File
Info
If you do not have a parameter file or want to create a new one, you can follow the steps in the Manual Setup > NXT Flight Controller Setup document instead of applying the parameter file as described below.
First, ensure that the units in QGroundControl are set to SI Units:
- Click on the Q on the top left
- Click on application settings
- In the general tab under units, ensure that they are Meters, Meters, SquareMeters, Meters/second, Celsius.
Then, apply the saved parameter file (which you can find in the swarm-nxt cloned repo: swarm-nxt/docs/params/nxt_params.params
) by following the steps below:
- Click on the Q button on the top left, click on Vehicle Setup, and parameters.
- Click the tools button and select "Load from file".
- Select the parameter file that can be found on the Google Drive.
NXT Configuration and Calibration
MAV System ID
The MAV System ID needs to be setup for every drone individually. This ID is a positive number that is associated with the drone. It allows QGroundControl to differentiate between the drones. When you set the hostname in the Post-Flash Setup, your drone should end with the same number that you set your MAV_SYS_ID
to. Use this number as your system ID. To set it:
- Search for
MAV_SYS_ID
in the parameters tab of QGroundControl's Vehicle Setup page. - Set it to the unique number of your drone.
Important
If this number is the same for two drones, things will not work and it will be very hard to debug.
Telemetry Streaming
The flight controller needs to be configured to output data on a serial port so that the NVIDIA Orin can read and write commands. Here, when you load the params file, telemetry is set up on the TELEM2 port.
Note
You can optionally chose to use another port to do this telemetry streaming. See Appendix > Flight Controller > Alternate Telemetry Port for further instructions
Go to the home screen of QGroundControl, and click on the Q button in the top left again. Click on analyze tools, and MAVLink Console.
In the console, run the following commands:
cd fs/microsd
mkdir etc/
cd etc
echo "mavlink stream -d /dev/ttyS3 -s HIGHRES_IMU -r 1000" > extras.txt
If you run cat extras.txt
, the mavlink stream line should be present.
Propeller Numbering and Spin Direction
First make sure the power is connected to the ESC and the ESC is connected to the FC. No need to power the Orin at this point, so you can unplug the power cable from the orin before powering the ESC. Ensure that the photo under "Actuator Testing" looks correct:
Under PWM MAIN, select DShot600 for MAIN 1-4. Click on "Identify & Assign Motors" and follow the process. For collision safety, ensure that the Onix is located closer to the rear rotors (rotors 2 and 4 in the image).
Important
The top of the quadroter is the side with the Orin.
Important
Ensure the propellers are unmounted before the next step
Set the spin direction for each motor so that it matches the image. Enable the slider, slide it up a bit and ensure the rotation direction is correct.
Important
Manually verify the spin direction individually for each motor, since the spin direction may not match QGroundControl
Propeller Installation
- Observe the rotation direction in the propeller setup image. The Orin is on the back (near propeller #2 and #4).
- Using the long bolts that came with the propellers, bolt the propellers in. Verify that the propellers on the diagonals are the same type. Make sure that the blade orientation is in such a manner that as it turns in the rotor direction, it pushes the air down instead of up i.e. the air slides off of it downwards.
Remote Control
Ensure the Taranis has been setup following the Remote Control Setup Instructions.
Go to the radio tab and follow the calibration procedure.
Go to the flight modes page and set the channels like the image:
Sensors
On the sensors tab:
Click on the orientations sub-tab, and set the autopilot orientation to ROTATION_ROLL_180_YAW_90
. Reboot if prompted.
Important
This is true if the arrow on the flight controller is pointed to the right if looked at from the bottom (orin on the back)
Calibrate the gyroscope by putting the drone on a level surface, and then clicking the gyroscope button and following the wizard.
Calibrate the accelometer by clicking on the accelerometer sub-tab and completing the procedure as prompted.
Software Setup
- Connect the host computer to the USB C port called "Recovery Port" on the carrier board.
- Provide the carrier board with an internet connection via an Ethernet dongle on one of the three host USB-C ports on the long side of the carrier board
- Ensure that the devkit is turned off and the power unplugged, but ready to be plugged in
- Press the button labelled "REC" on the Devboard
- While pressing the REC button, press the RES button
- Release the RES button while still pressing the REC button
- Connect the power to the Jetson, and release the REC button after the power is connected
- On the host computer, run
lsusb
. This sequence was a success if an entry with NVIDIA Corp. APX is visible (ID 0955:7323 NVIDIA Corp. APX
) - Run the sdkmanager:
sdkmanager --cli
- Login, and then select the following options: install -> jetson -> target hardare
- Select Jetson Orin NX, it should already be pre-selected
- Reply Y to showing all Jetson versions. Select JetPack 6.2
- Select both additional SDKs
- Do not customize install settings
- Reply N to flashing the Jetson Orin NX Module
- Accept the license, then press enter twice for the installation to start.
- Enter your password for administrative tasks.
- It will install host components (on the PC) and target components. It will ask you whether to install or skip the installation on the Orin, choose skip.
- Press enter to Exit.
Flashing Process
After the host components of the SDK are installed, run the following steps:
- Open the
~/nvidia/nvidia_sdk/JetPack_6.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra
folder. Open a terminal in this folder. - Download the post-install image from the Google Drive. Run the following command:
tar -xvf /path/to/post-install_image.tar.gz -C ~nvidia/nvidia-sdk/JetPack_6.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra/tools/backup_restore
. This will take a while. - Once this is done, make sure that the Orin is still in recovery mode (step 8 of Software Setup), and run this command to flash the Jetson:
sudo ./tools/backup_restore/l4t_backup_restore.sh -e nvme0n1 -r jetson-orin-nano-devkit-nvme
. This will also take a while. - Press the button labelled RES on the Jetson once the command has completed.
Important
Ensure you are in the Linux_for_Tegra
folder
Post-Flash Setup
On the host computer, you should be able to SSH into the Orin now: ssh lis@192.168.55.1
. This connection is provided through the USB Recovery port. These are the default credentials:
username: lis
password: orin
Password-Free Access
For password free access to the Orin, follow these steps:
- Ensure that you have an SSH key in ~/.ssh
- If not, run
ssh-keygen -t ed25519 -C <yourCommentHere>
- If not, run
- With the USB connected, run
ssh-copy-id lis@192.168.55.1
- Make sure that the ssh-agent is on:
eval `ssh-agent`
- Add your key to the agent:
ssh-add
- Ensure that you can access the device without a password:
ssh lis@192.168.55.1
Ansible
On the host computer, navigate to the ansible/
directory of the omni-nxt repo and run the playbook:
ansible-playbook -i inventory.ini drone_setup.yml -K
Enter the sudo password of the orin when prompted, as well as the hostname which should end with the same number that you set MAV_SYS_ID
to in NXT Configuration and Calibration.
Important
It is very important that you set a unique hostname. We recommend following a structured naming pattern for the hostname (nxt1, nxt2 ...), and recording the assigned names somewhere to avoid duplicate naming. Label your drone with this hostname.
Flight Preparation
PID Tuning
- Follow all the steps in the Pre-Flight Checklist
- Launch the vehicle in position mode, and fly it slowly. Make sure that it feels decently well to operate.
- Hover the drone at 1.5 m, and ensure that it the drone is in the center of a 2x2x2m cube of free space.
- In QGroundControl, click on the Q on the top left and open the vehicle setup menu
- Click on PID Tuning
- Enable autotune
- Autotune the rate controller.
- Land, and save the parameters
- Takeoff again in a safety volume of 2x2x2m.
- Autotune the attitude controller.
- Land.
If the autotune fails, you can increase the MC_AT_SYSID_AMP
parameter by steps of 0.5, and trigger the autotune again.
Optitrack Setup
- Bring the drone into view of the OptiTrack sensors
- Place the drone in view of the OptiTrack cameras, and ensure that the drone is facing the positive x direction of the coordinate system.
- Select the drone's markers on the screen, right click, and click on create rigid body. Give each drone the same name as the hostname. This allows the automated tooling to work properly.
Warning
It is very important that the drone is facing the positive x direction (orin towards the negative x direction).