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

[drivers & uORB] Differentiate distance sensors by ID's (not only by the rotation) #12720

Open
TSC21 opened this issue Aug 16, 2019 · 12 comments

Comments

@TSC21
Copy link
Member

TSC21 commented Aug 16, 2019

@dagar @DanielePettenuzzo we continue to set the ID's to 0 every time we add a new distance_sensor. This represents a problem when we have two distance sensors, facing the same direction, connected to the same I2C bus: how exactly does one differentiate between them if not through the ID? And how can that be set manually in that case, if we want to say, for example, the sensor on the left side has the ID 1 and the sensor on the right side has ID 2?

I would say that not having the possibility of manually or automatically setting the sensor IDs on a system that is aiming for supporting multiple distance sensors pointing in different directions is more a bug than a feature, so I think we need to sort out a solution to this soon enough.

Describe problem solved by the proposed feature
Make possible to differentiate between different distance sensors, even if they are pointing the same direction.

Describe your preferred solution
I say that we could differentiate the sensors based on their address on the bus - but I guess that shouldn't be something that the user should be worried about. So could we identify the sensor ID's, plugged on the same bus, based on the order that they are plugged on that bus? Not sure how that works.

@TSC21
Copy link
Member Author

TSC21 commented Aug 16, 2019

A good example of a driver where we could already bring this in is #12575. Since these kind of sensors tend to be used in numbers and pointing different directions for multiple purposes, including collision prevention.

@mhkabir
Copy link
Member

mhkabir commented Aug 16, 2019

@dagar and I wanted to get rid of this ID field, make uORB more lean and do 1 sensor per uORB multi-topic.

@TSC21
Copy link
Member Author

TSC21 commented Aug 16, 2019

@dagar and I wanted to get rid of this ID field, make uORB more lean and do 1 sensor per uORB multi-topic.

What's your suggestion to differentiate between sensor streams?

@dagar
Copy link
Member

dagar commented Aug 17, 2019

One option is to treat them the way we've handled other sensors (accel, gyro, mag). Maintaining a table of unique device types (https://github.com/PX4/Firmware/blob/master/src/drivers/drv_sensor.h) and each instance then has a device id (device type + bus + address).

From that point the configuration of each distance sensor instance would be similar to the setting each external mag rotation.

@DanielePettenuzzo
Copy link
Contributor

@dagar we also need a mechanism to have multiple sensors of the same type on the same I2C bus. @TSC21 and I looked at the lidar lite and the startup sequence should be that all sensors are disabled (via GPIO to the lidar) and then we pull them up one by one so we can change their I2C address. Is there any driver that already does something similar?

@TSC21
Copy link
Member Author

TSC21 commented Aug 27, 2019

@DanielePettenuzzo any progress on this matter?

@TSC21
Copy link
Member Author

TSC21 commented Sep 2, 2019

First step in #12864

@stale
Copy link

stale bot commented Dec 1, 2019

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 1, 2019
@TSC21
Copy link
Member Author

TSC21 commented Dec 1, 2019

This is still relevant and needs to be solved.

@stale stale bot removed the stale label Dec 1, 2019
@stale
Copy link

stale bot commented Feb 29, 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 Feb 29, 2020
@TSC21 TSC21 removed the stale label Feb 29, 2020
@TSC21
Copy link
Member Author

TSC21 commented Mar 24, 2020

@dagar this is still to solve.

@stale
Copy link

stale bot commented Jun 23, 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 Jun 23, 2020
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

4 participants