Unexpected behaviour running debian package of mavros on RPI

Hi!

Currently I am trying to fly a drone in OptiTrack, for clarification I will note down the versions used on the pc, rpi and px4.

PX4:

  • Firmware 1.11.2 (stable version)

RPI4B 4gb:

  • Ubuntu Server 18.04
  • ROS Melodic
  • Mavros installed through debian packages
  • PX4 connected to RPI using the USB ports -> /dev/ttyACM0:57600

Laptop:

  • Ubuntu 18.04
  • ROS melodic
  • mavros installed from source (using a workspace, e.g. catkin_ws)

Behavior running mavros on RPI using roslaunch mavros px4.launch on the RPI through ssh:

  1. With RC:
  • Drone is rejecting offboard
  • Drone can still be armed
  1. Without RC:
  • Drone is accepting offboard
  • Drone arms
  • Drone does not respond to the position setpoints set. When I use listener vehicle_local_position_setpoint inside the mavlink shell the topic states empty.

Behavior running mavros through laptop while the px4 is connected to a really long USB cable to my laptop (with or without RC, so both works):

  • The drone switches to offboard
  • The drone arms
  • The drone takes off to the desired position
  • vehicle_local_position_setpoint is filled

From the behavior stated above I can conclude that actually everything is working while the laptop (running the mavros node) is connected with the px4 through USB. However, as soon as I want to run the mavros node on the RPI (so I can send position setpoints through wifi) the system shows unexpected behavior.

My question:
Even though I can confirm that the /mavros/setpoint_position/local topic is populated as expected (>2Hz) the drone is clearly not receiving them. Is there any difference in the debian packages of mavros and source installation? What kind of installation procedure is recommended for the RPI?

EDIT: If I install from source on the RPI. While rostopic echo /mavros/state I get the following error in the RPI roslaunch mavros px4.launch from catkin_ws:
[ERROR] [1606231767.051858943]: Client [/rostopic_3987_1606231762157] wants topic /mavros/state to have datatype/md5sum [mavros_msgs/State/ce783f756cab1193cb71ba9e90fece50], but our version has [mavros_msgs/State/65cd0a9fff993b062b91e354554ec7e9]. Dropping connection.

If you have any more questions please contact me so I can clearify. Hoping to find a solution soon.

Best regards,
Edwin

The only thing I can think of is that you probably have two different versions of Mavros and there is some incompatibility causing the problem. The Debian Mavros packages are almost certainly older than the version you built from source code. It might be worth building Mavros from the same source as the laptop on the RPi and see if that solves the problem.