Offboard fixed wing position control

#1

Hi there,

for my research project, I would like to control a fixed wing UAV from outside the flight stack. After implementing the MAVROS offboard example, I modified the publisher to:

ros::Publisher target_pos_pub = nh.advertise “mavros_msgs::PositionTarget”
(“mavros/setpoint_raw/local”, 10);

and adjusted

mavros_msgs::PositionTarget target;
target.header.stamp = ros::Time::now();
target.coordinate_frame = 8;
target.type_mask=0b010111000111;

to send velocity and yaw rate setpoints.

The offboard node seems to correctly publish the topic, since both the Iris and VTOL airframes (Gazebo) take off and fly as expected. However, the fixed wing plane does not.
I took a closer look at the position_setpoint_triplet and the vehicle_attitude_setpoint topics, to conclude that the fw_pos_control_l1 module does not transform the position setpoints to attitude setpoints as expected (in offboard mode). Whereas the mc_pos_control does publish roll, pitch, yaw, yaw rate and thrust setpoints, the fw_pos_control does not.

To be honest, I do not have a clue on how to make it work. Can someone take a look at this please? Any help would be greatly appreciated. Thanks!:grinning:

#2

Hm, that’s a good question. I’m not sure if offboard control is enabled for fixedwing. Fixedwing are usually controlled using mission items (waypoints). Is that not an option?

#3

@JulianOes, are you saying that the PX4 firmware doesn’t allow fixedwings to receive new heading deviation during the flight from an onboard computer (e.g. to avoid an obstacle), and this is only supported on multirotors?

#4

I’m not sure but from what I know fixedwing doesn’t have obstacle avoidance yet. And I’m not sure if fixedwing supports offboard control.

#5

Thanks for your replies! In the end, the goal is to send altitude, velocity (preferably airspeed), and heading angle setpoints in real-time. The plane should then be able to (very) closely follow a path in a HITL simulation.

For now, I think it is good to know if there are people able to make the fixed wing position controller transform the position setpoint messages in offboard mode. And how they managed.
Or should I focus on the multicopter control for offboard mode?

#6

I’m going to ask on slack, let’s see if there is anyone.

1 Like
#7

I believe the attitude setpoint works with fixed wings in offboard mode. It seems like this would be more reasonable than publishing position setpoints

#8

Unfortunately, there was no response on Slack. I think the best thing you can do is dive into the code and try out things in simulation an see how far you get.

I’d be interested to add offboard control for fixedwing to the DronecodeSDK if we manage to find out what’s supported.

#9

Hey, I am working on same topic for a project now. However, my skills are mostly related to aerodynamics part. Is there any development with your search about this topic? I would like to get some help and ideas :slight_smile: Thanks!

#10

Hi @khrmnefe so you also want to use offboard fixed wing position control?