ROS2 Geofence Manager package

26 views
Skip to first unread message

Sergei Grichine

unread,
Apr 14, 2026, 5:16:29 PM (5 days ago) Apr 14
to hbrob...@googlegroups.com
I drafted a ROS2 Geofence Manager:

A ROS2 package for polygon-based geofencing, designed for outdoor patrolling robots using GPS, Nav2, and Behavior Trees.


Suggestions, bug reports and harsh criticism welcome ;-)

Best Regards,
-- Sergei

Michael Wimble

unread,
Apr 14, 2026, 5:50:01 PM (5 days ago) Apr 14
to hbrob...@googlegroups.com
I took a quick looky-loo but there isn’t enough documentation there for me to make sense of it. It looks interesting, but it assumes I know a lot of context and terms that I don’t know. E.g., 

  • What is outside_debounce_count and why would I change it?

  • What does the “.plan” file do? How would I find out about it?

  • What is the purpose of common_data.py? There are a few data classes in there but I have no idea what the data members do or what the purpose of the classes are.

  •  starts talking about “Here is a clear draft for that feature”. What feature? And I’d only come across this if I looked at the actual source code, anyway. And I see the statement “polygon vertices are ordered consistently”. Is this something that is asserted? It may be okay to assume a user would know to build a polygon that way, but what visibility does the user have when he screws this up and is trying to debug the configuration?

  • What is a “bounce_target”? I see “bounce” mentioned a few times but I can’t guess what it means. Looking at the function documentation for “compute_bounce_target” I still have no idea what is going on.

I’m guessing that someone with the appropriate background, like they use the pixhawk stuff (which I don’t) might pick this all up. I don’t, so while this all seems to be something I could use in my squirrel-inator-bot, it’s not yet something I feel I could download, add in some coordinates, and set my robot off roaming my garden with the flamethrower one, ready to protect my bounty.

I’d also be really interested in looking at your behavior tree stuff.

Thanks for sharing. I always appreciate your work. At the moment, I feel like I just walked into the museum of modern art and I don’t want to say much to expose how ignorant I am about your art.

--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hbrobotics/CA%2BKVXVPiNrx%2BAnq%2B87VQBNJYY0XxFmegN6itz1YZGBBRzGXPZw%40mail.gmail.com.

Sergei Grichine

unread,
Apr 14, 2026, 8:06:55 PM (5 days ago) Apr 14
to hbrob...@googlegroups.com

Michael,

Thanks for the response.

I thought the README provided sufficient detail, but clearly not enough for an elevator pitch.

I like your reference to “modern art.” To be fair, you can’t fully appreciate Pieter Bruegel’s "old art" either if you’re rushing past his paintings or unaware of how disruptive they were to the elitist traditions of the old masters. Not that I’m claiming anything close to that level of mastery or disruption ;-)

Anyway, I’ve added some links to the README—especially to QGroundControl, which I just use to draw geofence polygons on a map.

There’s also some background on how this package evolved, which helps clarify the design: https://github.com/slgrobotics/articubot_one/wiki/Conversations-with-Overlords#question-16

Please keep in mind that this is the first part of, basically, three packages:

  • Geofence Manager
  • Patrol Geofence Manager
  • BT plugins and trees
The last two to follow. The squirrels, I hope, will be happy to wait ;-)

Answering your questions:

What does the “.plan” file do? How would I find out about it?

  • The .plan file is generated by QGroundControl. It defines the geofence—typically a polygon in WGS84 (lat/lon) coordinates. It looks like this 

What is the purpose of common_data.py? There are a few data classes in there, but I don’t know what the members do or what the classes are for.

  • I prefer to keep commonly used data structures in one place. It helps maintain consistency across the codebase.

The “...” starts with “Here is a clear draft for that feature.” What feature? Also, I’d only see this by reading the source. And there’s a statement about polygon vertices being ordered consistently—how is that enforced or validated? What happens if the user gets it wrong?

  • That part is an intermediate note from earlier development—essentially a reminder to myself. It can be ignored and probably should be cleaned up.

What is a “bounce_target”? I see “bounce” mentioned several times but can’t infer its meaning. Even the function documentation doesn’t make it clear.

  • The idea is that a patrolling robot “bounces” off the boundaries of a geofence (more like a geocage). The corresponding service provides the next navigation target based on that implied behavior. Running the test tool is probably the easiest way to understand how it works in practice.

What is outside_debounce_count, and why would I change it?

  • GPS data, even when filtered, can be noisy near boundaries. That can cause instability in the fence-state logic. The hysteresis and debouncing parameters (including outside_debounce_count) help stabilize state transitions.

I hope this helps. I can do a demo, and we can go over it tonight if time permits.

Best Regards,
-- Sergei


Sergei Grichine

unread,
Apr 17, 2026, 9:05:36 PM (2 days ago) Apr 17
to hbrob...@googlegroups.com
Just a teaser - what's cooking on my "dev" branch.
  • Multiple zones, including circular, inclusion ("geocage") and exclusion ("geofence") types.
  • Outdoors or indoors - lat,lon (QGroundControl *.plan) or x,y (defined by YAML). 
ROS2 - RViz2 - Dragger sim
Screenshot from 2026-04-17 19-44-37.png

./test_bounce_excl.py --file ../plans/geofence_qgroundcontrol_multi2.plan
Screenshot from 2026-04-17 19-41-28.png

./test_bounce_excl.py --file ../plans/geofence_polygon.yaml
Screenshot from 2026-04-17 19-35-09.png

Best Regards,
-- Sergei

Thomas Messerschmidt

unread,
Apr 17, 2026, 9:37:12 PM (2 days ago) Apr 17
to hbrob...@googlegroups.com
I wonder if that could be used for Robomagellan. 


Thomas Messerschmidt

-  

Need something prototyped, built or coded? I’ve been building prototypes for companies for 15 years. I am now incorporating generative AI into products.

Contact me directly or through LinkedIn:   




On Apr 17, 2026, at 6:05 PM, Sergei Grichine <vital...@gmail.com> wrote:


Just a teaser - what's cooking on my "dev" branch.
  • Multiple zones, including circular, inclusion ("geocage") and exclusion ("geofence") types.
  • Outdoors or indoors - lat,lon (QGroundControl *.plan) or x,y (defined by YAML). 
ROS2 - RViz2 - Dragger sim
<Screenshot from 2026-04-17 19-44-37.png>

./test_bounce_excl.py --file ../plans/geofence_qgroundcontrol_multi2.plan
<Screenshot from 2026-04-17 19-41-28.png>

./test_bounce_excl.py --file ../plans/geofence_polygon.yaml
<Screenshot from 2026-04-17 19-35-09.png>


Best Regards,
-- Sergei


  •  starts talking about “Here is a clear draft for that feature”. What feature? And I’d only come across this if I looked at the actual source code, anyway. And I see the statement “polygon vertices are ordered consistently”. Is this something that is asserted? It may be okay to assume a user would know to build a polygon that way, but what visibility does the user have when he screws this up and is trying to debug the configuration?

  • What is a “bounce_target”? I see “bounce” mentioned a few times but I can’t guess what it means. Looking at the function documentation for “compute_bounce_target” I still have no idea what is going on.

I’m guessing that someone with the appropriate background, like they use the pixhawk stuff (which I don’t) might pick this all up. I don’t, so while this all seems to be something I could use in my squirrel-inator-bot, it’s not yet something I feel I could download, add in some coordinates, and set my robot off roaming my garden with the flamethrower one, ready to protect my bounty.

I’d also be really interested in looking at your behavior tree stuff.

Thanks for sharing. I always appreciate your work. At the moment, I feel like I just walked into the museum of modern art and I don’t want to say much to expose how ignorant I am about your art.

On Apr 14, 2026, at 2:16 PM, Sergei Grichine <vital...@gmail.com> wrote:

I drafted a ROS2 Geofence Manager:

A ROS2 package for polygon-based geofencing, designed for outdoor patrolling robots using GPS, Nav2, and Behavior Trees.


Suggestions, bug reports and harsh criticism welcome ;-)

Best Regards,
-- Sergei

--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hbrobotics/CA%2BKVXVPiNrx%2BAnq%2B87VQBNJYY0XxFmegN6itz1YZGBBRzGXPZw%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hbrobotics/FF4CBFA0-F9F6-400C-A982-F3F6164CB229%40gmail.com.

--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.

Marco Walther

unread,
Apr 17, 2026, 9:43:34 PM (2 days ago) Apr 17
to hbrob...@googlegroups.com, Thomas Messerschmidt
On 4/17/26 18:36, Thomas Messerschmidt wrote:
> I wonder if that could be used for Robomagellan.

A fence is probably not enough;-) The ArduRover on my Pixhawk supports
the geo fence by default;-)

-- Marco

>
>
> Thomas Messerschmidt
>
> -
>
> Need something prototyped, built or coded? I’ve been building prototypes
> for companies for 15 years. I am now incorporating generative AI into
> products.
>
> Contact me directly or through LinkedIn:
>
> https://www.linkedin.com/in/ai-robotics/
>
>
>
> On Apr 17, 2026, at 6:05 PM, Sergei Grichine <vital...@gmail.com> wrote:
>
> 
> Just a teaser - what's cooking on my "/dev/" branch <https://github.com/
> slgrobotics/ros2_geofence_manager/tree/dev>.
>
> * Multiple zones, including circular, *inclusion* ("/geocage/") and
> *exclusion* ("/geofence/") types.
> * Outdoors or indoors - */lat,lon/* (QGroundControl /*.plan/) or */
> x,y/* (defined by YAML).
>
> ROS2 - RViz2 - Dragger sim
> <Screenshot from 2026-04-17 19-44-37.png>
>
> ./test_bounce_excl.py --file ../plans/geofence_qgroundcontrol_multi2.plan
> <Screenshot from 2026-04-17 19-41-28.png>
>
> ./test_bounce_excl.py --file ../plans/geofence_polygon.yaml
> <Screenshot from 2026-04-17 19-35-09.png>
>
>
> Best Regards,
> -- Sergei
>
>
> On Tue, Apr 14, 2026 at 7:06 PM Sergei Grichine <vital...@gmail.com
> <mailto:vital...@gmail.com>> wrote:
>
> Michael,
>
> Thanks for the response.
>
> I thought the README <https://github.com/slgrobotics/
> ros2_geofence_manager/blob/main/README.md> provided sufficient
> detail, but clearly not enough for an elevator pitch.
>
> I like your reference to “/modern art/.” To be fair, you can’t fully
> appreciate Pieter Bruegel’s "old art <https://www.metmuseum.org/art/
> collection/search/435809>" either if you’re rushing past his
> paintings or unaware of how disruptive they were to the elitist
> traditions of the old masters. Not that I’m claiming anything close
> to that level of mastery or disruption ;-)
>
> Anyway, I’ve added some links to the README—especially to
> QGroundControl, which I just use to draw geofence polygons on a map.
>
> There’s also some background on how this package evolved, which
> helps clarify the design: https://github.com/slgrobotics/
> articubot_one/wiki/Conversations-with-Overlords#question-16
> <https://github.com/slgrobotics/articubot_one/wiki/Conversations-
> with-Overlords#question-16>
>
> Please keep in mind that this is the first part of, basically, three
> packages:
>
> * Geofence Manager
> * Patrol Geofence Manager
> * BT plugins and trees
>
> The last two to follow. The squirrels, I hope, will be happy to wait ;-)
>
> Answering your questions:
>
> *What does the “.plan” file do? How would I find out about it?*
>
> * The |.plan| file is generated by QGroundControl. It defines the
> geofence—typically a polygon in WGS84 (lat/lon) coordinates. It
> looks like this <https://github.com/slgrobotics/
> ros2_geofence_manager/blob/main/plans/geofence_qgroundcontrol.plan>
>
> *What is the purpose of |common_data.py|? There are a few data
> classes in there, but I don’t know what the members do or what
> the classes are for.*
>
> * I prefer to keep commonly used data structures in one place. It
> helps maintain consistency across the codebase.
>
> *The “...” starts with “Here is a clear draft for that feature.”
> What feature? Also, I’d only see this by reading the source. And
> there’s a statement about polygon vertices being ordered
> consistently—how is that enforced or validated? What happens if
> the user gets it wrong?*
>
> * That part is an intermediate note from earlier development—
> essentially a reminder to myself. It can be ignored and probably
> should be cleaned up.
>
> *What is a “bounce_target”? I see “bounce” mentioned several
> times but can’t infer its meaning. Even the function
> documentation doesn’t make it clear.*
>
> * The idea is that a patrolling robot “bounces” off the boundaries
> of a geofence (more like a */geocage/*). The corresponding
> service provides the next navigation target based on that
> implied behavior. Running the test tool <https://github.com/
> slgrobotics/ros2_geofence_manager/blob/main/README.md#test-
> stand-alone-gui> is probably the easiest way to understand how
> it works in practice.
>
> *What is |outside_debounce_count|, and why would I change it?*
>
> * GPS data, even when filtered, can be noisy near boundaries. That
> can cause instability in the fence-state logic. The hysteresis
> and debouncing parameters (including |outside_debounce_count|)
> help stabilize state transitions.
>
> I hope this helps. I can do a demo, and we can go over it tonight if
> time permits.
>
> Best Regards,
> -- Sergei
>
>
> On Tue, Apr 14, 2026 at 4:50 PM Michael Wimble <mwi...@gmail.com
> <mailto:mwi...@gmail.com>> wrote:
>
> I took a quick looky-loo but there isn’t enough documentation
> there for me to make sense of it. It looks interesting, but it
> assumes I know a lot of context and terms that I don’t know. E.g.,
>
> * What is *outside_debounce_count *and why would I change it?
>
>
> * What does the “.plan” file do? How would I find out about it?
>
>
> * What is the purpose of /common_data.py/? There are a few
> data classes in there but I have no idea what the data
> members do or what the purpose of the classes are.
>
>
> *
> Geofencing in ROS2/Nav2 <https://chatgpt.com/s/
> t_69dc4159a75081919fbffd222699726c>
> chatgpt.com <https://chatgpt.com/s/
> t_69dc4159a75081919fbffd222699726c>
>
> <favicon-180x180-od45eci6.webp>
> <https://chatgpt.com/s/t_69dc4159a75081919fbffd222699726c>
>
> <https://chatgpt.com/s/t_69dc4159a75081919fbffd222699726c>
>  starts talking about “Here is a clear draft for that
> feature”. What feature? And I’d only come across this if I
> looked at the actual source code, anyway. And I see the
> statement “polygon vertices are ordered consistently”. Is
> this something that is asserted? It may be okay to assume a
> user would know to build a polygon that way, but what
> visibility does the user have when he screws this up and is
> trying to debug the configuration?
>
>
> * What is a “bounce_target”? I see “bounce” mentioned a few
> times but I can’t guess what it means. Looking at the
> function documentation for “compute_bounce_target” I still
> have no idea what is going on.
>
>
> I’m guessing that someone with the appropriate background, like
> they use the pixhawk stuff (which I don’t) might pick this all
> up. I don’t, so while this all seems to be something I could use
> in my squirrel-inator-bot, it’s not yet something I feel I could
> download, add in some coordinates, and set my robot off roaming
> my garden with the flamethrower one, ready to protect my bounty.
>
> I’d also be really interested in looking at your behavior tree
> stuff.
>
> Thanks for sharing. I always appreciate your work. At the
> moment, I feel like I just walked into the museum of modern art
> and I don’t want to say much to expose how ignorant I am about
> your art.
>
>> On Apr 14, 2026, at 2:16 PM, Sergei Grichine
>> <vital...@gmail.com <mailto:vital...@gmail.com>> wrote:
>>
>> I drafted a ROS2 Geofence Manager:
>>
>> A ROS2 package for polygon-based geofencing, designed for */
>> outdoor patrolling robots/* using GPS, Nav2, and Behavior Trees.
>>
>> Details here: https://github.com/slgrobotics/
>> ros2_geofence_manager <https://github.com/slgrobotics/
>> ros2_geofence_manager>
>>
>> Suggestions, bug reports and harsh criticism welcome ;-)
>>
>> Best Regards,
>> -- Sergei
>>
>> --
>> You received this message because you are subscribed to the
>> Google Groups "HomeBrew Robotics Club" group.
>> To unsubscribe from this group and stop receiving emails from
>> it, send an email to hbrobotics+...@googlegroups.com
>> <mailto:hbrobotics+...@googlegroups.com>.
>> To view this discussion visit https://groups.google.com/d/
>> msgid/hbrobotics/
>> CA%2BKVXVPiNrx%2BAnq%2B87VQBNJYY0XxFmegN6itz1YZGBBRzGXPZw%40mail.gmail.com <https://groups.google.com/d/msgid/hbrobotics/CA%2BKVXVPiNrx%2BAnq%2B87VQBNJYY0XxFmegN6itz1YZGBBRzGXPZw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the
> Google Groups "HomeBrew Robotics Club" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to hbrobotics+...@googlegroups.com
> <mailto:hbrobotics+...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/
> hbrobotics/FF4CBFA0-F9F6-400C-A982-F3F6164CB229%40gmail.com
> <https://groups.google.com/d/msgid/hbrobotics/FF4CBFA0-
> F9F6-400C-A982-F3F6164CB229%40gmail.com?
> utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "HomeBrew Robotics Club" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hbrobotics+...@googlegroups.com
> <mailto:hbrobotics+...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/
> hbrobotics/CA%2BKVXVMTs5MdZdUW3YMRZgh1owAQt-
> f%3DyArib6YJ2qf7MD8%3Dyg%40mail.gmail.com <https://groups.google.com/d/
> msgid/hbrobotics/CA%2BKVXVMTs5MdZdUW3YMRZgh1owAQt-
> f%3DyArib6YJ2qf7MD8%3Dyg%40mail.gmail.com?
> utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "HomeBrew Robotics Club" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hbrobotics+...@googlegroups.com
> <mailto:hbrobotics+...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/
> hbrobotics/284E581C-700C-42F3-9420-7B27D0E9DDB9%40gmail.com <https://
> groups.google.com/d/msgid/
> hbrobotics/284E581C-700C-42F3-9420-7B27D0E9DDB9%40gmail.com?
> utm_medium=email&utm_source=footer>.

Sergei Grichine

unread,
Apr 18, 2026, 1:30:17 PM (21 hours ago) Apr 18
to hbrob...@googlegroups.com, Thomas Messerschmidt
While roaming blind in the ROS2 jungle and trying to impose my mighty architecture on the Universe, I stumbled upon an interesting Nav2 feature.

Ask your favorite AI: "Tell me about Nav2 built-in concept: keepout zones through costmap filters"

This is what Google AI told me:
Kind of geofencing, if you ask me... 

Best Regards,
-- Sergei


To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hbrobotics/2dd6fa84-7d2c-4e70-aaf1-69af30e7e868%40gmail.com.

Michael Wimble

unread,
Apr 18, 2026, 1:35:37 PM (21 hours ago) Apr 18
to hbrob...@googlegroups.com
It is. Also look at speed zones.
Reply all
Reply to author
Forward
0 new messages