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 #12956

Closed
wants to merge 26 commits into from

Conversation

AmeliaEScott
Copy link
Contributor

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.

@AmeliaEScott
Copy link
Contributor Author

@dk7xe This is still in the early stages, but here it is if you want to keep up with development. Right now it is reading the data and publishing a uORB topic, but I still need to add error checking and generally clean up the code.

@hamishwillee
Copy link
Contributor

@ItsTimmy Have you thought about docs for this? Possible integration points:

/**
* @file drv_pozyx.h
*
* Pozyx device API
Copy link
Contributor

Choose a reason for hiding this comment

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

A reference to the exact thing would be nice. And it's not really a device API but just the driver, I would say.

};

struct pozyx_position_s {
int32_t x;
Copy link
Contributor

Choose a reason for hiding this comment

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

Unit?

struct pozyx_beacon_config_s {
uint8_t beacon_id;
uint8_t beacon_count;
int32_t x;
Copy link
Contributor

Choose a reason for hiding this comment

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

Unit?


/*
* Stop the driver
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary comment.


}

PX4_WARN("unrecognized arguments, try: start [device_name], stop, info ");
Copy link
Contributor

Choose a reason for hiding this comment

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

_new_irlockReport = _irlockReportSub.update(&_irlockReport);
_sensorBias_valid = _sensorBiasSub.update(&_sensorBias);

//TODO: Uncomment this so it still works with both IRLock and Pozyx
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the plan here? I don't exactly understand what this is about.

@@ -132,3 +132,51 @@ PARAM_DEFINE_FLOAT(LTEST_SCALE_X, 1.0f);
* @group Landing target Estimator
*/
PARAM_DEFINE_FLOAT(LTEST_SCALE_Y, 1.0f);

/**
* Landing target X offset from estimated position in NED
Copy link
Contributor

Choose a reason for hiding this comment

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

Body or world frame?

* @max 100.0
* @decimal 2
*
* @group Landing target Estimator
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @group Landing target Estimator
* @group Landing target estimator

@@ -549,6 +549,7 @@ void Logger::add_default_topics()
add_topic("vehicle_status", 200);
add_topic("vehicle_status_flags");
add_topic("vtol_vehicle_status", 200);
add_topic("pozyx_report");
Copy link
Contributor

Choose a reason for hiding this comment

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

This topic probably needs a more generic name.

import serial
import struct
import time

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment how this script can be used, and to do what?


#include <uORB/topics/pozyx_report.h>

#define DEFAULT_PORT "/dev/ttyS2" // telem2 on Pixhawk
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't provide a default at all. There isn't a consistent choice across boards, so just make it a requirement and use the module.yaml to make it easy to configure and start on any port.

****************************************************************************/

/**
* @file drv_pozyx.h
Copy link
Member

Choose a reason for hiding this comment

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

We should be able to move away from block devices like this (/dev/pozyx) and entirely use ORB. It's ultimately going to be more portable.

@dagar
Copy link
Member

dagar commented Oct 17, 2019

I'm just curious, in the pozyx case has anyone looked into doing it directly without the arduino sketch?

@AmeliaEScott
Copy link
Contributor Author

@dagar I don't know, I have not actually worked with Pozyx at all. All of that work was done by @cmic0 . In fact, it might be best to split that driver into a separate PR, because it is not necessary for getting the NXP driver working.

@AmeliaEScott AmeliaEScott force-pushed the pr-nxp-uwb-driver branch 2 times, most recently from 21f6116 to 7124af6 Compare October 24, 2019 11:05
@ShiauweiZhao
Copy link
Contributor

Have you started to develop UWB fusion for indoor positioning?

@AmeliaEScott
Copy link
Contributor Author

I have not. The goal of this PR is to use the UWB positioning only within the existing precision landing framework. However, once this is done, it should be easy to get the raw data from UWB and use it however you want.

Timothy Scott and others added 9 commits December 12, 2019 10:24
#float32 yaw_offset # Angle between the X axis of the UWB grid frame and true north. I.e., your compass heading if you face along the positive X axis
# The reason these values are kept in the uwb_report message is that we do not know the transform between the
# UWB coordinate system and the world coordinate system. Different UWB systems might have different mechanisms for
# this, so the UWB driver should handle it. Unless you
Copy link
Contributor

Choose a reason for hiding this comment

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

Unless you?

@@ -279,22 +279,24 @@ void LandingTargetEstimator::_update_topics()
return;
}

if (!PX4_ISFINITE(_uwbReport.pos_y) || !PX4_ISFINITE(_uwbReport.pos_x) ||
!PX4_ISFINITE(_uwbReport.pos_z)) {
if (!PX4_ISFINITE(_uwbReport.target_pos_y) || !PX4_ISFINITE(_uwbReport.target_pos_x) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is y before x?

new Uorb Topics
Changed Distance message according to new process
@stale
Copy link

stale bot commented May 30, 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 May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants