6.3. Frequently ISSUE
6.3.1、When running [RflySim installation directory]\PX4PSP\RflySimAPIs\6.RflySimExtCtrl\0.ApiExps e1_PX4MavCtrlAPITest this routine reported an error, excuse me is not library missing? As shown in the following picture:
Answer to questions:
First of all, Vs Code is not associated with our Python environment, you can refer to the [RflySim installation directory
Record]\PX4PSP\RflySimAPIs\1.RflySimIntro\2.AdvExps\e3_PythonConfig\Readme.pdf Look at this document, configure the Python environment. As shown in the following picture:
6.3.2、Does the RflySim platform now have offboard and mission mode demo?
Answer to questions:
Both visual and cluster examples are offboard, the routines shown below: mission is not dedicated, but qgc can be set up.
6.3.3、How to deal with the receiving buffer of the flight control side (px4 internal data analysis process or code implementation), the purpose is to verify how the core information sent by the host computer forms a communication closed loop in the whole software.
Answer to questions:
In PX4, processing of the receive buffer is usually triggered by a serial port receive interrupt. PX4 communicates using a protocol called MAVLink (Micro Air Vehicle Link), which is used for communication between the vehicle and the ground station. The following is the basic process of receiving buffer management in PX4:
Receive data: When the serial port receives data, it will trigger an interrupt and store the received data in the buffer.
Parse the data:PX4 firmware has a module called MAVLink parser, which is responsible for parsing out the MAVLink message from the receive buffer. This parser will extract the MAVLink message fields from the received data according to the MAVLink protocol specification,
And verifies the integrity of the message.
Distribute the message: The parser will extract the message to the corresponding processing module. For example, if the received is the attitude control instruction, the parser will send the message to the attitude control module for processing; If it is receiving sensor data, the parser sends it to the sensor driver.
Perform the corresponding action: The received message triggers the corresponding processing action, such as updating the flight status, adjusting the control output, etc. In this way, the core message sent by the upper computer will form a communication closed loop in the PX4 software, affecting the behavior of the aircraft.
Medium. In this file, you can find specific implementations of receive buffer handling, including processes such as interrupt handling, data parsing, and message distribution.
In general, PX4 realizes the processing of the receive buffer through the interrupt-driven way, and then parses the received data into MAVLink messages through the MAVLink parser, and performs the corresponding operations according to the message content, realizing the communication closed loop between the flight controller and the ground station.
6.3.4、[RflySim installation project
Record] / RflySimAPIs / 6. RflySimExtCtrl / 0. ApiExps/e2_PX4C omAPITest/Readme PDF. The interface of this routine is 6p line, but is usb only 4 lines ah, How to do this?
Answer to questions:
Want to have one kind of 4 6 line, the connection may have a look the https://docs.holybro.com/autopilot/pixhawk-6c/pixhawk-6c-ports
6.3.5、If I'm operating a drone swarm to search for drowning people, how do I operate this software besides importing the program?
Answer to questions:
After starting the simulation SITL.bat script, you can run the program directly.
6.3.6、We now this system can achieve multiple terminals, that is, for example, three computers run this RflySim3D, then 3 CopterSim, then 3 QGC, and then these three models in the same scene can achieve this function
Answer to questions:
Yes, three computers on the same LAN can do that.
6.3.7、Can the auxiliary channel duty cycle of PX4 flight control be changed?
Answer to questions:
PX4 flight control usually supports the auxiliary channel to control external devices, such as steering gear, LED lights, etc., the operation of these devices can be controlled by the duty cycle of PWM signal. The duty cycle of the auxiliary channel can usually be set and changed in the ground station software.
Specifically, you can go to the flight controller's parameter setting interface via ground station software such as QGroundControl and find the parameters related to the auxiliary channel, usually set in the form of the channel number and PWM output range. This is where you can change the PWM output duty cycle range of the auxiliary channel, thereby controlling the operation of the external equipment.
It is important to note that make sure you understand the operating range and limitations of the external device you are operating on, and set the duty cycle of the secondary channel carefully to avoid damaging the device or creating a safety risk. At the same time, the firmware version of the flight controller and the version of the ground station software may affect the specific operation of the parameter setting interface, so make sure to use the latest version of the software and refer to the relevant documentation or user manual for operation.
6.3.8、How to make control_allocator accept torque, thrustsetpoint and publish pwmtopic in v1.13? According to the website, you can run straight away, but in gazebo, the plane never responded
Answer to questions:
rflysim interface can send force and torque, official 1.13, first enable the new dynamic splitter in the rack parameters, in order to force and torque, or use 1.14 firmware, or directly use the interface of rflysim, to use the new interface, can send force and torque, attitude ring, speed ring, position ring, etc. Try a platform after version 3.03, with dedicated interfaces.
6.3.9、PX4's uORB message pool has changed its name since version 1.13. Will the RflySim toolchain conflict when compiling firmware for 1.13 and 1.14?
Answer to questions:
No, when RflySim is installed at the beginning, the background will automatically configure the corresponding PX 4 version environment according to the different choices of the user, and the user does not need to modify other codes in the environment.
6.3.10、If you write a rack and mixer file, compile and burn it and then modify the SYS-AUTOSATART number parameter, you can achieve a custom rack?
Answer to questions:
Yes, but it should be noted that the PX4 mixer system before 1.14 is relatively chaotic, such as in the configuration of fixed-wing UAV, steering gear and motor control value range is different, 1.14 version introduced the power distribution method, it will be very convenient to customize the rack, directly can be modified in the QGC ground station.
6.3.11、The model obtained from the identification data after the sweep frequency is the model that contains the controller, then how to use this model if you want to redesign the new controller?
Answer to questions:
The frequency sweep experiment demonstrated in the live training is equipped with attitude loop controller, because the experiment is the frequency sweep experiment of the speed loop. Of course, the frequency sweep experiment can also be directly used to obtain the expected force/moment and the actual force/moment in the flight control, the expected speed and the actual speed, etc., to identify different control loops or channels. The result will not include the controller.
6.3.12、Is automatic code generation in Simulink primarily about control and navigation? What about the other parts?
Answer to questions:
It is mainly the control part of the code, other parts of the code can also be generated, but it should be noted that most of the flight control memory on the market is limited, and more complex algorithms may not be burned into the flight control.
For more questions, please visit:https://github.com/RflySim/Docs/issues