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

Add support for NXP UWB position sensor Take 2 #14474

Merged
merged 2 commits into from
Apr 4, 2022

Conversation

LowOrbitIonCannon
Copy link
Contributor

This is a continuation of #12956.

I made 2 new Messages:
Grid Survey Result
Distance Result

Things To do:

  • Restructure the Rddrone flow
  • Add Position Algorithm
  • Make Uorb publishing cleaner
  • ?make Position Algorithm run simultaneously?

UWB-PX4 Relationship diagram
UWB-PX4_REL2

Old PR:

Describe problem solved by the proposed pull request
Based on #9029. This PR adds a driver for the NXP RDDrone UWB system, and integrates it with the existing precision landing code.

Test data / coverage
I held the sensor in my hands, spun around in my chair, and looked at the logs.

This is a WIP, I have not tested much.

@dk7xe @julianoes

@julianoes julianoes self-requested a review March 25, 2020 08:31
Copy link
Contributor

@julianoes julianoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You added the submodule dspal. I assume that was by accident. I suggest to always use git add -p to avoid that.

I made a couple of small comments. I can again review later. And you can also ask me to review specific parts.

Tools/test_pozyx.py Outdated Show resolved Hide resolved
Tools/test_pozyx.py Outdated Show resolved Hide resolved
Tools/test_pozyx.py Outdated Show resolved Hide resolved
Tools/test_pozyx.py Outdated Show resolved Hide resolved
msg/uwb_distance.msg Outdated Show resolved Hide resolved
src/drivers/uwb/rddrone/rddrone.cpp Outdated Show resolved Hide resolved
src/drivers/uwb/rddrone/rddrone.cpp Outdated Show resolved Hide resolved
src/drivers/uwb/rddrone/rddrone.cpp Outdated Show resolved Hide resolved
src/drivers/uwb/rddrone/rddrone.cpp Outdated Show resolved Hide resolved
src/drivers/uwb/rddrone/rddrone.cpp Outdated Show resolved Hide resolved
@LowOrbitIonCannon
Copy link
Contributor Author

I cant see where i added that submodule.

Thank you for your Review, i added most changes. Ill commit it asap.

Iam also not happy with the structure of rddrone::run.
I hope we can use UAVCAN soon.

@thusjr
Copy link

thusjr commented Jul 15, 2020

I'm really glad to find that pull request.
I'm new to develop PX4. I'm confused for several days that using uORB to public data , and after that, how can EKF2 or other estimate modules use that data without rewrite that module?
thx a lot!

@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label Dec 25, 2020
@stale stale bot removed the stale label Jan 15, 2021
@LorenzMeier
Copy link
Member

What is the status here?

@dk7xe
Copy link
Contributor

dk7xe commented Feb 1, 2021

What is the status here?

Hi Lorenz,

due to a change to newer HW Loic had to rewrite the SW on the S32K.
Thats done now. But due to Corona restrictions and lousy weather we are not able to perform any Tests at the moment.
Hope to get this done by March.

@LowOrbitIonCannon
Copy link
Contributor Author

LowOrbitIonCannon commented Jan 27, 2022

This new Driver is based on MK UWB Shield 2 SR150 hardware and on the new MR_UWBNAV SW project.
The Hardware is available from Mobile Knowledge:
https://www.themobileknowledge.com/product/mk-uwb-kit-rtls/

I modified the uwb_r4 driver to reflect the new MR_UWBNAV project.
The uwb_sr150 should work as a prototype for further work on UWB.

We did some test Flights showing that the current UWB system allows for a Precision Landing:
Preclanding 0 Drone 24
Preclanding 1 Drone 12
Preclanding 2 Drone 12
Preclanding 3 Drone 12
A Video is pending.

Merging master into my driver caused a few conflicts. That is why I did a bench test using UWB, to confirm that the Landing_target_estimator is behaving correctly:
Benchtest Drone 24

@ThomasDebrunner @dk7xe

@LowOrbitIonCannon LowOrbitIonCannon marked this pull request as ready for review January 27, 2022 15:35
@dk7xe
Copy link
Contributor

dk7xe commented Jan 28, 2022

@ThomasDebrunner @julianoes may you please review and approve. Thank you!
Cheers, Gerald

@LowOrbitIonCannon
Copy link
Contributor Author

I fixed the Issues like formating and the module config.
I updated the Licence to 2022 and resolved all conversations

@dagar
Copy link
Member

dagar commented Feb 26, 2022

This should be safe to merge once we get it through CI cleanly.

@julianoes julianoes removed their request for review March 6, 2022 23:52
@LowOrbitIonCannon
Copy link
Contributor Author

I Removed the atribute((packed)) as this was spawning an error in CI.

I ran "quick_check" and other make targets on my Dev. environment and they came back ok.
Could you please kick off the CI test?

@dagar @ThomasDebrunner

@LowOrbitIonCannon
Copy link
Contributor Author

By merging the latest Master into my branch, make checks also compiled
This should be ready now.
@ThomasDebrunner

Copy link
Contributor

@potaito potaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of general remarks:

  • Do you ultimately want to squash everything or are there some atomic comits that you would like to keep? Asking because this PR is nearing to 100 commits 😅
  • Is UWB only used for precision landing here?

Tools/test_pozyx.py Outdated Show resolved Hide resolved
Tools/test_pozyx.py Outdated Show resolved Hide resolved
msg/uwb_distance.msg Show resolved Hide resolved
msg/uwb_distance.msg Outdated Show resolved Hide resolved
msg/uwb_grid.msg Outdated Show resolved Hide resolved
src/drivers/uwb/uwb_sr150/uwb_sr150.cpp Outdated Show resolved Hide resolved
src/drivers/uwb/uwb_sr150/uwb_sr150.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@potaito potaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes so far, looks better now. I just have a few more remarks.

src/modules/navigator/precland.cpp Outdated Show resolved Hide resolved
src/modules/navigator/precland.cpp Outdated Show resolved Hide resolved
src/modules/navigator/precland.cpp Outdated Show resolved Hide resolved
msg/uwb_distance.msg Outdated Show resolved Hide resolved
msg/uwb_distance.msg Outdated Show resolved Hide resolved
msg/uwb_grid.msg Outdated Show resolved Hide resolved
Copy link
Contributor

@potaito potaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Only a few more comments. I also took the liberty to remove some extra lines in the uwb_sr150 driver.

msg/uwb_grid.msg Outdated Show resolved Hide resolved
msg/uwb_grid.msg Outdated Show resolved Hide resolved
msg/uwb_grid.msg Show resolved Hide resolved
msg/uwb_distance.msg Outdated Show resolved Hide resolved
src/drivers/uwb/uwb_sr150/uwb_sr150.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@potaito potaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Precision landing simulation is not working anymore with this PR:

 make px4_sitl gazebo_iris_irlock

When LTEST_MODE is set to 1 (stationary), the drone becomes unstable. This suggests that the estimate coming out of landing_target_estimator is incorrect and feeds false information to EKF2, the drone's onboard position and attitude estimator.

When marking the IR beacon as moving with LTEST_MODE=0, the drone is stable again, probably because EKF2 no longer uses it as a landmark for its own estimation. However, once precision landing is activated, the drone will drift into the wrong direction.

I assume that both issues have the same underlying root cause, and that something is wrong with how irlock_report messages are now processed. Didn't look into logs or anything yet.

potaito
potaito previously approved these changes Apr 1, 2022
Copy link
Contributor

@potaito potaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now, but we need free up some flash space before this can be brought in 😬

Memory region         Used Size  Region Size  %age Used
           flash:     1032641 B      1008 KB    100.04%
            sram:       27192 B       192 KB     13.83%
          ccsram:          0 GB        64 KB      0.00

This was the memory use before this PR:

 Memory region         Used Size  Region Size  %age Used
           flash:     1032085 B      1008 KB     99.99%
            sram:       27192 B       192 KB     13.83%
          ccsram:          0 GB        64 KB      0.00%

@potaito
Copy link
Contributor

potaito commented Apr 4, 2022

With last commit it fits into flash now:

Memory region         Used Size  Region Size  %age Used
           flash:     1025601 B      1008 KB     99.36%
            sram:       27192 B       192 KB     13.83%
          ccsram:          0 GB        64 KB      0.00%

LowOrbitIonCannon and others added 2 commits April 4, 2022 14:15
uwb_sr150 driver for the sensor, and some
modifications in precision landing to allow
landing on a platform using the UWB system.
Copy link
Contributor

@potaito potaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go 👍

@potaito potaito merged commit 47b08fd into PX4:master Apr 4, 2022
@dk7xe
Copy link
Contributor

dk7xe commented Apr 4, 2022

👍

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

Successfully merging this pull request may close these issues.

None yet

7 participants