-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Zone-based behavior tree control using colored map regions #5186
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
Comments
That's another way that data could be represented, yes! Though if you had less than 255 unique types of things, you could just use the grayscale values similar to what we do for the keepout/speed and other costmap filters. The costmap filters can be used to do things like what you suggest: you have the robot's pose and use that to match the zone to the robot pose in order to trigger some action. We do that in our current examples with keepout zones and keep zones. There's been incomplete proposals for others such as binary zones (i.e. trigger an arbitrary event by value). A behavior tree node could listen for those messages to enact something, for sure 😄 I'm not entirely sure what your proposal is. It sounds like you have an implementation idea (using RGB to represent zones), but not the use-case for it. Are you suggesting we move the Speed / Keepout / Costmap Filters to use RGB rather than grayscale image types so that they can represent more numerous types of things and/or information? Or expose this information in the behavior tree separate of the costmap filters / costmap2D engine? Or perhaps you weren't aware that you could use the costmap filters today for this reason (or you need more than 255 unique values)? |
Thanks for the clarification! My idea of using RGB instead of grayscale was mainly for user-friendliness — it’s easier to visually distinguish different zones when looking at the image. But in terms of functionality, grayscale works perfectly for my use case, since I’m far from reaching the 255-zone limit. You're right. I wasn’t aware that the current costmap filters could already be used to trigger specific actions in the behavior tree. What I had in mind was essentially:
I’ll dig into the current costmap filter functionality and see how I can leverage it for this. Thanks again! |
Great! I think it should be easy enough to have the cost value from the costmap filter remap into a topic name for a publication of a message. I.e. when color / cost That would be a great "BehaviorTrigger" costmap filter contribution to the stack if you were interested in contributing that! |
Feature request
Feature description
Hi! I've been thinking about implementing a new functionality that allows drawing zones on the map — something similar to the speed filter. The idea is to define zones by color, for example:
You draw a colored image (I was thinking of using .png format), and create the corresponding YAML file:
Each zone corresponds to a specific RGB color. By reading the color of the pixel that matches the position of base_link, it becomes easy to determine whether the robot is located within a particular zone. This approach could enable services like is_robot_in_zone("ZONE_NAME"), which can be used in a behavior tree to trigger specific actions depending on the robot's current zone. For example, if navigation fails in the "door" zone, the system could fall back to a behavior that requests the door to open. Similarly, if the robot enters the "elevator" zone, it could trigger a service to call the elevator.
I've even thought about implementing a behavior tree node to navigate to a zone.
These are just some ideas I have — I’d really like to hear more points of view. Do you think this would be a useful feature? How would you suggest implementing it? I’m open to all suggestions.
The text was updated successfully, but these errors were encountered: