Localization with the Nokov Motion Capture System
A motion capture system (mo-cap) is a technology used to track the movements of objects or people, often for animation, sports analysis, or biomechanical research. It typically involves cameras and sensors that capture the position, orientation, and movement of markers placed on the subject. The data is then processed to create digital representations or animations. The Nokov motion capture system (https://www.nokov.com/) is one of the products in this area that can be used for UAV indoor localization.
Preparation
(1) Hardware
Nokov motion capture system
Kerloud UAV
Kerloud telemetry
Ground control computer
(2) Software
Install the Qgroundcontrol software on the ground station PC,
Ubuntu 18.04 (recommended): https://github.com/cloudkernel-tech/qgroundcontrol/releases/download/v0.2.1/QGC_3.5.6_kerloud_202411.AppImage
For the relevant settings, please refer to the startup method in this link: https://cloudkernel.cn/pursuit/tutorials_zh/firmware_upgrade_zh.html#tutorial-firmware-upgrade-zh, the instructions are as follows:
sudo usermod -a -G dialout $USER sudo apt-get remove modemmanager -y sudo apt install gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl -y chmod +x ./QGC_3.5.6_kerloud_202411.AppImage # reboot the computer to make above settings effective # start the app with command ./QGC_3.5.6_kerloud_202411.AppImage
Windows 11系统: https://github.com/cloudkernel-tech/qgroundcontrol/releases/download/v0.3/QGroundControl-pursuit-installer.exe
In Windows 11, you also need to install the USB-UART serial port driver of the data transmission antenna, download link: https://www.silabs.com/developer-tools/usb-to-uart-bridge-vcp-drivers?tab=downloads
Setup Instructions for the Nokov System
Please refer to the document “Communication between ROS and Nokov Motion Capture System-V2” to complete the installation of XINGYING software and VRPN software. Attach a reflective ball to the appropriate position on the drone and set the drone as a Markerset in the system. The posture of the drone can be viewed through the software, and the detailed operation can be read in the “XINGYING Operation Manual”.
Setup Instructions for Kerloud UAV
(1) Onboard ROS software
First of all, refer to 供电和编程界面 to access the on-board computer,
Refer to the document “Communication between ROS and XINGYING Software” in the document “Communication between ROS and NOKOV Motion Capture System-V2”, and complete the installation of the vrpn software package in the UAV on-board computer Jetson Nano.
Ensure that the onboard computer can automatically connect to the same network of XINGYING software; Users can utilize the vrpn_client_ros package to obtain the pose of the corresponding tracker with a ROS topic like “/vrpn_client_node/Tracker2/pose”, and feed the positioning message to the autopilot for low-level positioning.
For our Kerloud UAV, you need to start the mavros node and subscribe to the pose output topic of motion capture, and then you can publish the measured pose of the motion capture system to the flight controller.
Users can add the following content to the mavros startup file px4.launch to re-map the topic name, please replace <tracker_name> with the corresponding topic name.
<remap from="/mavros/vision_pose/pose" to="/vrpn_client_node/<tracker_name>/pose" />
the mavros node can be started with:
cd ~/src/uav_space/catkinws_offboard #customized mavros package is inside the catkinws_offboard workspace source devel/setup.bash roslaunch mavros px4.launch fcu_url:=”/dev/ttyPixhawk”
(2) Autopilot configuration
Connect the Kerloud UAV with the QGroundcontrol software, and then set the onboard parameters as:
EKF2_AID_MASK 24 #select vision position, vision yaw
EKF2_HGT_MODE 3 #vision height
Note: The data displayed in different ground station versions is different, please make sure that the parameter values are 24 and 3 respectively, which can be entered manually. For Kerloud drones with optical flow configuration, users can also check the optical flow option in EKF2_AID_MASK, so that the EKF2_AID_MASK is 26.
Reboot the flight controller for the settings to take effect.
Localization Status Validation and Indoor Flight
(1) Localization status validation
The localization status of the Kerloud UAV can be validated via three ROS topics as below. The data output from these topics should be very close if the system settings are correct.
rostopic echo /vrpn_client_node/<tracker_name>/pose # position measurement from the motion capture system
rostopic echo /mavros/vision_pose/pose # external localization position sent to the autopilot
rostopic echo /mavros/local_position/pose # fused position from the autopilot
Note
📌 The unit of above output should be SI unit
Users can also test the output data by holding the drone in the motion capture environment, for example, if you move 1 meter forward to the X axis of the motion capture system, the value of the corresponding coordinate output X will also increase by 1.
(2) Indoor flight
Please calibrate the drone accelerometer, gyroscope, magnetometer and other sensors first, refer to: https://cloudkernel.cn/kerloud-uav/quickstart-zh.html . Only the sensor calibration step is required, and the rest setting is done in factory.
Verify that the drone’s blades are installed correctly and that the nuts are tightened.
Start the motion capture system and verify that the positioning output is normal.
Start the vrpn_client_ros and mavros nodes on the onboard computer to verify that the pose output are normal, and you can verify the value by moving the drone manually.
Try to use POSITION mode for semi-automatic flight, refer to the quick start chapter in the user manual. If you can fly in POSITION mode, the drone can realize correct positioning in the motion capture environment, and there should be no problem in the autonomous mode.
Before performing an autonomous flight, be sure to verify that the waypoint coordinates of the flight are within the limited range. If you use the provided off_mission node, the default waypoint coordinates need to be modified, where the take-off altitude is 5 meters will exceed the indoor limit. The onboard software program must be tested in a software simulation environment first.
FAQ
**Q1: If the positioning output of the motion capture system is lost during indoor flight, how will the drone react and will it crash immediately? **
Ans:
The drone can react differently depends on whether the optical flow positioning is enabled after it loses external positioning data.
The drone will switch to POSITION mode by default if optical flow is selected in the EKF2_AID_MASK settings.The optical flow measurement will aid the UAV in horizontal positioning, and the drone will utilize the barometer measurement for height.
If there is no optical flow available, an alarm will occur. The drone will descend by default (but not vertically, as there is no positioning data horizontally). The drone will not flip and crash directly.
Suggestion: Pay attention to the effective positioning space of the motion capture environment during operation, and only perform flight tasks in the effective space; Keep an eye on the reminder of the ground station, and switch to stabilized mode during accidents to ensure safe flight.