ctu-mrs / mrs_uav_managers

High-level UAV managers in ROS, part of the "mrs_uav_core" package.
https://github.com/ctu-mrs/mrs_uav_core
BSD 3-Clause "New" or "Revised" License
13 stars 5 forks source link

Flying with external Odometry source #5

Closed frapit closed 2 years ago

frapit commented 2 years ago

Hi, thank you for publishing your great software stack!

I just started experimenting and I did not dig too deep into the code yet, so this is more of a high level question. Which modifications would be necessary to fly with an external odometry source? My setup involves another device publishing its VIO directly to the pixhawk or an external motion capture system doing the same. I would now need to setup mrs_odometry to simply use the pixhawk odometry published over mavros as only integrator and disable all other odometry sources. As an alternative I could republish the pose estimates and use it as input for the VIO integrator of mrs_odometry. That seems to be the wrong approach as it would get the same values twice. A third option would be to completely fly without mrs_odometry and without Constraint and Gain Manager as well but then I would need to provide the topics needed by the other modules (/uav*/odometry/uav_state, /uav*/odometry/odom_main ) manually.

Do you have any suggestions? Which one would be the simplest / preferred approach in the mrs universe? Thanks a lot!

klaxalk commented 2 years ago

Hi, thank you for publishing your great software stack!

Hey, thanks! Really appreciate the feedback :-).

I just started experimenting and I did not dig too deep into the code yet, so this is more of a high level question. Which modifications would be necessary to fly with an external odometry source? My setup involves another device publishing its VIO directly to the pixhawk or an external motion capture system doing the same.

So do I understand correctly that you have some kind of a receiver for MoCap and/or a VIO device plugged directly into the Pixhawk? If so, then I expect that you have set the Pixhawk to fuse it internally as a "fake GPS".. ?

I would now need to setup mrs_odometry to simply use the pixhawk odometry published over mavros as only integrator and disable all other odometry sources. As an alternative I could republish the pose estimates and use it as input for the VIO integrator of mrs_odometry. That seems to be the wrong approach as it would get the same values twice. A third option would be to completely fly without mrs_odometry and without Constraint and Gain Manager as well but then I would need to provide the topics needed by the other modules (/uav*/odometry/uav_state, /uav*/odometry/odom_main) manually.

If my previous assumption is true, then you should be able to fly with is in the "GPS setting for mrs_odometry". In order to verify that this is possible, check if the latitude and longitude coordinates in /uav*/mavros/global_position/global are changing, as well as the pixhawk's local estimate in /uav*/mavros/local_position/odom.

Do you have any suggestions? Which one would be the simplest / preferred approach in the mrs universe? Thanks a lot!

Otherwise, I would suggest feeding the data into the appropriate input of the _mrsodometry, i.e., vslam input in the case of the VIO. I am not certain which input to use in the case of the MoCap, that would depend on what sort of data you can get from it (do you get just position, or velocity too?).

It should not be a problem to let it be fused in both the Pixhawk and the mrs_odometry. When we fly using our system, using, e.g., VSLAM, it does not matter what the Pixhawk has for its position measurement. It could be GPS, or nothing... in this scenario, we just output desired angular velocities and use Pixhawk's attitude estimate (and baro vel).

frapit commented 2 years ago

Thanks for the quick response!

So do I understand correctly that you have some kind of a receiver for MoCap and/or a VIO device plugged directly into the Pixhawk? If so, then I expect that you have set the Pixhawk to fuse it internally as a "fake GPS".. ?

Exactly, I have a VIO device (voxl flight deck) connected directly with the px4. I fly completely without gps and setup the EKF2_AID_MASK and EKF2_HGT_MODE to not use GPS/Baro but the vio data. I did not enable the fake GPS feature, so no global position is available atm.

If my previous assumption is true, then you should be able to fly with is in the "GPS setting for mrs_odometry".

I could try to setup the fake GPS from the local position then this will probably be the easiest way.

It should not be a problem to let it be fused in both the Pixhawk and the mrs_odometry.

Great, then I will publish to the vslam integrator in case the previous approach doesn't work out.

Thanks for your help. I will update the post with some feedback when I get it to fly.