-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
simulator: add support for multi-distance_sensor instances #14143
Conversation
1223b53
to
9c2d877
Compare
Tested with the extended |
472ac32
to
ca251ac
Compare
@LorenzMeier @dagar @bkueng I RFC on how we should handle the different sensor streams on the firmware. The discussion I suppose will be between two options:
I am proposing this discussion since we do not seem to agree on the approach, and we need to align on this so we are able to bring this feature to PX4 - multi distance sensor data. Thanks in advance for your time! |
I'd like to effectively remove the system wide multi limit (or at least bump it to 9), but at the moment there are too many cases throughout the code base that would blow up. Little things like logger checking the full range of multi instances, ekf2, collision_prevention, and a few other areas having an array of all possible instances, etc. If we can get away from "that" it becomes feasible to increase multi. I also think topics should be explicitly multi or not (default) to prevent potential misuse, but that's yet another discussion. Overall I think it makes more sense architecturally to combine the data early into something like a single obstacle_distance (https://github.com/PX4/Firmware/blob/master/msg/obstacle_distance.msg) if that's effectively what all these different distances form. However, if the goal is to simulate what's actually being done on some vehicles with a bunch of distance sensors thrown together I see a small benefit to mirroring that end-to-end pipeline for now. |
…> in simulator destructor
Describe problem solved by this pull request
Extends
simulator
to support publishing data from multiple distance sensors, which are differentiated by the sensor ID.Describe your solution
Add support for multi-sensor subscription in Gazebo, which sets a different sensor ID per stream. The sensor ID is what then allows to create a different
uORB::PublicationMulti<distance_sensor_s>
per sensor.Describe possible alternatives
Extend to use a
PX4RangeFinder
per sensor stream coming from the simulation side.Test data / coverage
To be added as soon as I add an example model with multiple sensors.
Note: Right now, the update to the
sitl_gazebo
submodule also brings the multiple-VTOL simulation capability.