ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
10.92k stars 17.41k forks source link

Rover: Depth Fence for Arduboat #19104

Closed geofrancis closed 2 years ago

geofrancis commented 2 years ago

Now that rover firmware can read water depth it really needs a way of avoiding shallow water and running aground, the simplest way of doing this would be an altitude fence so its triggered if sonar depth is below a set value. Currently, all altitude fences have been disabled on Rover firmware so there is no way of setting any kind of vertical limits on rovers.

IamPete1 commented 2 years ago

The problem is deciding what to do, because the reading is for depth under the boat, there is no inherent direction. You cannot just move away from the obstacle like you might with a forward facing rangefinder. You could go back the way you came in, but that does not allow to move past the obstacle.

If we were to support some a system that can read the depth in-front of the vehicle, we can treat it the same as rangefinder based avoidance, and it should all work already.

geofrancis commented 2 years ago

would a forward facing depth sounder work? something like 45 degrees?

sure it can't continue with the mission with only depth, but if it runs aground it could be terminal. I have some ideas for what it could do:

Loiter mode when it gets too shallow, that will stop it getting further into danger, I think this would work for most situations.

This would be nice but not essential:

Selectively shut down motors, if the boat has auxiliary propulsion unaffected by the bottom like an air propeller or waterjet then only shut off main drive so it doesnt pick up seaweed in shallow water.

RTL/rallly point if it gets too shallow.

Smart RTL to find a safe way back.

Tack if its sailing.

Mark area as exclusion zone so it will trigger fence if it goes back within 10m of shallow location or whatever set distance.

rmackay9 commented 2 years ago

Thanks for raising this issue. I agree with the comments above that there are two possible solutions and theoretically either or both could work. A fence or failsafe could trigger a user configurable action or we could use a horizontally facing underwater sonar and then do avoidance.

geofrancis commented 2 years ago

Thanks for raising this issue. I agree with the comments above that there are two possible solutions and theoretically either or both could work. A fence or failsafe could trigger a user configurable action or we could use a horizontally facing underwater sonar and then do avoidance.

The problem I see with the forward-looking sonar is that they generally have a very wide beam, I think it might start picking up surface reflections and objects in front rather than below as it's tilted up more, but I'm not a sonar expert it would have to be tested to see if its a viable method, I suspect higher quality sonars with more focused beams will work better. The other issue is it will interfere with the operation of the above surface avoidance, as I don't think I would be able to set different distances for above and below forward-looking range finders.

rmackay9 commented 2 years ago

@geofrancis,

Yes, and our AP_Proimity library only supports a single sensor at the moment so we couldn't do below surface and above surface detection and avoidance separately (yet).

By the way, for above surface avoidance, I think we should use radar (which may not be confused by the surface of the water) and/or the OAK-D (AI, 3D camera) which will hopefully we able to recognise objects and then provide a distance for them.

geofrancis commented 2 years ago

By the way, for above surface avoidance, I think we should use radar (which may not be confused by the surface of the water) and/or the OAK-D (AI, 3D camera) which will hopefully we able to recognise objects and then provide a distance for them.

3d AI is far outside my price and power budget unfortunately, but the radar sounds very interesting, I was not aware of any that were currently compatible with ardupilot. With all the new cars getting radars I am surprised some automotive radars haven't filtered down to hobbyists yet.

I just had a look and radars have got a lot cheaper since the last time I looked, it's a shame we can't rotate rangefinders to scan around.

WOW that oak-d is cheap, perhaps 3d AI and radar will be in the near future lol

geofrancis commented 2 years ago

has anyone ever tested one of the waterproof lidars like the TF-mini plus under the water? im aware that the water will diffuse the light much faster but how much faster?

paularthur commented 2 years ago

Thanks people. We're doing mapping and water quality testing on a shallow muddy harbour - we're going to run aground... This would help a lot - and agreed - the action to take is not simple - but run a script would allow us to move forward. For us - tide is important - incoming (just wait a bit) or outgoing (wait 6hrs). or even If _tooshallow then skip to the next waypoint - kind of works - but also fails horribly.

geofrancis commented 2 years ago

I have added a lua script to test at https://discuss.ardupilot.org/t/shallow-depth-warning-and-avoidance-using-lua/78545/8 I think that is going to be the best way of handling this issue rather than something integrated into ardupilot is its a very specialized task.

I'm closing this issue and will continue discussion at the link above.