Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Manual throttle cut when publishing direct actuator controls #24032

Open
qtweng opened this issue Nov 23, 2024 · 3 comments
Open

[Bug] Manual throttle cut when publishing direct actuator controls #24032

qtweng opened this issue Nov 23, 2024 · 3 comments

Comments

@qtweng
Copy link

qtweng commented Nov 23, 2024

Describe the bug

On the new PX4 uxrce interface, when publishing consistent stream of OffboardControlMode in direct actuator control mode, ActuatorServos, and ActuatorMotors to a Fixed-Wing. Whenever trying to take off in manual mode, as airspeed goes positive, manual throttle is somehow being affected and is getting cut.
Verified that it has something to do with vehicles in motion as manual mode can full throttle just fine if aircraft is held down. But when running with the aircraft in hand and throttling with RC causes throttle to oscillate between 1 and 0. This only occurs when an onboard companion computer is communicating with PX4.

To Reproduce

  1. Run PX4 on fixed wing and connect a companion computer using ROS2 uxrce agent
  2. Have ROS2 publishing consistent message to OffboardControlMode, ActuatorServos, and ActuatorMotors
  3. Try to takeoff (or throttle when moving vehicle) in manual mode

Expected behavior

As a stream of OffboardControlMode and the respective Actuator messages must be active when switching to offboard mode. They are required in the background even in other modes, but should not affect other modes.

Screenshot / Media

No response

Flight Log

https://logs.px4.io/plot_app?log=0957a02e-497a-465d-aa68-9dbd69ed181e

Software Version

PX4 1.15.2

Flight controller

Cube Orange Plus

Vehicle type

Fixed Wing

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

No response

Additional context

No response

@qtweng
Copy link
Author

qtweng commented Nov 23, 2024

https://logs.px4.io/plot_app?log=26a6c52a-d79d-45fa-af19-aa769c393194
Another flight log of the same scenario without positive airspeed.

@qtweng
Copy link
Author

qtweng commented Nov 24, 2024

Upon further investigation, it appears that it is caused by publication to ActuatorMotors and ActuatorsServos in Manual Mode. It looks like those offboard messages work at a lower level than manual mode which passes through the mixer.

This may just be a documentation fix. Only an active OffboardControlMode signal is required for offboard mode to be toggled. ActuatorMotors and ActuatorServos should not be publishing until offboard mode is active.

@beniaminopozzan
Copy link
Member

@qtweng unfortunetely there is not low level handling or routing when publishing setpoints (pos, vel, attitude, rates, thrust/torque, direct). This is a know issue with the only workaround as follows:
You publish OffboardControlMode messages but no setpoints. you switch to offboard and only after confirming that you switched you start publishing setpoints (Atuator Motors and ActuatorServos in your case).

You have to be quite fast in detecting offboard mode switch and start publishing setpoints because PX4 will have publish nothing in between. Consider adding a failsafe mechanism in the ROS 2 side that stops the OffboardControlMode publisher so that PX4 can trigger the Offboard control lost failsafe and recover.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants