How to differentiate enabling "tin can" from inclusion/exclusion fences

I’ve been working through the documentation on fences.

As I understand it, the first type of fence supported by ArduCopter was the “tin can” fence around “home.” It’s enabled by checking the “enable” box on the CONFIG/GeoFence screen.

Inclusion/Exclusion fences were added later - and created on the PLAN screen after selecting “FENCES” in the drop down menu.

My question is how do you ENABLE the Inclusion/Exclusion fences without also enabling the “tin can” fence?

My guess is that type type of fence that’s enabled is controlled by the CONFIG/GeoFence drop down box that updates the parameter FENCE_TYPE.

I finally got down to the NOTE that explains this:

Turns out that “polygon” includes circle inclusion/exclusion fences. And “circle” specified the “tin can” shaped fence.

I’ve spent quite a few hours today trying to figure this out - I wonder if it might be possible to make some improvements that might be helpful. For example, instead of “circle” for FENCE_TYPE, how about calling that shape “tin can?”

Set the FENCE_RADIUS to a big number, that should get you what you want.

1 Like

The vehicle must be always in the tin can fence if the fence is enabled.

You can’t. But you can simply disable the behavior with

and also FENCE_ALT_MAX to some high altitude.
But it is always a good idea to set that tin can fence with some reasonable values to be safe in the field.

Edit: How to differentiate enabling "tin can" from inclusion/exclusion fences - #8 by Mustafa_Gokce

If the bit for “tin can” fence isn’t set in fence_type, it won’t be enabled, and if you don’t load/add a circular fence within the include/exclude fences, you won’t have one. At least that’s how it’s meant to work. Are you saying that this is broken, or just that fence_enable defaults to the original circle fence?

My question was how to distinguish between the “tin-
can” fence, and a circular shaped inclusion/exclusion fence created on the PLAN screen.

The only place I found that explains this is the small note I’ve highlighted in my original post.

The note explains that all the Inclusion/Exclusion fences created on PLAN page are enabled by using the “polygon” bit on the FENCE_TYPE bit mask. (can also use the drop down selection on the CONFIG/GeoFence section for TYPE)

So as far as I can tell so far - everything works fine. It’s just terribly difficult to figure out how to use it.

A couple of suggestions that would help a typical user: (apart from better documentation)

  1. don’t use the same name “circle” for the circular shaped tin-can fence and the circular shaped inclusion/exclusion fence.

  2. Include a graphical representation of the tin-can fence on the PLAN and DATA screen maps - as the Inclusion/Exclusion fences are depicted. (using a different color perhaps) That way the user can see that the tin-can fence has been enabled.

Thank you.

Mustafa -

I believe you’re wrong about this.

The “tin-can” fence is enabled by selecting “circle” in the FENCE_TYPE bit mask.

All Inclusion/Exclusion fences created on the PLAN page are enabled by selecting “polygon” on the FENCE_TYPE bit mask.

That’s what’s said on the note I’ve highlighted from docs - shown on my original post.

And I’ve bench tested this - seems to work.

Several things make this confusing.

  1. The term “polygon” is used for all Inclusion/Exclusion fences - including the ones with a circular shape.

  1. When enabling the “tin-can” fence by selecting the “circle” in the FENCE_TYPE bit mask - this fence is not depicted on the map section either the PLAN or the DATA screens. The Inclusion/Exclusion fences are depicted - using colors to distinguish them.

If I’ve got this wrong - please help me by letting me know.

I must not have communicated well - Your suggestion won’t help at all.

I simply wanted to know how to distinguish between enabling the “tin-can” fence and the circular shaped Inclusion/Exclusion fences.

Easy enough to do - the “circle” bit in the FENCE_TYPE bit mask enables the tin-can fence. the “polygon” bit in the FENCE_TYPE bit mask enables all Inclusion/Exclusion fences, including the circular shaped ones.

Easy enough to do - but incredibly confusing due to poor use of terminology.

It would also help if the tin-can fence were depicted on the maps in the PLAN and DATA screens - just as the Inclusion/Exclusion fences are depicted.

Thanks!

Yes, you are right, sorry about that.

I tried this in SITL, and indeed when setting circle bitmask 0 disables the tin can fence centered at home too. It was also in docs, I missed it.

Note

Polygon fence type includes the circular fences specified in the Inclusion/Exclusion fence list. The simple home centered CIRCLE fence is a separate fence. Rover ignores altitudes, if set.

Sorry for the misleading information before.

1 Like