Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] The coordinate system of the drone cluster is wrong. Each drone has its own coordinate system. #23636

Closed
XXLiu-HNU opened this issue Sep 1, 2024 · 6 comments

Comments

@XXLiu-HNU
Copy link

XXLiu-HNU commented Sep 1, 2024

Describe the bug

BackGround:
We use RTK for UAV swarm location. But we don't know how to use the same coordinate for each UAV. Becase each UAV treats the starting position as the coordinate origin. So, we want set the local_position by calculating the latitude and longitude height of the UAV.

To Reproduce

  1. Correctly set up the drone hardware and base station.
  2. Communicate via DDS sudo MicroXRCEAgent serial /dev/ttyUSB0 -b 300000
  3. Each drone performs the same steps
  4. Print drone locationros2 topic echo /px4_*/fmu/out/vehicle_local_position
  5. The position of each drone is (0, 0, 0), which seems to be because when performing EKF2, the starting position is set to the origin by default.

Expected behavior

Then we want all drones to have the same coordinate system

Software Version

V1.15

Flight controller

cuav x7

Vehicle type

Multicopter

@XXLiu-HNU XXLiu-HNU changed the title [Bug] When flying multiple drones outdoors, VehicleLocalPosition is all (0, 0, 0) [Bug] The coordinate system of the drone cluster is wrong. Each drone has its own coordinate system. Sep 1, 2024
@matteodelseppia
Copy link
Contributor

Why not simply using latitude/longitude coordinates then?

@XXLiu-HNU
Copy link
Author

Why not simply using latitude/longitude coordinates then?

To tell you the truth, we're all newbies and don't know much about PX4. How should we set it up? What parameters need to be modified

@matteodelseppia
Copy link
Contributor

Just use /px4_*/fmu/out/vehicle_global_position

@bresch
Copy link
Member

bresch commented Sep 9, 2024

I agree with @XXLiu-HNU that using lat/lon/alt is probably the best but an alternative solution that works well if the drone are not flying too far from each other and stay near their startup location (e.g.: drone show) is to manually set the origin of their local frame to the same coordinates using https://mavlink.io/en/messages/common.html#SET_GPS_GLOBAL_ORIGIN

I'll close the issue as this is not a bug.

@bresch bresch closed this as completed Sep 9, 2024
@XXLiu-HNU
Copy link
Author

I agree with @XXLiu-HNU that using lat/lon/alt is probably the best but an alternative solution that works well if the drone are not flying too far from each other and stay near their startup location (e.g.: drone show) is to manually set the origin of their local frame to the same coordinates using https://mavlink.io/en/messages/common.html#SET_GPS_GLOBAL_ORIGIN

I'll close the issue as this is not a bug.

I have try, but it seem not supported, We use ROS2 galactic and the version of PX4 is 1.15. Here is the output:
2344940833

@bresch
Copy link
Member

bresch commented Sep 13, 2024

@XXLiu-HNU That's unfortunate. The message is for sure supported in PX4, it's probably something on the mavros side. Unfortunately I can't really help you with mavros.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants