-
Notifications
You must be signed in to change notification settings - Fork 269
Feature/vector object server #766
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
Merged
SteveMacenski
merged 19 commits into
ros-navigation:master
from
Sushant-Chavan:feature/vector_object_server
Sep 3, 2025
Merged
Changes from 5 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
80ac7c4
Add Vector Object server documentation
AlexeyMerzlyakov 8854727
Minor improvements
ajtudela 6e2a909
Fix spelling
ajtudela 6940efa
Merge branch 'master' into feature/vector_object_server
Sushant-Chavan 68f78ac
Cleanup and minor updates
Sushant-Chavan 31aeff5
Fix line ending
Sushant-Chavan 399a2c9
Apply language fixes from code review
Sushant-Chavan 829090c
Merge branch 'feature/vector_object_server' of github.com:Sushant-Cha…
Sushant-Chavan bd1148d
Add missing language suggestion
Sushant-Chavan a32024b
Fix inconsistency in documentation
Sushant-Chavan f7e3a3b
Update PR reference
Sushant-Chavan 2690768
Move VOS doc under MapServer page
Sushant-Chavan c632174
Add more understandable examples
Sushant-Chavan b155e75
Update configuration/packages/configuring-map-server.rst
SteveMacenski a622e01
Update tutorials/docs/navigation2_with_vector_objects.rst
SteveMacenski a669500
Merge remote-tracking branch 'upstream/master' into feature/vector_ob…
Sushant-Chavan 6038d00
Move vector object server description to kilted page
Sushant-Chavan 140c26b
Split the Map Server page into sub-pages
Sushant-Chavan 7fd0923
Fix pre-commit checks
Sushant-Chavan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
324 changes: 324 additions & 0 deletions
324
configuration/packages/configuring-vector-object-server.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,324 @@ | ||
| .. _configuring_vector_object_server: | ||
|
|
||
| Vector Object Server | ||
| #################### | ||
|
|
||
| The Vector Object Server implements a server that puts vector objects (such as polygons and circles) on OccupancyGrid raster map. The output raster map is being published by Vector Object server, and it could be used anywhere in the Nav2 stack or outside it. | ||
|
|
||
| The main application of Vector Object server is to combine output raster maps with existing costmaps of environment, targeting for robot navigation purposes (for example for dynamic obstacles simulation/highlighting, sensors noise removal, black-out areas on maps, synthetic testing purposes, and much more). | ||
|
Sushant-Chavan marked this conversation as resolved.
Outdated
|
||
| A typical setup model for this is a Nav2 stack with Costmap Filters enabled, running in conjunction with a Vector Object server, which produces vectorised OccupancyGrid maps as input masks for the Costmap Filters: | ||
|
|
||
| .. image:: images/vector_object_server/vo_design.png | ||
| :width: 1000px | ||
| :align: center | ||
|
|
||
| These vector shapes could be added by using ROS input parameters as well as being handled by the following service calls: ``AddShapes.srv`` which adds new shapes or modifies existing ones, ``RemoveShapes.srv`` which removes any or all shapes from the map ``GetShapes.srv`` which returns all shapes on the map. | ||
|
|
||
| Each vector shape is being handled by its UUID, which is of ``unique_identifier_msgs/UUID`` type. Final developer could choose whether to specify it manually for a new shape, or have it generated automatically by the Vector Object server. The UUID can always be obtained by making a ``GetShapes.srv`` request and getting the response with all shapes' UUIDs and their properties. | ||
|
Sushant-Chavan marked this conversation as resolved.
Outdated
|
||
|
|
||
| During its work, Vector Object server places shapes on the map. Each vector object has its own value in the range from ``{-1}, [0..100]``, which matches the OccupancyGrid values. Vector objects can be overlapped with each other by using one of the global overlapping rules: sequential overlapping in the same order as vector objects arrived on the server, or taking the maximum / minimum value from all vector objects and the map background (if it is known). | ||
|
Sushant-Chavan marked this conversation as resolved.
Outdated
|
||
|
|
||
| This page describes all the configuration parameters of the Vector Object server. For more information on how to navigate with your own Vector Object server, please refer to the :ref:`navigation2_with_vector_objects` tutorial. | ||
|
|
||
| Features | ||
| ******** | ||
|
|
||
| - The following vector shapes are currently supported for placing on a map: | ||
|
|
||
| - Polygons | ||
| - Circles | ||
|
|
||
| - Polygons can be filled with any value or drawn as a polygonal chain, if it is not supposed to be a closed shape: | ||
|
|
||
| .. image:: images/vector_object_server/polygon_closed.png | ||
| :width: 400px | ||
| :height: 200px | ||
| :align: center | ||
|
|
||
| - Circles can be filled with any value or drawn without any fill (only the circle boundary is placed on the map): | ||
|
|
||
| .. image:: images/vector_object_server/circle_fill.png | ||
| :width: 400px | ||
| :height: 200px | ||
| :align: center | ||
|
|
||
| - Vector shapes could be set once during the Vector Object server startup as ROS-parameters, and added/modified/removed over the time using the following service calls: | ||
|
|
||
| - ``AddShapes.srv``: adds new shapes or modifies existing ones | ||
| - ``RemoveShapes.srv``: removes any or all shapes from the map | ||
| - ``GetShapes.srv``: gets all shapes and their properties | ||
|
|
||
| - Vector shapes are being identified by their UUID (``unique_identifier_msgs/UUID``), which is generated automatically for a new shape, or could be given manually by the developer. | ||
|
|
||
| - Vector shapes can be placed in any frame: | ||
|
|
||
| - If at least one of the shapes is set in a different frame than the map, a dynamic update model will be enabled: this shape can move over the time, output map will be published dynamically with a given rate. | ||
| - If all shapes are set in the same frame as map, map will be published/updated once: at startup of Vector Object server and on each call of ``AddShapes.srv`` or ``RemoveShapes.srv`` to change the shape. | ||
|
|
||
| Covered use-cases | ||
| ***************** | ||
|
|
||
| Using Vector Object server publishing an output map as input mask to :ref:`Costmap Filters <costmap_filters>` allows covering following (not restricted only to) use-cases: | ||
|
Sushant-Chavan marked this conversation as resolved.
Outdated
|
||
|
|
||
| - No-access zone | ||
| - Speed-restriction areas | ||
| - Virtual obstacles on costmap | ||
| - Flying zone for UAV-s with outer boundary and inner virtual obstacles | ||
|
Sushant-Chavan marked this conversation as resolved.
Outdated
|
||
| - Robot footprint (or any other moving objects) replacement | ||
| - Hiding some areas from costmap | ||
| - Sensors noise removal | ||
| - Dynamic objects simulation/highlighting | ||
| - Other testing purposes | ||
|
|
||
| Parameters | ||
| ********** | ||
|
|
||
| :map_topic: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| string "vo_map" | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| Output topic, publishing an OccupancyGrid map with vector objects put on it. | ||
|
|
||
| :global_frame_id: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| string "map" | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| The name of the coordinate frame where the map is being published at. | ||
|
|
||
| :resolution: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| double 0.05 | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| Output map resolution in meters. | ||
|
|
||
| :default_value: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| int -1 (unknown) | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| Default OccupancyGrid value to fill the background of output map with. | ||
|
|
||
| :overlay_type: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| int 0 | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| How one vector object to be overlaid with other and the map. | ||
| The following values are supported: | ||
|
|
||
| - 0 (``OVERLAY_SEQ``): Vector objects are superimposed in the order in which they have arrived. | ||
| - 1 (``OVERLAY_MAX``): Maximum value from vector objects and map is being chosen. | ||
| - 2 (``OVERLAY_MIN``): Minimum value from vector objects and map is being chosen. Unknown OccupancyGrid value is always being overrode, when it is possible. | ||
|
|
||
| :update_frequency: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| double 1.0 | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| Output map update frequency (when dynamic update model is switched-on). | ||
|
|
||
| :transform_tolerance: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| double 0.1 | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| Transform tolerance for the case when any of the shapes are placed in different than map's frame. | ||
|
|
||
| :shapes: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| vector<string> {} | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| List of vector objects (polygons and circles). Empty by-default. | ||
|
|
||
| Shapes parameters | ||
| ================= | ||
|
|
||
| ``<shape_name>`` - is the corresponding shape name string selected for this vector object. | ||
|
|
||
| :``<shape_name>``.type: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| string N/A | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| Type of vector object shape. Available values are ``polygon`` and ``circle``. Causes an error, if not specialized. | ||
|
|
||
| :``<shape_name>``.uuid: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| string N/A | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| UUID of the shape specified in ``12345678-9abc-def0-1234-56789abcdef0`` format. Parameter is optional and could be skipped: if not specialized, Vector Object server will automatically generate a new one for the shape. | ||
|
|
||
| :``<shape_name>``.frame_id: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| string "" | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| Frame ID of the given shape. Empty value is being treated as map's global frame. | ||
|
|
||
| :``<shape_name>``.value: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| int 100 (occupied) | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| Shape's value to be put on map with. | ||
|
|
||
| Parameters applicable for polygons only | ||
| --------------------------------------- | ||
|
|
||
| :``<shape_name>``.points: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| vector<double> N/A | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| Polygon vertices, listed in ``{p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, ...}`` format (e.g. ``{0.5, 0.5, 0.5, -0.5, -0.5, -0.5, -0.5, 0.5}`` for the square). Minimum 3 points for a triangle polygon. Causes an error, if not specialized incorrectly (less than 6 or odd number of items in the vector) or not specialized. | ||
|
SteveMacenski marked this conversation as resolved.
Outdated
|
||
|
|
||
| :``<shape_name>``.closed: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| bool true | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| Whether the polygon is closed (and filled), or drawn as polygonal chain otherwise. | ||
|
|
||
| Parameters applicable for circles only | ||
| -------------------------------------- | ||
|
|
||
| :``<shape_name>``.center: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| vector<double> N/A | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| Center of the circle, listed in ``{center.x, center.y}`` format (e.g. ``{0.2, 0.3}``). Should contain exactly 2 items: X and Y coordinate of the circle's center in a given frame. Otherwise, causes an error. | ||
|
|
||
| :``<shape_name>``.radius: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| double N/A | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| Circle radius. Causes an error, if less than zero or not specialized. | ||
|
|
||
| :``<shape_name>``.fill: | ||
|
|
||
| ============== ============================= | ||
| Type Default | ||
| -------------- ----------------------------- | ||
| bool true | ||
| ============== ============================= | ||
|
|
||
| Description: | ||
| Whether the circle to be filled with a given value, or drawn only circle's border otherwise. | ||
|
|
||
| Example | ||
| ******* | ||
|
|
||
| Here is an example of configuration YAML for the Vector Object server: | ||
|
|
||
| .. code-block:: yaml | ||
|
|
||
| vector_object_server: | ||
| ros__parameters: | ||
| map_topic: "vo_map" | ||
| global_frame_id: "map" | ||
| resolution: 0.05 | ||
| default_value: -1 | ||
| overlay_type: 0 | ||
| update_frequency: 1.0 | ||
| transform_tolerance: 0.1 | ||
| shapes: ["Poly", "CircleA", "CircleB"] | ||
| Poly: | ||
| type: "polygon" | ||
| frame_id: "map" | ||
| closed: True | ||
| value: 100 | ||
| points: [0.3, 0.3, 0.3, -0.3, 0.0, -0.3, 0.0, 0.3] | ||
| CircleA: | ||
| type: "circle" | ||
| frame_id: "map" | ||
| fill: True | ||
| value: 10 | ||
| center: [3.0, 3.0] | ||
| radius: 0.5 | ||
| uuid: "7b3f3d7d-135c-4b6c-aca1-7a84d1050505" | ||
| CircleB: | ||
| type: "circle" | ||
| frame_id: "map" | ||
| fill: False | ||
| value: 90 | ||
| center: [3.5, 3.5] | ||
| radius: 1.5 | ||
|
|
||
| For this, Vector Object server will produce the following map: | ||
|
|
||
|
|
||
| .. image:: images/vector_object_server/vo_config_map.png | ||
| :width: 636px | ||
| :height: 638px | ||
| :align: center | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.5 KB
configuration/packages/images/vector_object_server/polygon_closed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+77.5 KB
tutorials/docs/images/Vector_Object_server/vector_objects_avoidance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+83.3 KB
tutorials/docs/images/Vector_Object_server/vector_objects_on_costmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+79.8 KB
tutorials/docs/images/Vector_Object_server/vector_objects_removed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.