Skip to content

Conversation

@Sushant-Chavan
Copy link
Contributor


Basic Info

Info Please fill out this column
Ticket(s) this addresses #3017
Primary OS tested on Ubuntu
Robotic platform tested on Proprietary (and also in simulation)
Does this PR contain AI generated software? No
Was this PR description generated by AI software? No

Description of contribution in a few bullet points

This PR continues from the open but non-active PR #4680. The following additional updates were performed:

  1. Fix linter issues
  2. Include .hpp instead of .h tf2_ros headers
  3. Fixed a race condition when publishing/subscribing the map published by the vector object server, when testing the feature by following the tutorial
  4. Minor cleanup

Description of documentation updates required from your changes

The PR for the corresponding documentation can be found at: ros-navigation/docs.nav2.org#766

Description of how this change was tested

  1. Tested that the sim-based tutorial works as expected
  2. Tested with additional boiler-plate code on a proprietary robot with keepout and speed-limit filter masks generated by the vector object server.

Future work that may be required in bullet points

N/A

For Maintainers:

  • Check that any new parameters added are updated in docs.nav2.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists
  • Should this be backported to current distributions? If so, tag with backport-*.

AlexeyMerzlyakov and others added 30 commits September 17, 2024 14:27
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
* Corrected headers
* Functions ordering
* Comment fixes

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
* Correct licensing years
* Fix Vector Object server dependencies
* Funcion rename for better readability
* Improve/fix comments

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>
Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>
Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>
Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>
Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>
Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>
@codecov
Copy link

codecov bot commented Aug 22, 2025

Codecov Report

❌ Patch coverage is 97.38318% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
..._map_server/src/vo_server/vector_object_shapes.cpp 96.81% 7 Missing ⚠️
nav2_map_server/src/vo_server/main.cpp 0.00% 4 Missing ⚠️
..._map_server/src/vo_server/vector_object_server.cpp 99.08% 2 Missing ⚠️
...tmap_2d/plugins/costmap_filters/keepout_filter.cpp 50.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
nav2_collision_monitor/src/polygon.cpp 97.29% <100.00%> (-0.12%) ⬇️
..._costmap_2d/include/nav2_costmap_2d/costmap_2d.hpp 100.00% <ø> (ø)
...nav2_costmap_2d/costmap_filters/costmap_filter.hpp 66.66% <ø> (ø)
...stmap_2d/plugins/costmap_filters/binary_filter.cpp 94.66% <100.00%> (ø)
...tmap_2d/plugins/costmap_filters/costmap_filter.cpp 88.05% <ø> (-1.56%) ⬇️
...ostmap_2d/plugins/costmap_filters/speed_filter.cpp 95.12% <100.00%> (ø)
nav2_costmap_2d/plugins/obstacle_layer.cpp 82.10% <100.00%> (ø)
nav2_costmap_2d/src/costmap_2d.cpp 88.20% <100.00%> (+0.05%) ⬆️
...er/include/nav2_map_server/vector_object_utils.hpp 100.00% <100.00%> (ø)
nav2_util/include/nav2_util/geometry_utils.hpp 96.22% <100.00%> (+1.10%) ⬆️
... and 6 more

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a medium level review, knowing that some of the details were written by Alexey and I can do a detailed review of that level in the next round. I wanted to get things I thought you should fix and will verify functionality in the next one after these are resolved.

Generally looks good to me though. I don't think I'm going to find much I object to.

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>
Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>
Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a Vector Object Server feature that allows dynamic addition, removal, and management of vector shapes (polygons and circles) on occupancy grid maps. The main purpose is to enable runtime manipulation of keepout zones, speed limit areas, and other regions on navigation maps using geometric primitives instead of static map files.

  • Adds VectorObjectServer lifecycle node for managing vector shapes on maps
  • Implements polygon and circle geometric primitives with transformation support
  • Provides service interfaces for adding, removing, and querying vector objects

Reviewed Changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 4 comments.

File Description
nav2_msgs/ Adds message definitions and service interfaces for vector objects
nav2_util/ Implements utility functions for raytracing, occupancy grid operations, and geometric calculations
nav2_map_server/ Core implementation of vector object server with shape management

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

SteveMacenski and others added 2 commits September 3, 2025 13:57
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>
Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small changes for logging and otherwise happy with this! This should be mergable immediately on these updates

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>
Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>
@SteveMacenski SteveMacenski merged commit 97de6f2 into ros-navigation:main Sep 11, 2025
13 of 14 checks passed
@SteveMacenski
Copy link
Member

Thanks @Sushant-Chavan for testing and refining for your application, @ajtudela for doing the hard work of continuing this from @AlexeyMerzlyakov - and of course Alexey for his core contributions here!

@SteveMacenski SteveMacenski mentioned this pull request Sep 11, 2025
7 tasks
@ajtudela
Copy link
Contributor

Great! I'm glad this has finally been merged.

silanus23 pushed a commit to silanus23/navigation2 that referenced this pull request Sep 18, 2025
* Add Vector Object server

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Meet review comments

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>

* Simplify shapes param configuring

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Rename getROSParameter() to getParameter()

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Return back getMaskData() to nav2_costmap_2d

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Add composition node support

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>

* Remove redundant methods

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Update nav2_map_server/src/vo_server/vector_object_server.cpp

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Avoid shapes clearing

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Optimize switchMapUpdate() method

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Switch to vector of shapes

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Minor fixes

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Meet review comments

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Move isPointInside algorithm to nav2_util

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Testcases covering new functionality

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Fix linting issues

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Adjust for Vector Objects demonstration

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Code clean-up
* Corrected headers
* Functions ordering
* Comment fixes

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Additional code facelift
* Correct licensing years
* Fix Vector Object server dependencies
* Funcion rename for better readability
* Improve/fix comments

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>

* Minor fixing after rebase

Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Rename vector object server

Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Minor changes

Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Update tests

Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Merge branch 'main' into feature/vector_object_server

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Fix merge issues and pre-commit checks

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Change tf2_ros headers from `.h` to `.hpp`

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Fix race condition in pub-sub of VO map

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Cleanup

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Remove use of ament_target_dependencies

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Fix review comments

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Fix linter errors

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Fix exception handling

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Update nav2_map_server/include/nav2_map_server/vector_object_utils.hpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>

* Update nav2_util/include/nav2_util/raytrace_line_2d.hpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>

* Add error logs

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Fix cpplint

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

---------

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>
Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>
Co-authored-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Co-authored-by: Alexey Merzlyakov <60094858+AlexeyMerzlyakov@users.noreply.github.com>
Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
Co-authored-by: Alberto Tudela <ajtudela@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
BCKSELFDRIVEWORLD pushed a commit to BCKSELFDRIVEWORLD/navigation2 that referenced this pull request Sep 23, 2025
* Add Vector Object server

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Meet review comments

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>

* Simplify shapes param configuring

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Rename getROSParameter() to getParameter()

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Return back getMaskData() to nav2_costmap_2d

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Add composition node support

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>

* Remove redundant methods

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Update nav2_map_server/src/vo_server/vector_object_server.cpp

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Avoid shapes clearing

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Optimize switchMapUpdate() method

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Switch to vector of shapes

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Minor fixes

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Meet review comments

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Move isPointInside algorithm to nav2_util

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Testcases covering new functionality

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Fix linting issues

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Adjust for Vector Objects demonstration

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Code clean-up
* Corrected headers
* Functions ordering
* Comment fixes

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Additional code facelift
* Correct licensing years
* Fix Vector Object server dependencies
* Funcion rename for better readability
* Improve/fix comments

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>

* Minor fixing after rebase

Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Rename vector object server

Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Minor changes

Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Update tests

Signed-off-by: Alberto Tudela <ajtudela@gmail.com>

* Merge branch 'main' into feature/vector_object_server

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Fix merge issues and pre-commit checks

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Change tf2_ros headers from `.h` to `.hpp`

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Fix race condition in pub-sub of VO map

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Cleanup

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Remove use of ament_target_dependencies

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Fix review comments

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Fix linter errors

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Fix exception handling

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Update nav2_map_server/include/nav2_map_server/vector_object_utils.hpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>

* Update nav2_util/include/nav2_util/raytrace_line_2d.hpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>

* Add error logs

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

* Fix cpplint

Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>

---------

Signed-off-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
Signed-off-by: Sushant Chavan <sushant.chavan@idealworks.com>
Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>
Co-authored-by: Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
Co-authored-by: Alexey Merzlyakov <60094858+AlexeyMerzlyakov@users.noreply.github.com>
Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
Co-authored-by: Alberto Tudela <ajtudela@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants