Achieving FW offboard control via ROS2

Does anyone have a offboard control example for a fixed-wing drone? All I can really find is this Offboard Mode | PX4 User Guide but all those messages (id 82, 84, 87) are unlisted in VehicleCommand.msg. Is it possible to send raw mavlink messages via ROS2?

@Jan-Hendrik_Ewers Offboard control does not work with VehicleCommand or MAV_CMD_ mavlink messages, therefore I am not sure what you are looking for.

If you send mavlink setpoints, they will work with fixedwing as documented in the userguide.

@Jaeyoung-Lim maybe offboard control is the wrong term. I’m just looking for any examples of FW being controlled via ROS2.

So the setpoints like “AttitudeSetpoint_PubSubTopic”, “PositionSetpoint_PubSubTopic”, etc.?

Could you point me towards that section of the userguide? I must have missed it.

@Jaeyoung-Lim was right, using the setpoints worked well. I am currently testing the VehicleAttitudeSetpoint_PubSubTopic with roll_body = math.sin(time.time()/4)*0.05 and it’s giving very nice responses.

Should I upload the code as an example somewhere?

@Jan-Hendrik_Ewers Great! Adding it to the user guide would be definitely cool :slight_smile: GitHub - PX4/PX4-user_guide: PX4 User Guide

Hi @Jaeyoung-Lim, upon further testing it seems like I can control the FW plane using the /VehicleAttitudeSetpoint_PubSubTopic but not via /VehicleLocalPositionSetpoint_PubSubTopic.

From the px4 architecture it looks like these two feed into different controllers

Is there a block within fw_pos_control_l1?

I’m seeing the values that i’m sending within PXH but the SITL is not responding to this command.

pxh> listener vehicle_local_position_setpoint

TOPIC: vehicle_local_position_setpoint
        timestamp: 205431999  (0.128001 seconds ago)
        x: 0.0000
        y: 0.0000
        z: 0.0000
        yaw: -3.1400
        yawspeed: 0.0000
        vx: 0.0000
        vy: 0.0000
        vz: 0.0000
        acceleration: [0.0000, 0.0000, 0.0000]
        jerk: [0.0000, 0.0000, 0.0000]
        thrust: [0.0000, 0.0000, 0.0000]