Send UWB coordinates to flight controller with ROS and pymavlink

Hi everyone,
I’m developing a drone that take uwb coordinates from dwm1001-dev and send to flight controller (MATEK f405-HDTE) with ros(noetic). Each uwb sensor and flight controller are connected to orangepi zero 2w (flight controller over uart and uwb sensor over usb).
For send coordinates i’ve follow this steps with ros, and mavlink (i use python):

  • take data from dwm1001-dev, in particular anchors_id, anchors (x,y,z) position and distance, tag (x,y,z) position and distance.
  • convert this data with PoseStamped msg and publish with a topic.
  • create a node that subscribe to this topic and send this data to flight controller with two pymavlink methods: the first one to set global position (with conversion of tag coordinates from local to global and send with global_position_int() method), and the second one for local position (with set_target_position_local_ned_encode() method).
    That is from code side.
    On mission planner i’ve set those parameters:
  • GPS_TYPE = 0
  • EK3_ENABLE = 1
  • EK3_SRC1_POSXY = 4 (Beacons)
  • EK3_SRC1_POSZ = 4 (Beacons)
  • EK3_SRC1_VX = 0
  • EK3_SRC1_VZ = 0
  • SERIAL1 = MAVLink2
  • SERIAL1 Baud = 57600
  • BCN_TYPE = 1 (Pozyx)

On mission planner i see only global position, and for local data mavlink inspector create another vehicle (vehicle 1 and 255).

I choose another way by send coordinates with mavros, that probably is the best way. I send global and local coordinates with topics “mavros/setpoin_position/local” and “mavros/setpoint_position/global”. The result is the same: " PreArm: Need Position Estimate".

Could someone help me please?
I use ArduCopter 4.3.5
pymavlink version 2.4.42
Ros Noetic
Ubuntu Focal on my orangePi zero 2w (4Gb)

Thanks to everyone that will reply

Start by updating to ArduCopter 4.5.7 or even better to ArduCopter 4.6.0-beta2
Update pymavlink if that is not the latest version.

1 Like

Ok, I will update ArduCopter version. Pymavlink is the last one available.

What do you think about the other steps that i’ve follow?

You can use ROS2 directly when you use 4.6.0-beta2 bypassing the need for mavros and pymavlink.

1 Like

Update:
I have updated the ardupilot firmware on my fc, but the problem is the same. I also tried using a fake gps system, with the pymavlink gps_input () method and changing the gps_type (MAV) and ek3_src1_pos * parameters, but the problem still remains. I’m sure the data of dwm1001-dev is taken and published correctly with ros (PoseStamped position format) because the set_global_position () method sets the position on the mission planner. I don’t understand what i’m wrong.


I have to specify that in those pics i’m trying to set guided mode for send a takeoff command with pymavlink. I need that because i’m doing a particular project for my university related to autonomous missions with uwb.