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

Drone do not take off in offboard control example #20667

Closed
biagio-trimarchi opened this issue Nov 24, 2022 · 6 comments
Closed

Drone do not take off in offboard control example #20667

biagio-trimarchi opened this issue Nov 24, 2022 · 6 comments
Labels

Comments

@biagio-trimarchi
Copy link

Describe the bug

I am following the "ROS 2 Offboard Control Example" in the documentation: https://docs.px4.io/main/en/ros/ros2_offboard_control.html
The simulated drone arms the motor but does not take off as expected.

To Reproduce

Steps to reproduce the behaviour:

  1. Run gazebo simulation: make px4_sitl gazebo
  2. Run QGroundControl
  3. Run micro ROS agent for communication: micro-ros-agent udp4 --port 8888
  4. Run offboard control example from the package provided in the documentation: ros2 run px4_ros_com offboard_control
  5. Now the drone arms the motor and stays still

Expected behaviour

I would expect the drone to take off.

Screenshot

Schermata da 2022-11-24 14-17-28

@fabrizioschiano
Copy link

I had the same issue regarding the No Manual Control input and solved it by doing the following:

wget https://d176tv9ibo4jno.cloudfront.net/latest/QGroundControl.AppImage
  • Install QGroundControl
chmod +x ./QGroundControl.AppImage
  • Run QGroundControl (Check if the software works on your computer).
./QGroundControl.AppImage

Then, enable virtual joystick to deactivate No Manual Control Input. As reported in this forum, a joystick is required for safety reasons in OFFBOARD mode. The Failsafe mode can be avoided in simulation. However, you should not do this while using a real drone. It is dangerous as you do not have a manual backup to recover the drone!
To enable virtual joystick go to: Select Tool (big Q in the top-left corner) -> Application Settings. Select the option virtual joystick. NOTE: This is needed only once, QGroundControl will save this configuration.

@Jaeyoung-Lim
Copy link
Member

@biagio-trimarchi You need to switch the vehicle into offboard mode

@biagio-trimarchi
Copy link
Author

I was able to run the example only after executing the command:

  • commander mode offboard
    on the px4 terminal as suggested by @Jaeyoung-Lim.
    Shouldn't the offboard mode be activated by the ROS2 node provided in the example?

@Jaeyoung-Lim
Copy link
Member

Jaeyoung-Lim commented Nov 25, 2022

Shouldn't the offboard mode be activated by the ROS2 node provided in the example?

@biagio-trimarchi Not really, that is not the default behavior - It is not safe to automatically enable offboard if you are testing on a real platform. Especially given that ros2 you are publishing internal uorb messages directly.

@biagio-trimarchi
Copy link
Author

Thanks for the explanation. :)

@ElliotHYLee
Copy link

ElliotHYLee commented Nov 26, 2022

To enable virtual joystick go to: Select Tool (big Q in the top-left corner) -> Application Settings. Select the option virtual joystick. NOTE: This is needed only once, QGroundControl will save this configuration.

I had the same issue and was able to resolve thanks to this thread.

Could I know what the QGC virtual joystick option does for the PX4 internally? Does it configure any parameters of any module in PX4 via mavlink or so? If not, is the gazebo somehow directly talking to QGC? I checked that if I don't turn on QGC, it does not hover.

For debugging purposes (no battery and PWM wires are connected), if I force to turn off this safety feature, which part should I look into?

Thanks in advance.


I found that COM_RCL_EXCEPT = 4 would do it wihtout QGC. Yet, it's still murky how QGC's virtual joystick does it.

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

No branches or pull requests

4 participants