PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.17k stars 13.36k forks source link

[Bug]: Tiltrotor won't take off in HITL #21746

Open Deltarr350 opened 1 year ago

Deltarr350 commented 1 year ago

Describe the bug

Hi all, I'm trying to run tiltrotor VTOL HITL simulation in Gazebo Classic 11. I have connected to QGC and made the necessary modifications to the sdf file (setting serialEnabled to 1 and hilenabled to 1, as well as setting SYS_HITL to 1). QGC was able to connect as well. However, when commanded to take off (autonomous mission) from QGC, the rotors on the model simply rotate slowly and the model doesnt move at all. I have previously done this with standard vtol with no problems.

I compared the flight logs of the previous successful Standard VTOL HITL mission VS the current Tiltrotor VTOL HITL mission and discovered that the motor outputs in the Tiltrotor is only 0.1 VS 0.5 in the Standard VTOL. I think this is the cause as to why the rotors turn very slowly in the tiltrotor simulation, but I can't figure out why this is happening since I did not change airframe parameters except for VT_TYPE and MAV_TYPE.

Can someone please point to where the problem could lie? Thank you very much!

To Reproduce

  1. Edit tiltrotor sdf file in models folder: in the mavlink plugin set serialenabled to 1, serialDevice to (usb port), hilenabled to 1

  2. Open QGroundControl, in application settings listen only to UDP, in vehicle settings set safety setting to HIL mode, then close QGroundControl again

  3. Create new world file in worlds folder, include tiltrotor model

  4. In terminal, run:

    cd PX4-Autopilot DONT_RUN=1 make px4_sitl_default gazebo-classic source Tools/simulation/gazebo/setup_gazebo.bash $(pwd) gazebo Tools/simulation/gazebo/sitlgazebo/worlds/hitl

  5. Launch QGroundControl, plan mission and takeoff

Expected behavior

Rotors spin up fast and model takes off

Screenshot / Media

Tiltrotor VTOL Motor Outputs on the Left vs Standard VTOL Motor Outputs on the Right image

Flight Log

Tiltrotor VTOL Flight Log:
https://review.px4.io/plot_app?log=d5ead83a-4169-41b1-9c76-c22ff2fd567a

Standard VTOL Flight Log:
https://review.px4.io/plot_app?log=1fac9d43-6548-47c3-b75a-d94e8a098f52

Software Version

HW arch: PX4_FMU_V5
HW type: V5004000
HW version: 0x004
HW revision: 0x000
PX4 git-hash: 70178b66d8f4bc18e74941821217b1ac8e5850b6
PX4 version: 1.14.0 0 (17694720)
PX4 git-branch: main
OS: NuttX
OS version: Release 11.0.0 (184549631)
OS git-hash: 3f77354c0dc88793a47ff3b57595195ab45f7ba9
Build datetime: Jun 21 2023 16:01:34
Build uri: localhost
Build variant: default
Toolchain: GNU GCC, 9.3.1 20200408 (release)
PX4GUID: 000200000000303236323039510b003d003a
MCU: STM32F76xxx, rev. Z
Simulator: Gazebo Classic 11

Flight controller

Pixhawk 4 Mini

Vehicle type

Hybrid VTOL

How are the different components wired up (including port information)

No response

Additional context

No response

DronecodeBot commented 1 year ago

This issue has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-community-q-a-june-21-2023/32764/1