Open RotorBoy2020 opened 3 years ago
Is anyone aware of some links with example code/missions for planes using MAVROS, PX4-SITL, Gazebo, and rospy?
Any help would be greatly appreciated.
@RotorBoy2020 Are you sure you can get PX4 into offboard mode?
For me offboard mode for fixedwing vehicles work as intended
I am trying to achieve same as well. With EKF2_AID_MASK=1(GPS only) it works as intended but the type_masks in the Mavlink documentation not working. However, if you are trying to fly the plane with Offboard mode using external position and EKF2_AID_MASK=24 it is not working at all. Although the positioning signal produces perfect data the FCU firmware acts really weird and not responding to Offboard messages at all.
https://akshayk07.weebly.com/offboard-control-of-pixhawk.html Use this code instead. It doesn't give this error. You can compare the codes and see what is the issue
Hello,
I am working on writing a custom offboard node using rospy that uses the PX4/SITL/gazebo-plane. I have read through several links (available below) and have been able to fly a drone using the MAVROS framework, both in gazebo and IRL.
I am looking to code a similar workflow that uses a fixed wing plane, however the plane does not behave as expected. Although I publish to
/mavros/setpoint_position/local
, the plane does not even attempt to go to that position. In fact, it takes off, wildly turns 90 degrees and lands shortly after takeoff - sometimes gracefully but often not. It seems no matter what I do, the plane does not respond to anything published/mavros/setpoint_position/local
. As a sanity check, I run the same code with the drone, and the drone works as expected. I'm thinking because the plane has additional motion constraints, the offboard code needs to be altered. Unfortunately, there are few online references related to offboard fixed wing control.I have included my code down below, for reference. If someone could please look it over, I'd really appreciate it! Thank you
Link 1 - PX4 offboard mode: https://docs.px4.io/master/en/ros/mavros_offboard.html Link 2 - types of messages supported with offboard PX4-plane: http://docs.px4.io/master/en/flight_modes/offboard.html Link 3 - a sperate PX4 offboard mode page, with python code: https://akshayk07.weebly.com/offboard-control-of-pixhawk.html
Issue details
MAVROS SITL Gazebo plane not working as expected. I publish to
/mavros/setpoint_position/local
, but the plane does not go to this location. It takes off veers wildly off course and crashes shortly after takeoff.MAVROS version and platform
Mavros: 0.18.4 ROS: Melodic Ubuntu: 18.04 Gazebo: 9
Autopilot type and version
[ ] ArduPilot [X] PX4 - v1.11.0-stable
Node logs
My offboard code