-
Notifications
You must be signed in to change notification settings - Fork 288
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
common.xml: Add new MAV_SYS_STATUS_TERRAIN_FOLLOW flag #346
base: master
Are you sure you want to change the base?
common.xml: Add new MAV_SYS_STATUS_TERRAIN_FOLLOW flag #346
Conversation
@hamishwillee I asked David to create this so we could discuss this at our DevCall to see if it would be fit for our purpose. It's supposed to be analagous to the "attitude stabilization" flags in here - i.e. is the vehicle currently following terrain. We were also thinking of adding one for "am I currently actively avoiding something and modifying my trajectory because of that". @Davidsastresas we should probably discuss both at once, I think. There's the open question of whether that flag would always be set when running Dijkstra's. |
I understand what you mean. So we have present, enabled and health flags. The question is, we want to indicate to the GCS when any kind of avoidance is "active", or we want to indicate just when the particular avoidance type is actually taking control of the aircraft? Of course ideally we should have both. As we can deal with standard proximity integrating properly the MAV_SYS_STATUS_SENSOR_PROXIMITY in Ardupilot, I suggest we do the same for OA avoidance:
Or maybe we can unify both, standard avoidance and more complex OA, and deal with more details on OA later, on a different set of messages. This would be pretty cool, as right now all the setups working with this use custom mavlink to report in detail the status of OA. Maybe at some point it is worth to open this discussion. To be honest I didn't thought at all about OA, but you are totally right, now that we are opening this discussion we should give this a thought. |
As you say I think what you are proposing here it that "present" is reimagined as "present and enabled in some mode", and enabled means "active" - right? So you're dropping the idea of being able to know from the message that it is "present but not enabled" - so you can't tell as a GCS that this is an option - right? Personally I'd prefer not to mess with the current meaning - because it complicates the message to suggest you have to read the description to understand what "present" or "enabled" mean. If we actually want to know that something is actively doing its thing we could add another array for "active" at the cost of wasting most of the array for all the sensors. That's a pretty big array. Or we could have specific messages - in the same way that proximity has COLLISION. Where to start with this is to look at the use cases that might need to output "actively doing stuff". If there are just one or two then specific messages make sense. If there are many then maybe the extra array or maybe something added to COMPONENT_INFORMATION_BASIC - i.e. you get the message so you know it is present, but you could have flags for enabled and healthy or active, or whatever. Of course that only works for things that have a mavlink presence. Not advocating, just thinking about options. So what are the cases we might need this for? |
Thanks for the answer @hamishwillee . You are correct, that is exactly what I meant. But after reading your thoughts, I agree with you, it doesn't seem totally right. So, about the features we need better mavlink support, it is:
From my experience, there are particular use cases that could really benefit a lot of better mavlink support for this, like agricultural sprayers. They alternate non terrain following for getting to the places to spray, and then they do terrain following during operation, because the altitude to the ground is critical for how the product arrives to the crops. So it would be great to have feedback about when vehicle is following terrain or not, and also a dedicated mavlink command to enable/disable this would be great. What do you think? Do you think it is worth it to make dedicated messages and commands for these 2 features? Or we should find a workaround in Ardupilot? Thank you very much! |
Hi @Davidsastresas
I'll think some more. In an ideal world we want something easy to grow, and lightweight. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems good to me.
looks good to me. |
|
To be clear, this makes sense as described, which interprets the bit in-line with all the other status information. In other words, you can use it to determine if the vehicle has a terrain-following system, if that system is enabled, and if that system is healthy.
|
@Davidsastresas PS I don't really have any further thoughts on #346 (comment) whether we need separate starter commands, separate notification of terrain/avoidance systems being used, or if need to work out some kind of generic system. My gut feeling though is that separate starter/stop commands and monitoring messages is the simplest solution. But it really comes down to whether @peterbarker thinks the flash cost of new separate messages is worth the benefit. |
Thanks for the insight! I agree, separate commands and messages make the most sense, but I understand the implications of flash cost. Just to recap, In the worst case scenario, if flash cost is really a problem, my understanding is that the additional sys_status flag for terrain following is approved, and the mav_cmd definitions don't consume flash, correct? So we would only have the problem of feedback when it is actually on, actually "controlling vehicle". So the current discussion of adding or not new mavlink definitions would only affect feedback about the systems ( avoidance, terrain following ) actually "taking control" over the vehicle. Considering this, for Avoidance we really could use COLLISION message for this matter, as it has everything we need, only we would need to add a new field to MAV_COLLISION_SRC for onboard sensors, something like MAV_COLLISION_SRC_PROXIMITY_SENSORS as right now only adsb and mavlink gps are present. So in short, the above decision will only affect feedback about terrain following actually doing terrain following, correct? |
Yes, the rest of the discussion is about:
I know that adding a new message is more costly than extending a message. I think that is because there are framework costs of supporting a new message. Supporting a new enum value or command should also have some cost, but I suspect that it is likely to be relatively much lower because most of the framework cost is paid. I'm interested if this is indeed a correct set of assumptions @peterbarker. So in summary ... Yes, I think adding the mav_cmd definitions is going to be relatively cheap. You'll be writing a handler for the incoming message in the autopilot that internally sets the associated parameters or rejects if the command, if for example you don't have a range sensor. Yes, adding new messages is more expensive. Extending COLLISION is possible - create a PR upstream and we can discuss.
Yes. |
Thank you very much @hamishwillee. Let's have some more feedback from Ardupilot dev team to see how we can proceed. Thanks! |
This address the current issue of not having good mavlink feedback about terrain following