Before opening the flight test file e5\e5.4\AttitudeControl_FLY.slx, you must configure the firmware to log custom messages. Follow these steps to integrate the costom_attctrl_e5.msg message:
1. Prepare the Message File
Place the customized message file costom_attctrl_e5.msg into the Firmware/msg/ directory.
Note for PX4 v1.9 and above: You must add a uint64 timestamp to the top of the .msg file. Refer to the demo file PSPfile/PX4_1.9andAbove/costom_attctrl_e5.msg for the correct format.
2. Update CMake Configuration
Modify Firmware/msg/CMakeLists.txt. Locate the set(msg_files section and add the new message:
# Inside Firmware/msg/CMakeLists.txt
set(msg_files
...
costom_attctrl_e5.msg
)```
### 3. Register the Topic in Logger
Register the new topic in the firmware source code to enable logging:
- **For PX4 < 1.11**: Modify `Firmware/src/modules/logger/logger.cpp`.
- **For PX4 >= 1.11**: Modify `Firmware/src/modules/logger/logged_topics.cpp`.
Inside the `add_default_topics()` function, add the following line:
```cpp
add_topic("costom_attctrl_e5", 4);
Note: The second parameter (4) defines the logging period in milliseconds (e.g., 4 results in a 250Hz sampling rate).
4. Configure SD Logging in QGroundControl (QGC)
- Connect your Pixhawk to your computer and open QGC.
- Navigate to Setting -> Parameters -> SD_Logging -> SDLOG_MODE.
- Change
SDLOG_MODE to from boot until shutdown and save the settings.