6.3 Frequently Asked Questions
6.3.1 When running [RflySim Installation Directory]\RflySimAPIs\6.RflySimExtCtrl\0.ApiExps\e1_PX4MavCtrlAPITest, an error occurs. Is a library missing?

Answer:
VS Code is likely not associated with the RflySim Python environment. Refer to:
[RflySim Installation Directory]\RflySimAPIs\1.RflySimIntro\2.AdvExps\e3_PythonConfig\Readme.pdf
Configure the Python environment as described in that document.

6.3.2 Does the RflySim platform have examples for Offboard and Mission modes?
Answer:
All vision and swarm examples use Offboard mode. For the list of routines, see the screenshots below. Mission mode does not have a dedicated example, but missions can be configured directly in QGC.


6.3.3 How does the flight controller process the receive buffer (PX4 internal data parsing process)? The goal is to verify how the core information sent by the host computer forms a communication closed loop in the software.
Answer:
In PX4, receive buffer processing is typically triggered by a serial port receive interrupt. PX4 communicates using the MAVLink (Micro Air Vehicle Link) protocol. The basic process is:
- Receive data: When the serial port receives data, an interrupt is triggered and the received data is stored in the buffer.
- Parse data: PX4's MAVLink parser extracts MAVLink messages from the receive buffer according to the protocol specification and verifies message integrity.
- Distribute messages: The parser routes extracted messages to the appropriate processing module (e.g., attitude control commands go to the attitude control module; sensor data goes to the sensor driver).
- Execute actions: Received messages trigger corresponding actions such as updating flight status and adjusting control outputs.
This creates a communication closed loop between the flight controller and the ground station: data is received via interrupt, parsed by the MAVLink parser, and the resulting actions close the control loop.
6.3.4 The e2_PX4ComAPITest routine uses a 6-pin connector, but USB only has 4 pins. How should this be connected?
Answer:
Some connectors come in both 4-pin and 6-pin variants. Check the pinout documentation: https://docs.holybro.com/autopilot/pixhawk-6c/pixhawk-6c-ports

6.3.5 For a drone swarm search-and-rescue mission, how do I operate the software besides importing the program?
Answer:
After starting the simulation with the SITL BAT script, you can run the program directly.
6.3.6 Can the system support multiple terminals — e.g., three computers each running RflySim3D, CopterSim, and QGC — with all three aircraft appearing in the same scene?
Answer:
Yes, three computers on the same LAN can achieve this.
6.3.7 Can the auxiliary channel duty cycle of the PX4 flight controller be changed?
Answer:
Yes. PX4 supports using auxiliary channels to control external devices (servos, LEDs, etc.) via PWM signal duty cycle. The duty cycle can be adjusted through ground station software such as QGroundControl in the parameter settings interface (channel number and PWM output range). Ensure you understand the operating range and limitations of the connected device to avoid damage or safety risks.
6.3.8 How to make control_allocator accept torque/thrust setpoints and publish PWM topics in PX4 v1.13? The aircraft does not respond in Gazebo.
Answer:
The RflySim interface supports sending force and torque. For the official PX4 v1.13, first enable the new dynamic allocator in the frame parameters. To use force and torque control, either use v1.14 firmware or the RflySim interface directly. The RflySim platform (version 3.03+) provides dedicated interfaces for sending force/torque, attitude rate, velocity, and position commands.
6.3.9 PX4's uORB message pool changed names since v1.13. Will the RflySim Toolchain conflict when compiling firmware for v1.13 and v1.14?
Answer:
No. During installation, RflySim automatically configures the corresponding PX4 version environment based on the user's selection. No additional code modifications are needed.
6.3.10 Can writing a custom frame and mixer file, compiling/flashing it, and then modifying the SYS_AUTOSTART parameter achieve a custom frame?
Answer:
Yes, but note that the PX4 mixer system before v1.14 is relatively complex. Version 1.14 introduced a new power allocation system that makes frame customization much more convenient — custom frames can be configured directly in QGC.
6.3.11 The model obtained from frequency sweep identification data includes the controller. How can this model be used to design a new controller?
Answer:
The frequency sweep experiment demonstrated in the live training includes the attitude loop controller because the experiment targets the rate loop. However, frequency sweep can also be applied to obtain the expected/actual force-moment, expected/actual rate, etc. — identifying different control loops or channels. The result of such identification will not include the controller.
6.3.12 Is automatic code generation in Simulink primarily for the control and navigation parts? What about the other parts?
Answer:
It is primarily for the control code. Other parts can also be generated, but note that most commercial flight controllers have limited memory, and more complex algorithms may not fit on the flight controller.
For more questions, please visit: https://github.com/RflySim/Docs/issues