-
Notifications
You must be signed in to change notification settings - Fork 337
Display OBSTACLE_DISTANCE in QGC #460
Comments
@dogmaphobic The message for this is: What I'm looking for is a baseline implementation that we can then tune interactively with the Autonomy team and Stefan. |
What exactly is This: Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive values are offsets to the right. Doesn't explain much. Suppose I have 3 sensors. One pointing straight ahead, one 15° to the right and the other 15° to the left (345°). Also, the array length is even, making the left/right values asymmetric. |
It's in the local frame, not the vehicle frame. We should probably make that more clear in the message definition. |
Ok, how do I find "straight ahead" from this? index 0 corresponding to local forward + angle_offset. And how would the above, 3-sensor example be represented in the array? |
@mhkabir Really? I would definitely interpret docs This is how I interpret it according to what is written:
I don't know if I'm "right" but my understanding, but Case 1
Case 2
I guess we need to know how it has been implemented to progress. |
Just for completeness, since @dogmaphobic found my description useless. Note in both cases I assume that the frame is the vehicle heading = 0 degrees. NOT North = 0degrees. Case 1 - old style message where the points are evenly spread relative to front of vehicle. Not very flexible. Case 2. new message. Distance array is for a chunk of data at starting at some angle relative to the 0 degree position (front of vehicle) with fixed increment spacings. May take multiple messages to cover the whole range, and this allows different messages to have different spacing of sensors. Caveat, I guess either all messages for sensor have to be sent in a burst so they are all relative to the same heading. Probably should add something to allow better sync. |
@dogmaphobic - The table sums up the possible states of the OA system. My idea is to show the user a single icon that captures both if the OA is enabled and healthy.
We also would need a switch in QGC to enable OA that basically sets COM_OBS_AVOID to 1 and |
I think you guys are making this more complicated than it is. In the case of a forward facing camera with a 90deg wide view (45 left, 45 right) a message would look like: If the camera is facing directly backwards I found a Lidar simulator that likes to deliver it's 360 data in CCW order. I'd also like to note that the left-to-right increment is not necessarily a hard requirement. That's just the positive increment direction. On ArduPilot a negative increment means left (CCW). |
What if you have 4 of those pointing in all 4 directions? Will it send 4 messages, one for each or will it consolidate all into one message? |
My current implementation assumes one single message. A subsequent message would override the previous one (the previous distance slots). There is no way to identify which sensor a message is coming from. |
What implementation? In the case of Ardupilot, you can receive multiple messages and they "add" internally. No need to identify them other than angle and increment |
Add to where? What GCS does this? How do you keep track of angle slots given that you have unpredictable (floating point) increment values that can be different from sensor to sensor? I guess I could keep an array and arbitrarily set its length to 360 and "fit" the distances within those slots. That would work. But I still don't know how to handle a case of a sensor going bad and stop sending data. I would not be able to detect that. Any distance set on its set of distances would get "stuck". Again, I could again add code to age these values out over time. Either way, none of this is documented. |
Please take a look at the implementation. |
The Ardupilot and PX4 approaches are very different here. In PX4, if there are onboard distance sensors that are configured for collision prevention, it will use those sensors and then publishes a single fused OBSTACLE_DISTANCE message. This will be fused with the data received from an external OBSTACLE_DISTANCE message. The idea is then that that the GCS could use this to display the data that the FCU is actually using to avoid, without having to attempt to replicate perfectly the internal fusion algorithm. Conversely, PX4 does not support multiple sources sending OBSTACLE_DISTANCE messages. They need to be fused externally before sending them in. Unfortunately it would require some fairly major architecture changes to support this. |
@magicrub I discussed briefly with @dogmaphobic, it seems it would be quite a pain to replicate the multi-message fusion inside of the GCS. Would it work on AP side to publish the internal data as a new OBSTACLE_DISTANCE message for the GCS to consume? It looks like it would be fairly easy, there are already the |
@magicrub it looks to me like the MAVLink message definition doesn't allow for negative increments.
So either we need to update that description, or shouldn't support negative increments. |
@jkflying ahh yes, true. The negative is only supported on the float version. Description needs to be updated. It was something I just recently added though so I doubt PX4 supports it yet. Are you willing to update the docs or would you like me/someoneElse to? |
Could you update the docs? I'll get support into PX4 ASAP 👍 |
Done by @mrivi |
Done in mavlink/qgroundcontrol#9720 |
QGC issue mavlink/qgroundcontrol#7670
The text was updated successfully, but these errors were encountered: