[ ![JSLbotbuilder gravatar image](/m/default/media/images/nophoto.png?v=28)
](/users/145125/jslbotbuilder/)


* [ humble ](/questions/scope:all/sort:activity-desc/tags:humble/page:1/)


Copy link


Various other forms of environmental representations exist. These include:


[ REP 105 ](https://www.ros.org/reps/rep-0105.html) defines the frames and
conventions required for navigation and the larger ROS ecosystem. These
conventions should be followed at all times to make use of the rich
positioning, odometry, and slam projects available in the community.


    * [ Enterprise ](/enterprise)
    * [ Teams ](/team)
    * [ Startups ](/enterprise/startups)
    * [ Education  ](https://education.github.com)


[ Add Vector Object server  #3930  ](/ros-planning/navigation2/pull/3930)


So I want to make the virtual_layer more generic and support also ` polygon
with holes ` .
As an example I am using this notion for UAVs to define a flying zone (outer
ring / boundary) with obstacles (inner rings / holes). For some failsafe
scenarios, landing on obstacle is permitted that's why I need to fill the
inner ring costmap pixels in order to get the exact cost. (To fill the
obstacle pixels we face the convex/concave issue)
Hope my explanation was clear


So, regarding the design discussions, to continue the ideas from WG meeting,
that [ @SteveMacenski ](https://github.com/SteveMacenski) pointed out, we have
a tradeoff between two designs:
D1. Universal Vector Object server + StaticLayer (tuned for VO-Server output
maps)


Collaborator


New issue


I actually, I don't mind any of both options, so the question is what model do
we plan to have in Nav2: vector objects in costmaps, or vector object in
costmaps + vectorized Nav2 maps everywhere?


Member


[
![@SteveMacenski](https://avatars.githubusercontent.com/u/14944147?s=80&u=0925d37e9d3569c71d930114b66e6394c2efb3c6&v=4)
](/SteveMacenski)


Toggle navigation


> Cons. Can not cover OccupancyGrid maps


The robot does not navigate and i do not see any warning messages. The
bt_naviagtor gets stuck


Sign up for GitHub


**Required Info:**


[ Powered by Askbot version 0.10.2 ](http://askbot.com)


My virtual layer repo is a bit outdated demo package. Sorry about that 🙋🏻
Lately I was working on ros2 migration for all of my ros packages and the work
🚧 🏗 👷🏻 is still in progress.


Sorry, something went wrong.


You can’t perform that action at this time.


> How would the vector server know how to interpret the values for the
> application to know what value means "do nothing" if we have the
> base+multiplier going on in the costmap filter layer?


StaticLayer::~StaticLayer()
{
}


  * You're probably right that we should have something costmap filter-y here for having the polygons do other tasks than simply adding costs. So maybe this should fall under the categorization of costmap filters.
  * I think the costmap layers themselves should have the actual rastered maps only, the host server should only be reading from file and providing the vector shape messages to the costmap layer for use.


> If we add the services to the Python3 Simple Commander, it'll be stupidly
> easy to make testing demos with randomly generated obstacles in a costmap,
> without having to manually create a map. Just open a blank costmap and
> generate random stuff in random spots to insert.


[ ![cc-by-sa](/m/default/media/images/cc-by-sa.png?v=28)
](http://creativecommons.org/licenses/by-sa/3.0/legalcode) ROS Answers is
licensed under Creative Commons Attribution 3.0 Content on this site is
licensed under a [ Creative Commons Attribution Share Alike 3.0
](http://creativecommons.org/licenses/by-sa/3.0/legalcode) license.


Copy link


> My idea is to have vector objects applied not only to costmap layers, but to
> costmap filters as well


Member


> Any non-arcing shape (e.g. circles) can just be defined as a set of points.


void
StaticLayer::updateCosts(
  nav2_costmap_2d::Costmap2D & master_grid,
  int min_i, int min_j, int max_i, int max_j)
{
  std::lock_guard<Costmap2D::mutex_t> guard(*getMutex());
  if (!enabled_) {
    return;
  }
  if (!map_received_in_update_bounds_) {
    static int count = 0;
    // throttle warning down to only 1/10 message rate
    if (++count == 10) {
      RCLCPP_WARN(logger_, "Can't update static costmap layer, no map received");
      count = 0;
    }
    return;
  }


    * [ Actions  Automate any workflow  ](/features/actions)
    * [ Packages  Host and manage packages  ](/features/packages)
    * [ Security  Find and fix vulnerabilities  ](/features/security)
    * [ Codespaces  Instant dev environments  ](/features/codespaces)
    * [ Copilot  Write better code with AI  ](/features/copilot)
    * [ Code review  Manage code changes  ](/features/code-review)
    * [ Issues  Plan and track work  ](/features/issues)
    * [ Discussions  Collaborate outside of code  ](/features/discussions)


  map_sub_ = node->create_subscription<nav_msgs::msg::OccupancyGrid>(
    map_topic_, map_qos,
    std::bind(&StaticLayer::incomingMap, this, std::placeholders::_1));


Projects


[ Hi there! Please sign in ](/account/signin/?next=/question/414211/adding-
subscriber-to-custom-costmap/) [ help ](/help/ "help")


  * Support of non convex obstacles.
  * Add RPC instead of published msgs in order to have the possibility of deleting obstacles with uuid identification
  * Add additional parameters to obstacles (lifetime, cost, random position, ...).
  * Better documentation and samples.
  * ROS2 compatibility.


    * [ CI/CD & Automation ](/solutions/ci-cd/)
    * [ DevOps ](/solutions/devops/)
    * [ DevSecOps  ](https://resources.github.com/devops/fundamentals/devsecops/)


So tl;dr


No milestone


Got it - unfortunately I don't have spare cycles to help debug any given
users' custom demo code if its not something being worked on for general
community contribution (only so many hours I have support for doing
maintenance and development). There is documentation and tutorials on
navigation.ros.org and a number of 3rd party examples of costmap layers you
can reference that I'd recommend taking a look at. One of the easier ones
being [ NPVL ](https://github.com/SteveMacenski/nonpersistent_voxel_layer)
which is basically as simple as it gets. The inflation layer might be a useful
reference given the nature of your plugin.


void
StaticLayer::getParameters()
{
  int temp_lethal_threshold = 0;
  double temp_tf_tol = 0.0;


Thanks for the proposition. The detector layer is actually plain STVL, which
also detects other obstacles which we do not want to clear. Additionally, we
obviously can't detect the whole pallet with STVL so we do need to generate a
custom polygon.
So if I understood your proposition correctly, that's not something we can use
unfortunately.

---

All reactions


[
![@SteveMacenski](https://avatars.githubusercontent.com/u/14944147?s=80&u=0925d37e9d3569c71d930114b66e6394c2efb3c6&v=4)
](/SteveMacenski)


[ Video of the problem ](https://www.youtube.com/watch?v=QfGq5oc1GSk)


Note


    * [ Enterprise ](/enterprise)
    * [ Teams ](/team)
    * [ Startups ](/enterprise/startups)
    * [ Education  ](https://education.github.com)


**[ SteveMacenski ](/SteveMacenski) ** commented  Feb 3, 2023


Member


[ ![@PranavShevkar](https://avatars.githubusercontent.com/u/71570841?s=80&v=4)
](/PranavShevkar)


Name


Sorry, something went wrong.


But for either 1/2, deleting is also an important thing to get feedback on,
not just additions. So services again seem to me to make sense as the
interface to get acks back that 'Yes, Object 43432 is removed'.


The general task in Nav2 for the planner is to compute a valid, and
potentially optimal, path from the current pose to a goal pose. However, many
classes of plans and routes exist which are supported.


      * [ Conclusion ](../tutorials/docs/adding_a_nav2_task_server.html#conclusion)
    * [ Filtering of Noise-Induced Obstacles ](../tutorials/docs/filtering_of_noise-induced_obstacles.html)
      * [ Overview ](../tutorials/docs/filtering_of_noise-induced_obstacles.html#overview)
      * [ Requirements ](../tutorials/docs/filtering_of_noise-induced_obstacles.html#requirements)
      * [ Tutorial Steps ](../tutorials/docs/filtering_of_noise-induced_obstacles.html#tutorial-steps)
        * [ 1\. Enable Denoise Layer ](../tutorials/docs/filtering_of_noise-induced_obstacles.html#enable-denoise-layer)
        * [ 2\. Run Nav2 stack ](../tutorials/docs/filtering_of_noise-induced_obstacles.html#run-nav2-stack)
      * [ How it works ](../tutorials/docs/filtering_of_noise-induced_obstacles.html#how-it-works)
  * [ Plugin Tutorials ](../plugin_tutorials/index.html)
    * [ Writing a New Costmap2D Plugin ](../plugin_tutorials/docs/writing_new_costmap2d_plugin.html)
      * [ Overview ](../plugin_tutorials/docs/writing_new_costmap2d_plugin.html#overview)
      * [ Requirements ](../plugin_tutorials/docs/writing_new_costmap2d_plugin.html#requirements)
      * [ Tutorial Steps ](../plugin_tutorials/docs/writing_new_costmap2d_plugin.html#tutorial-steps)
        * [ 1- Write a new Costmap2D plugin ](../plugin_tutorials/docs/writing_new_costmap2d_plugin.html#write-a-new-costmap2d-plugin)
        * [ 2- Export and make GradientLayer plugin ](../plugin_tutorials/docs/writing_new_costmap2d_plugin.html#export-and-make-gradientlayer-plugin)
        * [ 3- Enable the plugin in Costmap2D ](../plugin_tutorials/docs/writing_new_costmap2d_plugin.html#enable-the-plugin-in-costmap2d)
        * [ 4- Run GradientLayer plugin ](../plugin_tutorials/docs/writing_new_costmap2d_plugin.html#run-gradientlayer-plugin)
    * [ Writing a New Planner Plugin ](../plugin_tutorials/docs/writing_new_nav2planner_plugin.html)
      * [ Overview ](../plugin_tutorials/docs/writing_new_nav2planner_plugin.html#overview)
      * [ Requirements ](../plugin_tutorials/docs/writing_new_nav2planner_plugin.html#requirements)
      * [ Tutorial Steps ](../plugin_tutorials/docs/writing_new_nav2planner_plugin.html#tutorial-steps)
        * [ 1- Creating a new Planner Plugin ](../plugin_tutorials/docs/writing_new_nav2planner_plugin.html#creating-a-new-planner-plugin)
        * [ 2- Exporting the planner plugin ](../plugin_tutorials/docs/writing_new_nav2planner_plugin.html#exporting-the-planner-plugin)
        * [ 3- Pass the plugin name through params file ](../plugin_tutorials/docs/writing_new_nav2planner_plugin.html#pass-the-plugin-name-through-params-file)
        * [ 4- Run StraightLine plugin ](../plugin_tutorials/docs/writing_new_nav2planner_plugin.html#run-straightline-plugin)
    * [ Writing a New Controller Plugin ](../plugin_tutorials/docs/writing_new_nav2controller_plugin.html)
      * [ Overview ](../plugin_tutorials/docs/writing_new_nav2controller_plugin.html#overview)
      * [ Requirements ](../plugin_tutorials/docs/writing_new_nav2controller_plugin.html#requirements)
      * [ Tutorial Steps ](../plugin_tutorials/docs/writing_new_nav2controller_plugin.html#tutorial-steps)
        * [ 1- Create a new Controller Plugin ](../plugin_tutorials/docs/writing_new_nav2controller_plugin.html#create-a-new-controller-plugin)
        * [ 2- Exporting the controller plugin ](../plugin_tutorials/docs/writing_new_nav2controller_plugin.html#exporting-the-controller-plugin)
        * [ 3- Pass the plugin name through the params file ](../plugin_tutorials/docs/writing_new_nav2controller_plugin.html#pass-the-plugin-name-through-the-params-file)
        * [ 4- Run Pure Pursuit Controller plugin ](../plugin_tutorials/docs/writing_new_nav2controller_plugin.html#run-pure-pursuit-controller-plugin)
    * [ Writing a New Behavior Tree Plugin ](../plugin_tutorials/docs/writing_new_bt_plugin.html)
      * [ Overview ](../plugin_tutorials/docs/writing_new_bt_plugin.html#overview)
      * [ Requirements ](../plugin_tutorials/docs/writing_new_bt_plugin.html#requirements)
      * [ Tutorial Steps ](../plugin_tutorials/docs/writing_new_bt_plugin.html#tutorial-steps)
        * [ 1- Creating a new BT Plugin ](../plugin_tutorials/docs/writing_new_bt_plugin.html#creating-a-new-bt-plugin)
        * [ 2- Exporting the planner plugin ](../plugin_tutorials/docs/writing_new_bt_plugin.html#exporting-the-planner-plugin)
        * [ 3- Add plugin library name to config ](../plugin_tutorials/docs/writing_new_bt_plugin.html#add-plugin-library-name-to-config)


Resources


**[ AlexeyMerzlyakov ](/AlexeyMerzlyakov) ** commented  Feb 1, 2023  •


Copy link


But who would be the downstream consumer of that? I would think it would be
the costmap, so having a layer that adds the geometries is no different of a
workflow (its just who's hosting that particular service). Being able to just
create a costmap and add some random shaped objects is inherently useful for
benchmarking and analysis instead of having to create rastered maps of shapes
to store offline.


> I remember there were some points why each shape is better to describe in
> its own file, were on the call.


Cancel  Submit feedback


        * [ Twirling Critic ](../configuration/packages/configuring-mppic.html#twirling-critic)
      * [ Example ](../configuration/packages/configuring-mppic.html#example)
      * [ Notes to Users ](../configuration/packages/configuring-mppic.html#notes-to-users)
        * [ General Words of Wisdom ](../configuration/packages/configuring-mppic.html#general-words-of-wisdom)
        * [ Prediction Horizon, Costmap Sizing, and Offsets ](../configuration/packages/configuring-mppic.html#prediction-horizon-costmap-sizing-and-offsets)
        * [ Obstacle, Inflation Layer, and Path Following ](../configuration/packages/configuring-mppic.html#obstacle-inflation-layer-and-path-following)
    * [ Rotation Shim Controller ](../configuration/packages/configuring-rotation-shim-controller.html)
      * [ Rotation Shim Controller Parameters ](../configuration/packages/configuring-rotation-shim-controller.html#rotation-shim-controller-parameters)
      * [ Example ](../configuration/packages/configuring-rotation-shim-controller.html#example)
    * [ Map Server / Saver ](../configuration/packages/configuring-map-server.html)
      * [ Map Saver Parameters ](../configuration/packages/configuring-map-server.html#map-saver-parameters)
      * [ Map Server Parameters ](../configuration/packages/configuring-map-server.html#map-server-parameters)
      * [ Costmap Filter Info Server Parameters ](../configuration/packages/configuring-map-server.html#costmap-filter-info-server-parameters)
      * [ Example ](../configuration/packages/configuring-map-server.html#example)
    * [ AMCL ](../configuration/packages/configuring-amcl.html)
      * [ Parameters ](../configuration/packages/configuring-amcl.html#parameters)
      * [ Example ](../configuration/packages/configuring-amcl.html#example)
    * [ Behavior Server ](../configuration/packages/configuring-behavior-server.html)
      * [ Behavior Server Parameters ](../configuration/packages/configuring-behavior-server.html#behavior-server-parameters)
      * [ Default Plugins ](../configuration/packages/configuring-behavior-server.html#default-plugins)
      * [ Spin Behavior Parameters ](../configuration/packages/configuring-behavior-server.html#spin-behavior-parameters)
      * [ BackUp Behavior Parameters ](../configuration/packages/configuring-behavior-server.html#backup-behavior-parameters)
      * [ DriveOnHeading Behavior Parameters ](../configuration/packages/configuring-behavior-server.html#driveonheading-behavior-parameters)
      * [ AssistedTeleop Behavior Parameters ](../configuration/packages/configuring-behavior-server.html#assistedteleop-behavior-parameters)
      * [ Example ](../configuration/packages/configuring-behavior-server.html#example)
    * [ Smoother Server ](../configuration/packages/configuring-smoother-server.html)
      * [ Smoother Server Parameters ](../configuration/packages/configuring-smoother-server.html#smoother-server-parameters)
      * [ Example ](../configuration/packages/configuring-smoother-server.html#example)
    * [ Simple Smoother ](../configuration/packages/configuring-simple-smoother.html)
      * [ Simple Smoother Parameters ](../configuration/packages/configuring-simple-smoother.html#simple-smoother-parameters)
      * [ Example ](../configuration/packages/configuring-simple-smoother.html#example)
    * [ Savitzky-Golay Smoother ](../configuration/packages/configuring-savitzky-golay-smoother.html)
      * [ Savitzky-Golay Smoother Parameters ](../configuration/packages/configuring-savitzky-golay-smoother.html#savitzky-golay-smoother-parameters)
      * [ Example ](../configuration/packages/configuring-savitzky-golay-smoother.html#example)
    * [ Constrained smoother ](../configuration/packages/configuring-constrained-smoother.html)
      * [ Smoother Server Parameters ](../configuration/packages/configuring-constrained-smoother.html#smoother-server-parameters)
      * [ Example ](../configuration/packages/configuring-constrained-smoother.html#example)
    * [ Velocity Smoother ](../configuration/packages/configuring-velocity-smoother.html)
      * [ Velocity Smoother Parameters ](../configuration/packages/configuring-velocity-smoother.html#velocity-smoother-parameters)
      * [ Example ](../configuration/packages/configuring-velocity-smoother.html#example)


[ question  ](/ros-planning/navigation2/labels/question) Further information
is requested


Collecting all approach proc and cons, and if we are no requiring in
OccupancyGrid maps "vectorizing" as of today intention, it is more reasonable
to prefer "D2" over it. Otherwise, in the future, if we need to have to add VO
to OccupancyGrid maps someday, the logic could be moved-out to operate
separately as of VO-server. It seems not a big issue in that case.


    [planner_server-6] [INFO] [1686316128.543270097] [global_costmap.global_costmap]: Activating
    [planner_server-6] [INFO] [1686316128.543286840] [global_costmap.global_costmap]: Checking transform
    [planner_server-6] [INFO] [1686316128.543341356] [global_costmap.global_costmap]: Timed out waiting for transform from base_link to map to become available, tf error: Lookup would require extrapolation into the past.  Requested time 5.539000 but the earliest data is at time 6.015000, when looking up transform from frame [base_link] to frame [map]
    [rviz2-12] [INFO] [1686316128.884574028] [rviz2]: Stereo is NOT SUPPORTED
    [rviz2-12] [INFO] [1686316128.884659422] [rviz2]: OpenGl version: 4.6 (GLSL 4.6)
    [rviz2-12] [INFO] [1686316128.982150506] [rviz2]: Stereo is NOT SUPPORTED
    [planner_server-6] [INFO] [1686316129.043376579] [global_costmap.global_costmap]: Timed out waiting for transform from base_link to map to become available, tf error: Lookup would require extrapolation into the past.  Requested time 5.979000 but the earliest data is at time 6.015000, when looking up transform from frame [base_link] to frame [map]
    [amcl-2] [WARN] [1686316129.082419369] [amcl]: New subscription discovered on topic '/particle_cloud', requesting incompatible QoS. No messages will be sent to it. Last incompatible policy: RELIABILITY_QOS_POLICY
    [rviz2-12] [INFO] [1686316129.229115834] [rviz2]: Trying to create a map of size 1207 x 591 using 1 swatches
    [planner_server-6] [INFO] [1686316129.543409839] [global_costmap.global_costmap]: start
    [planner_server-6] [INFO] [1686316129.543767924] [global_costmap.global_costmap]: KeepoutFilter: Subscribing to "/keepout_filter_info" topic for filter info...
    [planner_server-6] [INFO] [1686316129.545556583] [global_costmap.global_costmap]: SpeedFilter: Subscribing to "/speed_filter_info" topic for filter info...
    [rviz2-12] [INFO] [1686316129.772010440] [rviz2]: Trying to create a map of size 1207 x 591 using 1 swatches
    [planner_server-6] [INFO] [1686316129.796175349] [planner_server]: Activating plugin GridBased of type NavfnPlanner
    [planner_server-6] [INFO] [1686316129.796639203] [planner_server]: Creating bond (planner_server) to lifecycle manager.
    [lifecycle_manager-11] [INFO] [1686316129.898878154] [lifecycle_manager_navigation]: Server planner_server connected with bond.
    [lifecycle_manager-11] [INFO] [1686316129.898920173] [lifecycle_manager_navigation]: Activating behavior_server
    [behavior_server-7] [INFO] [1686316129.899194305] [behavior_server]: Activating
    [behavior_server-7] [INFO] [1686316129.899223153] [behavior_server]: Activating assisted_teleop
    [behavior_server-7] [INFO] [1686316129.899239463] [behavior_server]: Activating spin
    [behavior_server-7] [INFO] [1686316129.899251085] [behavior_server]: Activating backup
    [behavior_server-7] [INFO] [1686316129.899263195] [behavior_server]: Activating drive_on_heading
    [behavior_server-7] [INFO] [1686316129.899275012] [behavior_server]: Activating wait
    [behavior_server-7] [INFO] [1686316129.899289822] [behavior_server]: Creating bond (behavior_server) to lifecycle manager.
    [lifecycle_manager-11] [INFO] [1686316130.001482840] [lifecycle_manager_navigation]: Server behavior_server connected with bond.
    [lifecycle_manager-11] [INFO] [1686316130.001519587] [lifecycle_manager_navigation]: Activating bt_navigator
    [bt_navigator-8] [INFO] [1686316130.001807502] [bt_navigator]: Activating
    [bt_navigator-8] [INFO] [1686316130.046872474] [bt_navigator]: Creating bond (bt_navigator) to lifecycle manager.
    [lifecycle_manager-11] [INFO] [1686316130.149769699] [lifecycle_manager_navigation]: Server bt_navigator connected with bond.
    [lifecycle_manager-11] [INFO] [1686316130.149816454] [lifecycle_manager_navigation]: Activating waypoint_follower
    [waypoint_follower-9] [INFO] [1686316130.150276473] [waypoint_follower]: Activating
    [waypoint_follower-9] [INFO] [1686316130.150316004] [waypoint_follower]: Creating bond (waypoint_follower) to lifecycle manager.
    [lifecycle_manager-11] [INFO] [1686316130.253020745] [lifecycle_manager_navigation]: Server waypoint_follower connected with bond.
    [lifecycle_manager-11] [INFO] [1686316130.253066628] [lifecycle_manager_navigation]: Activating velocity_smoother
    [velocity_smoother-10] [INFO] [1686316130.253513483] [velocity_smoother]: Activating
    [velocity_smoother-10] [INFO] [1686316130.253578626] [velocity_smoother]: Creating bond (velocity_smoother) to lifecycle manager.
    [lifecycle_manager-11] [INFO] [1686316130.356767188] [lifecycle_manager_navigation]: Server velocity_smoother connected with bond.
    [lifecycle_manager-11] [INFO] [1686316130.356805614] [lifecycle_manager_navigation]: Managed nodes are active
    [lifecycle_manager-11] [INFO] [1686316130.356824253] [lifecycle_manager_navigation]: Creating bond timer...
    [rviz2-12] [INFO] [1686316130.702877560] [rviz2]: Trying to create a map of size 80 x 80 using 1 swatches


The design seems to cover all use-cases from the ticket discussions, and I do
hope, it might be suitable for future utilization by other scenarios.


edited


[ @tonynajjar ](https://github.com/tonynajjar) , thank you for the example
provided above. No matter even if you will hide the data from sensor as Steve,
suggested, I see here an additional use-case application of this feature: it
is dynamically hiding some underlying objects in costmaps. This, BTW even more
strongly speaks to the side of standalone Costmap2D layer running there for
performance reasons.


OK what I'm thinking, since I think we're generally in the first ballpark as
each other but missing on the finer details:


unsigned int index = 0;


[ ROS2 nav2_turorial on win10 ERROR! ](/question/418092/ros2-nav2_turorial-on-
win10-error/)


The environmental representation is the way the robot perceives its
environment. It also acts as the central localization for various algorithms
and data sources to combine their information into a single space. This space
is then used by the controllers, planners, and recoveries to compute their
tasks safely and efficiently.


  * If we want to have costmap layer, vectorizing only costmaps and (probably) filter masks, the design could be done on Costmap Layer level. I would like agree, that it is easier, than making separate vector server.
  * If there will be some options to add vector object on maps, produced by SLAM for example, or something else, we might think about vector server today.


[
![@SteveMacenski](https://avatars.githubusercontent.com/u/14944147?s=40&u=0925d37e9d3569c71d930114b66e6394c2efb3c6&v=4)
](/SteveMacenski) [ SteveMacenski ](/SteveMacenski) closed this as [ completed
](/ros-
planning/navigation2/issues?q=is%3Aissue+is%3Aclosed+archived%3Afalse+reason%3Acompleted)
Jun 10, 2023


Repositories


As well, its worth doing an experiment. I don't think it matters at all what
the size of the polygons the changes have, because either way we need to
recompute the occ grid and then publish out the entire costmap again (unless
we use the updates API - which I'm not sure the costmap filter implement?)

---

All reactions


> However, it might not suffice to prevent the dangerous situation: If
> communication is broken, what can robot B do with this information? It can't
> tell robot A to stop.


[ dharanish-nh ](/dharanish-nh) opened this issue  Jun 9, 2023  · 6 comments


    global_costmap:
      global_costmap:
        ros__parameters:
          update_frequency: 5.0 #2
          publish_frequency: 2.0 #1
          global_frame: ${global_frame}
          robot_base_frame: ${base_link_frame}
          use_sim_time: ${use_sim_time}
          robot_radius: ${robot_radius}
          resolution: 0.05
          track_unknown_space: true
          plugins: ["static_layer", "obstacle_layer", "inflation_layer", "social_layer"]
          filters: ["keepout_filter","speed_filter"]
          speed_filter:
            plugin: "nav2_costmap_2d::SpeedFilter"
            enabled: false
            filter_info_topic: "/speed_filter_info"
            speed_limit_topic: "/speed_limit"
          keepout_filter:
            plugin: "nav2_costmap_2d::KeepoutFilter"
            enabled: false
            filter_info_topic: "/keepout_filter_info"
          obstacle_layer:
            plugin: "nav2_costmap_2d::ObstacleLayer"
            enabled: True
            observation_sources: scan
            scan:
              topic: ${scan_topic}
              max_obstacle_height: 2.0
              clearing: True
              marking: True
              data_type: "LaserScan"
              raytrace_max_range: 8.0 #5
              raytrace_min_range: 0.0
              obstacle_max_range: 5.0 #2.5
              obstacle_min_range: 0.0
          static_layer:
            plugin: "nav2_costmap_2d::StaticLayer"


If we will decide have to support some other objects in the future, I see two
major options there:


###  Behaviors  ¶


[
![@GMahmoud](https://avatars.githubusercontent.com/u/29754310?s=80&u=1493f619be29310ca5f6e336f7f72f4d945ab80f&v=4)
](/GMahmoud)


An aside, but the ` nav2_msgs/Costmap ` was made at a time long ago back when
there were other design plans which were abandoned for the world models. Doing
a brief survey, I cannot find a reason why we still even have that message
around or use it for anything. We can probably throw that away entirely and
replace it with the ` OccupancyGrid ` messages, which as far as I can tell
provide the same information. Its actually quite annoying that we have that
extra type around which serves little functional purpose.

---

All reactions


Turns out I was just performing the std::bind incorrectly when I defined the
subscriber. I got it to work once I bound the callback method to the class
that it belonged to.


StaticLayer::StaticLayer()
: map_buffer_(nullptr)
{
}


**[ AlexeyMerzlyakov ](/AlexeyMerzlyakov) ** commented  Feb 22, 2023  •


  * [ Notifications ](/login?return_to=%2Fros-planning%2Fnavigation2)
  * [ Fork  1.1k  ](/login?return_to=%2Fros-planning%2Fnavigation2)
  * [ Star  2.1k  ](/login?return_to=%2Fros-planning%2Fnavigation2)


To shutdown, we transition into deactivating, cleaning up, shutting down and
end in the finalized state. The networking interfaces are deactivated and stop
processing, deallocate memory, exit cleanly, in those stages, respectively.


* [ noetic ](/questions/scope:all/sort:activity-desc/tags:noetic/page:1/)


void
StaticLayer::incomingUpdate(map_msgs::msg::OccupancyGridUpdate::ConstSharedPtr update)
{
  std::lock_guard<Costmap2D::mutex_t> guard(*getMutex());
  if (update->y < static_cast<int32_t>(y_) ||
    y_ + height_ < update->y + update->height ||
    update->x < static_cast<int32_t>(x_) ||
    x_ + width_ < update->x + update->width)
  {
    RCLCPP_WARN(
      logger_,
      "StaticLayer: Map update ignored. Exceeds bounds of static layer.\n"
      "Static layer origin: %d, %d   bounds: %d X %d\n"
      "Update origin: %d, %d   bounds: %d X %d",
      x_, y_, width_, height_, update->x, update->y, update->width,
      update->height);
    return;
  }


**[ tonynajjar ](/tonynajjar) ** commented  Jun 22, 2022


      * [ New Plugins ](../migration/Foxy.html#new-plugins)
      * [ Costmap Filters ](../migration/Foxy.html#costmap-filters)
      * [ SmacPlanner ](../migration/Foxy.html#smacplanner)
      * [ ThetaStarPlanner ](../migration/Foxy.html#thetastarplanner)
      * [ RegulatedPurePursuitController ](../migration/Foxy.html#regulatedpurepursuitcontroller)
      * [ Costmap2D ` current_  ` Usage ](../migration/Foxy.html#costmap2d-current-usage)
      * [ Standard time units in parameters ](../migration/Foxy.html#standard-time-units-in-parameters)
      * [ Ray Tracing Parameters ](../migration/Foxy.html#ray-tracing-parameters)
      * [ Obstacle Marking Parameters ](../migration/Foxy.html#obstacle-marking-parameters)
      * [ Recovery Action Changes ](../migration/Foxy.html#recovery-action-changes)
      * [ Default Behavior Tree Changes ](../migration/Foxy.html#default-behavior-tree-changes)
      * [ NavFn Planner Parameters ](../migration/Foxy.html#navfn-planner-parameters)
      * [ New ClearCostmapExceptRegion and ClearCostmapAroundRobot BT-nodes ](../migration/Foxy.html#new-clearcostmapexceptregion-and-clearcostmaparoundrobot-bt-nodes)
      * [ New Behavior Tree Nodes ](../migration/Foxy.html#new-behavior-tree-nodes)
      * [ sensor_msgs/PointCloud to sensor_msgs/PointCloud2 Change ](../migration/Foxy.html#sensor-msgs-pointcloud-to-sensor-msgs-pointcloud2-change)
      * [ ControllerServer New Parameter failure_tolerance ](../migration/Foxy.html#controllerserver-new-parameter-failure-tolerance)
      * [ Removed BT XML Launch Configurations ](../migration/Foxy.html#removed-bt-xml-launch-configurations)
      * [ Nav2 RViz Panel Action Feedback Information ](../migration/Foxy.html#nav2-rviz-panel-action-feedback-information)
    * [ Galactic to Humble ](../migration/Galactic.html)
      * [ Major improvements to Smac Planners ](../migration/Galactic.html#major-improvements-to-smac-planners)
      * [ Simple (Python) Commander ](../migration/Galactic.html#simple-python-commander)
      * [ Reduce Nodes and Executors ](../migration/Galactic.html#reduce-nodes-and-executors)
      * [ API Change for nav2_core ](../migration/Galactic.html#api-change-for-nav2-core)
      * [ Extending the BtServiceNode to process Service-Results ](../migration/Galactic.html#extending-the-btservicenode-to-process-service-results)
      * [ Including new Rotation Shim Controller Plugin ](../migration/Galactic.html#including-new-rotation-shim-controller-plugin)
      * [ Spawning the robot in Gazebo ](../migration/Galactic.html#spawning-the-robot-in-gazebo)
      * [ Recovery Behavior Timeout ](../migration/Galactic.html#recovery-behavior-timeout)
      * [ New parameter ` use_final_approach_orientation  ` for the 3 2D planners ](../migration/Galactic.html#new-parameter-use-final-approach-orientation-for-the-3-2d-planners)
      * [ SmacPlanner2D and Theta*: fix goal orientation being ignored ](../migration/Galactic.html#smacplanner2d-and-theta-fix-goal-orientation-being-ignored)
      * [ SmacPlanner2D, NavFn and Theta*: fix small path corner cases ](../migration/Galactic.html#smacplanner2d-navfn-and-theta-fix-small-path-corner-cases)
      * [ Change and fix behavior of dynamic parameter change detection ](../migration/Galactic.html#change-and-fix-behavior-of-dynamic-parameter-change-detection)
      * [ Dynamic Parameters ](../migration/Galactic.html#dynamic-parameters)
      * [ BT Action Nodes Exception Changes ](../migration/Galactic.html#bt-action-nodes-exception-changes)
      * [ BT Navigator Groot Multiple Navigators ](../migration/Galactic.html#bt-navigator-groot-multiple-navigators)
      * [ Removed Kinematic Limiting in RPP ](../migration/Galactic.html#removed-kinematic-limiting-in-rpp)
      * [ Added Smoother Task Server ](../migration/Galactic.html#added-smoother-task-server)
      * [ Removed Use Approach Velocity Scaling Param in RPP ](../migration/Galactic.html#removed-use-approach-velocity-scaling-param-in-rpp)
      * [ Refactored AMCL motion models as plugins ](../migration/Galactic.html#refactored-amcl-motion-models-as-plugins)
      * [ Dropping Support for Live Groot Monitoring of Nav2 ](../migration/Galactic.html#dropping-support-for-live-groot-monitoring-of-nav2)
      * [ Replanning Only if Path is Invalid ](../migration/Galactic.html#replanning-only-if-path-is-invalid)


Controllers, also known as local planners in ROS 1, are the way we follow the
globally computed path or complete a local task. The controller will have
access to a local environment representation to attempt to compute feasible
control efforts for the base to follow. Many controller will project the robot
forward in space and compute a locally feasible path at each update iteration.
Controllers can be written to:


[
![@AlexeyMerzlyakov](https://avatars.githubusercontent.com/u/60094858?s=80&u=bb82ce480f0854e3758a8c4f07129af932258cb1&v=4)
](/AlexeyMerzlyakov)


For your examples


Copy link


> Fill: I think needs to be in circle and polygon to indicate if we want to
> fill the shape, or just outline the shape.


  * [ Code  ](/ros-planning/navigation2)
  * [ Issues  57  ](/ros-planning/navigation2/issues)
  * [ Pull requests  23  ](/ros-planning/navigation2/pulls)
  * [ Actions  ](/ros-planning/navigation2/actions)
  * [ Projects  0  ](/ros-planning/navigation2/projects)
  * [ Security  ](/ros-planning/navigation2/security)
  * [ Insights  ](/ros-planning/navigation2/pulse)


**[ SteveMacenski ](/SteveMacenski) ** commented  Feb 2, 2023


Its also totally fine if you keep it separate, no need to put it into nav2 if
you don't want. We can always add it to our [ Navigation Plugins
](https://navigation.ros.org/plugins/index.html) list in our docs so that its
searchable for users (and possible a tutorial if you're interested in that?)

---

All reactions


just following up, is this actively being worked on or on pause at the moment?

---

All reactions


Sorry, something went wrong.


* 👍  1 reaction


If you find that you require a new interface to the pluginlib definition or
action type, please file a ticket and see if we can rectify that in the same
interfaces.


edited


**[ PranavShevkar ](/PranavShevkar) ** commented  Jan 26, 2024


**[ SteveMacenski ](/SteveMacenski) ** commented  Jun 9, 2023


* Preferred lanes for robots moving in industrial environments and warehouses.


Within the navigation project, there are 2 major transformations that need to
be provided, according to community standards. The ` map  ` to ` odom  `
transform is provided by a positioning system (localization, mapping, SLAM)
and ` odom  ` to ` base_link  ` by an odometry system.


}  // namespace nav2_costmap_2d


Cancel  Create saved search


**[ AlexeyMerzlyakov ](/AlexeyMerzlyakov) ** commented  Jan 31, 2023  •


* [ GitHub Sponsors  Fund open source developers  ](/sponsors)


[
![@tonynajjar](https://avatars.githubusercontent.com/u/14879660?s=80&u=e29d50db1bac036eae32b30fec612615ccd3791a&v=4)
](/tonynajjar)


void
StaticLayer::processMap(const nav_msgs::msg::OccupancyGrid & new_map)
{
  RCLCPP_DEBUG(logger_, "StaticLayer: Process map");


  RCLCPP_DEBUG(
    logger_,
    "StaticLayer: Received a %d X %d map at %f m/pix", size_x, size_y,
    new_map.info.resolution);


[ __ ](/questions/) |


[ ](https://github.com "GitHub") © 2024 GitHub, Inc.


[
![@GMahmoud](https://avatars.githubusercontent.com/u/29754310?s=80&u=1493f619be29310ca5f6e336f7f72f4d945ab80f&v=4)
](/GMahmoud)


* ❤  1 reaction


Similar situation will be for shapes adding/removing services. We need to have
each type of service per each shape to add, but we can get by with one
removing service for all shapes (removing by ` uuid ` ), as I've mentioned in
latest design PDF update from prev.message.


Copy link


Lifecycle (or Managed, more correctly) nodes are unique to ROS 2. More
information can be [ found here
](https://design.ros2.org/articles/node_lifecycle.html) . They are nodes that
contain state machine transitions for bringup and teardown of ROS 2 servers.
This helps in determinstic behavior of ROS systems in startup and shutdown. It
also helps users structure their programs in reasonable ways for commercial
uses and debugging.


If you're a commercial company, [ Open Navigation ](https://www.opennav.org/)
offers consulting services they may be able to help, but feel 0 pressure about
that, I'm only mentioning it as an option if that is an appropriate potential
service to be aware of.

---

All reactions


edited


Development


[
![@SteveMacenski](https://avatars.githubusercontent.com/u/14944147?s=80&u=0925d37e9d3569c71d930114b66e6394c2efb3c6&v=4)
](/SteveMacenski)


Sorry, something went wrong.


    * [ Costmap 2D ](../configuration/packages/configuring-costmaps.html)
      * [ Costmap2D ROS Parameters ](../configuration/packages/configuring-costmaps.html#costmap2d-ros-parameters)
      * [ Default Plugins ](../configuration/packages/configuring-costmaps.html#default-plugins)
      * [ Plugin Parameters ](../configuration/packages/configuring-costmaps.html#plugin-parameters)
        * [ Static Layer Parameters ](../configuration/packages/costmap-plugins/static.html)
        * [ Inflation Layer Parameters ](../configuration/packages/costmap-plugins/inflation.html)
        * [ Obstacle Layer Parameters ](../configuration/packages/costmap-plugins/obstacle.html)
        * [ Voxel Layer Parameters ](../configuration/packages/costmap-plugins/voxel.html)
        * [ Range Sensor Parameters ](../configuration/packages/costmap-plugins/range.html)
        * [ Denoise Layer Parameters ](../configuration/packages/costmap-plugins/denoise.html)
      * [ Costmap Filters Parameters ](../configuration/packages/configuring-costmaps.html#costmap-filters-parameters)
        * [ Keepout Filter Parameters ](../configuration/packages/costmap-plugins/keepout_filter.html)
        * [ Speed Filter Parameters ](../configuration/packages/costmap-plugins/speed_filter.html)
        * [ Binary Filter Parameters ](../configuration/packages/costmap-plugins/binary_filter.html)
      * [ Example ](../configuration/packages/configuring-costmaps.html#example)
    * [ Lifecycle Manager ](../configuration/packages/configuring-lifecycle.html)
      * [ Parameters ](../configuration/packages/configuring-lifecycle.html#parameters)
      * [ Example ](../configuration/packages/configuring-lifecycle.html#example)
    * [ Planner Server ](../configuration/packages/configuring-planner-server.html)
      * [ Parameters ](../configuration/packages/configuring-planner-server.html#parameters)
      * [ Default Plugins ](../configuration/packages/configuring-planner-server.html#default-plugins)
      * [ Example ](../configuration/packages/configuring-planner-server.html#example)
    * [ NavFn Planner ](../configuration/packages/configuring-navfn.html)
      * [ Parameters ](../configuration/packages/configuring-navfn.html#parameters)
      * [ Example ](../configuration/packages/configuring-navfn.html#example)
    * [ Smac Planner ](../configuration/packages/configuring-smac-planner.html)
      * [ Provided Plugins ](../configuration/packages/configuring-smac-planner.html#provided-plugins)
        * [ Smac 2D Planner ](../configuration/packages/smac/configuring-smac-2d.html)
        * [ Smac Hybrid-A* Planner ](../configuration/packages/smac/configuring-smac-hybrid.html)
        * [ Smac State Lattice Planner ](../configuration/packages/smac/configuring-smac-lattice.html)
      * [ Description ](../configuration/packages/configuring-smac-planner.html#description)
    * [ Theta Star Planner ](../configuration/packages/configuring-thetastar.html)
      * [ Parameters ](../configuration/packages/configuring-thetastar.html#parameters)
      * [ Example ](../configuration/packages/configuring-thetastar.html#example)
    * [ Controller Server ](../configuration/packages/configuring-controller-server.html)
      * [ Parameters ](../configuration/packages/configuring-controller-server.html#parameters)
      * [ Provided Plugins ](../configuration/packages/configuring-controller-server.html#provided-plugins)
        * [ SimpleProgressChecker ](../configuration/packages/nav2_controller-plugins/simple_progress_checker.html)
        * [ PoseProgressChecker ](../configuration/packages/nav2_controller-plugins/pose_progress_checker.html)
        * [ SimpleGoalChecker ](../configuration/packages/nav2_controller-plugins/simple_goal_checker.html)


* [ 2DCostmap2DROS ](/questions/scope:all/sort:activity-desc/tags:2DCostmap2DROS/page:1/)


Email Address


####  Expected behavior


Resources


Action servers are used in this stack to communicate with the highest level BT
navigator through a ` NavigateToPose  ` action message. They are also used for
the BT navigator to communicate with the subsequent smaller action servers to
compute plans, control efforts, and recoveries. Each will have their own
unique ` .action  ` type in ` nav2_msgs  ` for interacting with the servers.


[ none ](/questions/scope:all/sort:activity-desc/tags:none/page:1/) ×


The priority is made for the case when we intentionally want to make the order
of intersections of the vector objects. This is the case if we want to some
objects with lower value to intentionally to lay _over_ the ones with higher
values while using ` use_max = True ` indicator. Or this is required for the
example where we will use the ` transparency ` , described a little bit below.


For this project, we use [ BehaviorTree CPP V3
](https://www.behaviortree.dev/) as the behavior tree library. We create node
plugins which can be constructed into a tree, inside the ` BT  Navigator  ` .
The node plugins are loaded into the BT and when the XML file of the tree is
parsed, the registered names are associated. At this point, we can march
through the behavior tree to navigate.


    * [ CI/CD & Automation ](/solutions/ci-cd/)
    * [ DevOps ](/solutions/devops/)
    * [ DevSecOps  ](https://resources.github.com/devops/fundamentals/devsecops/)


**[ AlexeyMerzlyakov ](/AlexeyMerzlyakov) ** commented  Feb 3, 2023


using nav2_costmap_2d::NO_INFORMATION;
using nav2_costmap_2d::LETHAL_OBSTACLE;
using nav2_costmap_2d::FREE_SPACE;
using rcl_interfaces::msg::ParameterType;


[ tags ](/tags/) [ users ](/users/) [ badges ](/badges/)


> Each type of polygon (speed zone, keepout, etc) is in a separate file so
> they're subscribed to by different costmap filters on different topics


> But I'd here rather more inclined to an extra transparency indicator than to
> make new essences instead.


My initial idea was to maximum re-use the existing messages (like `
PolygonStamped.msg ` or ` shape_msgs/msg/SolidPrimitive.msg ` ). However,
having such attributes as fill value, shape uuid, overlay type, makes me think
that we need to have some universal ` Shape.msg ` (or ` Form.msg ` as it made
in virtual_costmap_layer) with all these fields inside. However, the
possibility of future expansion of types of shapes (e.g. ellipse, 3D-bar,
etc...) makes it to be a super-message with all sub-messages inside and
leading to unnecessary memory usage. Thus, it seems to more reasonable to
follow in the footsteps of PCL and make some universal message structure,
with:


> Do we plan to support only polygons (+maybe circle), or have an ability of
> expansion to other vector objects in the future (e.g. ellipse, arc, sector,
> ...)?


##  Environmental Representation  ¶


namespace nav2_costmap_2d
{


Member


Copy link


**[ AlexeyMerzlyakov ](/AlexeyMerzlyakov) ** commented  Feb 22, 2023


**[ SteveMacenski ](/SteveMacenski) ** commented  Jun 15, 2022


Include my email address so I can be contacted


  if (update->header.frame_id != map_frame_) {
    RCLCPP_WARN(
      logger_,
      "StaticLayer: Map update ignored. Current map is in frame %s "
      "but update was in frame %s",
      map_frame_.c_str(), update->header.frame_id.c_str());
  }


I don't see a strong need to support multiple subclass shapes (eg squares,
bars) separately as ` types ` in the message from just having arbitrary
polygons defined as a set of points. Any non-arcing shape (e.g. circles) can
just be defined as a set of points. Additional information of would be ` fill
` , or similar is good. That would tell us to fill the shape with cost rather
than just the outline. If not ` fill ` then its just the outline. Maybe also `
connect_ends ` or similarly named if the start and end nodes should be
connected so that we close the shape (required for ` fill ` ) to allow for
lines. I don't understand ` priority ` ` is_bigendian ` or separate ` data `
in this context.


##  Use saved searches to filter your results more quickly


Last updated: **Jun 15 '23**


####  Additional information


###  Planner, Controller, Smoother and Recovery Servers  ¶


You signed in with another tab or window. [ Reload ]() to refresh your
session.  You signed out in another tab or window. [ Reload ]() to refresh
your session.  You switched accounts on another tab or window. [ Reload ]() to
refresh your session.  Dismiss alert


Collaborator


This could be resolved by adding some new essences like "rings", initially [
proposed ](https://github.com/GMahmoud/virtual_costmap_layer/blob/feature-big-
refactoring/msg/Polygon.msg) in the "virtual_costmap_layer". But I'd here
rather more inclined to an extra ` transparency ` indicator than to make new
essences instead.


Search or jump to...


        x_ = y_ = 0;
        width_ = size_x_;
        height_ = size_y_;
        has_updated_data_ = true;
        current_ = false;
      }
    }
  }
  result.successful = true;
  return result;
}


* [ Pricing ](/pricing)


Member


For


  double scale = static_cast<double>(value) / lethal_threshold_;
  return scale * LETHAL_OBSTACLE;
}


edited


__ [ Navigation 2 ](../index.html)


Copy link


Jump to bottom


Toggle navigation


**[ GMahmoud ](/GMahmoud) ** commented  Jun 15, 2022  •


**[ dharanish-nh ](/dharanish-nh) ** commented  Jun 10, 2023


add a comment


> Add RPC instead of published msgs in order to have the possibility of
> deleting obstacles with id identification,


  * [ Terms ](https://docs.github.com/site-policy/github-terms/github-terms-of-service)
  * [ Privacy ](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement)
  * [ Security ](/security)
  * [ Status ](https://www.githubstatus.com/)
  * [ Docs ](https://docs.github.com/)
  * [ Contact ](https://support.github.com?tags=dotcom-footer)
  * Manage cookies
  * Do not share my personal information


> But isn't that what the costmap filters are for? I don't think that's a con,
> that's just a feature that already exists.


[ rviz crash at launch ](/question/393528/rviz-crash-at-launch/)


Regarding the server vs layer model: the main question was in that - do we
plan to vectorize Costmap2D-s, or ` OccupancyGrid ` maps as well? My idea is
to have vector objects applied not only to costmap layers, but to costmap
filters as well. Costmap Filters are reading input ` OccupancyGrid ` filter
mask from the topic, and some of them are not plotting it to the master
costmap (for example, Speed Filter, which reads and stores OccupancyGrid map
inside, but resulting costmap won't be merged with incoming filter mask).
Therefore, adding vector objects only to costmaps may not enough. We need to
work with both Costmaps and OccupancyGrid-s as well.


**[ SteveMacenski ](/SteveMacenski) ** commented  Feb 7, 2023


map_frame_ = new_map.header.frame_id;


###  Planners  ¶


[ Sign in ](/login?return_to=https%3A%2F%2Fgithub.com%2Fros-
planning%2Fnavigation2%2Fissues%2F3017)


I have some doubts about the case when we have large map with (large)
restricting polygon + dynamically moving/updating another polygon and small
rolling window for resulting costmap, like depicted below:
[ ![map](https://user-
images.githubusercontent.com/60094858/217129528-ef329b17-5144-4559-8191-c6227746c006.png)
](https://user-
images.githubusercontent.com/60094858/217129528-ef329b17-5144-4559-8191-c6227746c006.png)


void
StaticLayer::updateBounds(
  double /*robot_x*/, double /*robot_y*/, double /*robot_yaw*/, double * min_x,
  double * min_y,
  double * max_x,
  double * max_y)
{
  if (!map_received_) {
    map_received_in_update_bounds_ = false;
    return;
  }
  map_received_in_update_bounds_ = true;


Contributor  Author


  * [ Code  ](/ros-planning/navigation2)
  * [ Issues  57  ](/ros-planning/navigation2/issues)
  * [ Pull requests  23  ](/ros-planning/navigation2/pulls)
  * [ Actions  ](/ros-planning/navigation2/actions)
  * [ Projects  0  ](/ros-planning/navigation2/projects)
  * [ Security  ](/ros-planning/navigation2/security)
  * [ Insights  ](/ros-planning/navigation2/pulse)


[ dharanish-nh ](/dharanish-nh) opened this issue  Jun 9, 2023  · 6 comments


Global yaml file


* Dock with a charging station using detectors in the odometric frame


Milestone


Copy link


  * array of shape key-points (it could be vertexes for polygon, edges for broken line, or center of circle) and
  * some data[], stored in the bytes array, and representing whenever-you-want depending on shape type. This might be the ` radius ` for the circle, or ` [size_x, size_y, size_z, angle_yaw, angle_pitch, angle_roll] ` array for 3D-object.


###  Footer navigation


##  Footer


getParameters();


Already on GitHub? [ Sign in ](/login?return_to=%2Fros-
planning%2Fnavigation2%2Fissues%2Fnew%2Fchoose) to your account


[ Sign up
](/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-
name%3E%2F%3Crepo-
name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-
repo&source_repo=ros-planning%2Fnavigation2)


**[ SteveMacenski ](/SteveMacenski) ** commented  Jan 31, 2023  •


Collaborator


Why? The keepout filter would be more flexible, and the static layer doesn't
allow for shapes to represent other things like speed zones. Its in effect the
same thing, but doesn't allow remapping of values potentially stored in the
shape files. If we're going to allow the user to have shapes with other things
like Speed or Triggering, why use the Static layer (not a costmap filter)
instead of the Keepout filter -- when all others are costmap filters?


Now I looks understand well your intention: to use Keepout Filter for
resulting costmap updates.
Yes, this will work.
My intention was to use ` StaticLayer ` for this.
However, when we will use VirtualObject-server, _both_ options (spreading VO
through Keepout Filter or either through Static Layer) will work. So, it is
not a problem in our case. Later, we could recommend developers to use Static
Layer or Keepout Filter, depending on their tasks.


Sorry, something went wrong.


    [controller_server-4] [INFO] [1686316127.841188146] [controller_server]: Critic plugin initialized
    [controller_server-4] [INFO] [1686316127.841424621] [controller_server]: Using critic "GoalAlign" (dwb_critics::GoalAlignCritic)
    [controller_server-4] [INFO] [1686316127.842192969] [controller_server]: Critic plugin initialized
    [controller_server-4] [INFO] [1686316127.842447922] [controller_server]: Using critic "PathAlign" (dwb_critics::PathAlignCritic)
    [controller_server-4] [INFO] [1686316127.843137631] [controller_server]: Critic plugin initialized
    [controller_server-4] [INFO] [1686316127.843418015] [controller_server]: Using critic "PathDist" (dwb_critics::PathDistCritic)
    [controller_server-4] [INFO] [1686316127.843916551] [controller_server]: Critic plugin initialized
    [controller_server-4] [INFO] [1686316127.844208187] [controller_server]: Using critic "GoalDist" (dwb_critics::GoalDistCritic)
    [controller_server-4] [INFO] [1686316127.845048564] [controller_server]: Critic plugin initialized
    [controller_server-4] [INFO] [1686316127.845123637] [controller_server]: Controller Server has FollowPath  controllers available.
    [lifecycle_manager-11] [INFO] [1686316127.852738059] [lifecycle_manager_navigation]: Configuring smoother_server
    [smoother_server-5] [INFO] [1686316127.852961595] [smoother_server]: Configuring smoother server
    [smoother_server-5] [INFO] [1686316127.861012067] [smoother_server]: Created smoother : simple_smoother of type nav2_smoother::SimpleSmoother
    [smoother_server-5] [INFO] [1686316127.862870550] [smoother_server]: Smoother Server has simple_smoother  smoothers available.
    [lifecycle_manager-3] [INFO] [1686316127.866982514] [lifecycle_manager_localization]: Server map_server connected with bond.
    [lifecycle_manager-3] [INFO] [1686316127.867024459] [lifecycle_manager_localization]: Activating amcl
    [amcl-2] [INFO] [1686316127.867293826] [amcl]: Activating
    [amcl-2] [INFO] [1686316127.867329360] [amcl]: initialPoseReceived
    [amcl-2] [INFO] [1686316127.867359350] [amcl]: Setting pose (4.931000): 0.000 0.000 0.000
    [lifecycle_manager-11] [INFO] [1686316127.867860288] [lifecycle_manager_navigation]: Configuring planner_server
    [amcl-2] [INFO] [1686316127.867981522] [amcl]: Creating bond (amcl) to lifecycle manager.
    [planner_server-6] [INFO] [1686316127.868126332] [planner_server]: Configuring
    [planner_server-6] [INFO] [1686316127.868172199] [global_costmap.global_costmap]: Configuring
    [planner_server-6] [INFO] [1686316127.873242852] [global_costmap.global_costmap]: Using plugin "static_layer"
    [planner_server-6] [INFO] [1686316127.879654160] [global_costmap.global_costmap]: Subscribing to the map topic (/map) with transient local durability
    [planner_server-6] [INFO] [1686316127.880937278] [global_costmap.global_costmap]: Initialized plugin "static_layer"
    [planner_server-6] [INFO] [1686316127.880972617] [global_costmap.global_costmap]: Using plugin "obstacle_layer"
    [planner_server-6] [INFO] [1686316127.883267488] [global_costmap.global_costmap]: Subscribed to Topics: scan
    [planner_server-6] [INFO] [1686316127.890345721] [global_costmap.global_costmap]: Initialized plugin "obstacle_layer"
    [planner_server-6] [INFO] [1686316127.890475517] [global_costmap.global_costmap]: Using plugin "inflation_layer"
    [planner_server-6] [INFO] [1686316127.892914263] [global_costmap.global_costmap]: Initialized plugin "inflation_layer"
    [planner_server-6] [INFO] [1686316127.892952080] [global_costmap.global_costmap]: Using plugin "social_layer"
    [planner_server-6] [INFO] [1686316127.898181142] [global_costmap.global_costmap]: SocialLayer: subscribed to topic /people
    [planner_server-6] [INFO] [1686316127.903577429] [global_costmap.global_costmap]: Initialized plugin "social_layer"
    [planner_server-6] [INFO] [1686316127.903621479] [global_costmap.global_costmap]: Using costmap filter "keepout_filter"
    [planner_server-6] [INFO] [1686316127.907831871] [global_costmap.global_costmap]: Initialized costmap filter "keepout_filter"
    [planner_server-6] [INFO] [1686316127.907877287] [global_costmap.global_costmap]: Using costmap filter "speed_filter"
    [planner_server-6] [INFO] [1686316127.910240890] [global_costmap.global_costmap]: Initialized costmap filter "speed_filter"
    [planner_server-6] [INFO] [1686316127.922225482] [planner_server]: Created global planner plugin GridBased of type nav2_navfn_planner/NavfnPlanner
    [planner_server-6] [INFO] [1686316127.922267490] [planner_server]: Configuring plugin GridBased of type NavfnPlanner


[
![@SteveMacenski](https://avatars.githubusercontent.com/u/14944147?s=40&u=0925d37e9d3569c71d930114b66e6394c2efb3c6&v=4)
](/SteveMacenski) [ SteveMacenski ](/SteveMacenski) added the [ enhancement
](/ros-planning/navigation2/labels/enhancement) New feature or request  label
Jun 15, 2022


        * [ GoalCheckerSelector ](../configuration/packages/bt-plugins/actions/GoalCheckerSelector.html)
        * [ NavigateThroughPoses ](../configuration/packages/bt-plugins/actions/NavigateThroughPoses.html)
        * [ ComputePathThroughPoses ](../configuration/packages/bt-plugins/actions/ComputePathThroughPoses.html)
        * [ RemovePassedGoals ](../configuration/packages/bt-plugins/actions/RemovePassedGoals.html)
        * [ CancelControl ](../configuration/packages/bt-plugins/actions/CancelControl.html)
        * [ CancelBackUp ](../configuration/packages/bt-plugins/actions/CancelBackUp.html)
        * [ CancelSpin ](../configuration/packages/bt-plugins/actions/CancelSpin.html)
        * [ CancelWait ](../configuration/packages/bt-plugins/actions/CancelWait.html)
        * [ CancelDriveOnHeading ](../configuration/packages/bt-plugins/actions/CancelDriveOnHeading.html)
        * [ CancelAssistedTeleop ](../configuration/packages/bt-plugins/actions/CancelAssistedTeleop.html)
        * [ SmoothPath ](../configuration/packages/bt-plugins/actions/Smooth.html)
      * [ Condition Plugins ](../configuration/packages/configuring-bt-xml.html#condition-plugins)
        * [ GoalReached ](../configuration/packages/bt-plugins/conditions/GoalReached.html)
        * [ TransformAvailable ](../configuration/packages/bt-plugins/conditions/TransformAvailable.html)
        * [ DistanceTraveled ](../configuration/packages/bt-plugins/conditions/DistanceTraveled.html)
        * [ GoalUpdated ](../configuration/packages/bt-plugins/conditions/GoalUpdated.html)
        * [ GloballyUpdatedGoal ](../configuration/packages/bt-plugins/conditions/GloballyUpdatedGoal.html)
        * [ InitialPoseReceived ](../configuration/packages/bt-plugins/conditions/InitialPoseReceived.html)
        * [ IsStuck ](../configuration/packages/bt-plugins/conditions/IsStuck.html)
        * [ TimeExpired ](../configuration/packages/bt-plugins/conditions/TimeExpired.html)
        * [ IsBatteryLow ](../configuration/packages/bt-plugins/conditions/IsBatteryLow.html)
        * [ IsPathValid ](../configuration/packages/bt-plugins/conditions/IsPathValid.html)
        * [ PathExpiringTimer ](../configuration/packages/bt-plugins/conditions/PathExpiringTimer.html)
        * [ AreErrorCodesPresent ](../configuration/packages/bt-plugins/conditions/AreErrorCodesPresent.html)
        * [ WouldAControllerRecoveryHelp ](../configuration/packages/bt-plugins/conditions/WouldAControllerRecoveryHelp.html)
        * [ WouldAPlannerRecoveryHelp ](../configuration/packages/bt-plugins/conditions/WouldAPlannerRecoveryHelp.html)
        * [ WouldASmootherRecoveryHelp ](../configuration/packages/bt-plugins/conditions/WouldASmootherRecoveryHelp.html)
        * [ IsBatteryCharging ](../configuration/packages/bt-plugins/conditions/IsBatteryCharging.html)
      * [ Control Plugins ](../configuration/packages/configuring-bt-xml.html#control-plugins)
        * [ PipelineSequence ](../configuration/packages/bt-plugins/controls/PipelineSequence.html)
        * [ RoundRobin ](../configuration/packages/bt-plugins/controls/RoundRobin.html)
        * [ RecoveryNode ](../configuration/packages/bt-plugins/controls/RecoveryNode.html)
      * [ Decorator Plugins ](../configuration/packages/configuring-bt-xml.html#decorator-plugins)
        * [ RateController ](../configuration/packages/bt-plugins/decorators/RateController.html)
        * [ DistanceController ](../configuration/packages/bt-plugins/decorators/DistanceController.html)
        * [ SpeedController ](../configuration/packages/bt-plugins/decorators/SpeedController.html)
        * [ GoalUpdater ](../configuration/packages/bt-plugins/decorators/GoalUpdater.html)
        * [ PathLongerOnApproach ](../configuration/packages/bt-plugins/decorators/PathLongerOnApproach.html)
        * [ SingleTrigger ](../configuration/packages/bt-plugins/decorators/SingleTrigger.html)
      * [ Example ](../configuration/packages/configuring-bt-xml.html#example)


**[ SteveMacenski ](/SteveMacenski) ** commented  Jun 16, 2022


[ ](https://github.com "GitHub") © 2024 GitHub, Inc.


Member


[ edit ](/questions/414211/edit/) [ retag ](/s/questions/414211/retag/) flag
offensive  [ close ](/questions/414211/close/) merge  delete


We read every piece of feedback, and take your input very seriously.


Sign up for GitHub


It is the job of the global positioning system (GPS, SLAM, Motion Capture) to,
at minimum, provide the ` map  ` -> ` odom  ` transformation. We provide `
amcl  ` which is an Adaptive Monte-Carlo Localization technique based on a
particle filter for localization of a static map. We also provide SLAM Toolbox
as the default SLAM algorithm for use to position and generate a static map.


I figured their own files would be most sensible because of the fact that if
you're deploying ` N ` robots across ` M ` facilities in the world, each of
the ` M ` facilities is going to have its own set of keepout zones / vector
files. But perhaps that can be a step after we have a prototype to look over
the param file and see if we can easily separate out nodes that are (1) robot
specific vs (2) facility specific to see if we can pre-break-up the files
corresponding to those criteria for deployed users. Off the top of my head,
only the map server would be the "other" big thing.

---

All reactions


  * Reading non-vectorized ` OccupancyGrid ` map format from input topic and plotting added vectors on it. After it:
    * Publishing vectorized ` OccupancyGrid ` map to the output topic
    * Returning back vectorized ` Costmap2D ` to the VectorObject costmap layer, by service request


P.S: Feel free to let me know if I missed another solution Nav2 offers for
this problem

---

All reactions


[ ![@dharanish-
nh](https://avatars.githubusercontent.com/u/15521002?s=80&u=ef939dba8902fa59a5ab3a6fceb06a2486ead81a&v=4)
](/dharanish-nh)


To see all available qualifiers, see our [ documentation
](https://docs.github.com/search-github/github-code-search/understanding-
github-code-search-syntax) .


[
![@SteveMacenski](https://avatars.githubusercontent.com/u/14944147?s=80&u=0925d37e9d3569c71d930114b66e6394c2efb3c6&v=4)
](/SteveMacenski)


**[ SteveMacenski ](/SteveMacenski) ** commented  Feb 1, 2023  •


Copy link


> Why? The keepout filter would be more flexible, and the static layer doesn't
> allow for shapes to represent other things like speed zones.


It is being used, but mostly with the details hidden in the costmap subscriber
and costmap publisher objects. There's no need for it at all, the
OccupancyGrid messages do the same. They added in a ` layer ` string name for
distributed world model use but I quickly vetoed that for safety concerns but
that work was already done.


    * [ All features ](/features)
    * [ Documentation  ](https://docs.github.com)
    * [ GitHub Skills  ](https://skills.github.com/)
    * [ Blog  ](https://github.blog)


Per our discussion in the WG meeting:


Not certainly in that way. In case of StaticLayer, we will re-use one of the
existing costmap layer to make and apply (to master grid) raster costmap made
from obtained input ` OccupancyGrid ` map, which is made by VO server from
vector objects.
For costmap filters (keepout, speed, binary, etc...): they are already reading
` OccupancyGrid ` -s, so costmap filters could be connected to VO-server tuned
to add vector objects to filter masks, directly; w/o any additional middle
wrapper or layer.


  // we have a new map, update full size of map
  std::lock_guard<Costmap2D::mutex_t> guard(*getMutex());


#  Feature Request: Custom/Virtual Obstacle Layer  #3017


**[ tonynajjar ](/tonynajjar) ** commented  Sep 20, 2023


* Compute paths along sparse or predefined routes


      * [ Velocity smoother applies deceleration when timeout ](../migration/Humble.html#velocity-smoother-applies-deceleration-when-timeout)
      * [ PoseProgressChecker plugin ](../migration/Humble.html#poseprogresschecker-plugin)
      * [ Allow multiple goal checkers and change parameter progress_checker_plugin(s) name and type ](../migration/Humble.html#allow-multiple-goal-checkers-and-change-parameter-progress-checker-plugin-s-name-and-type)
      * [ IsBatteryChargingCondition BT Node ](../migration/Humble.html#isbatterychargingcondition-bt-node)
      * [ Behavior Server Error Codes ](../migration/Humble.html#behavior-server-error-codes)
      * [ New Denoise Costmap Layer Plugin ](../migration/Humble.html#new-denoise-costmap-layer-plugin)
      * [ SmacPlannerHybrid viz_expansions parameter ](../migration/Humble.html#smacplannerhybrid-viz-expansions-parameter)
  * [ Simple Commander API ](../commander_api/index.html)
    * [ Overview ](../commander_api/index.html#overview)
    * [ Commander API ](../commander_api/index.html#id1)
    * [ Costmap API ](../commander_api/index.html#costmap-api)
    * [ Footprint Collision Checker API ](../commander_api/index.html#footprint-collision-checker-api)
    * [ Examples and Demos ](../commander_api/index.html#examples-and-demos)
  * [ Roadmaps ](../roadmap/roadmap.html)
    * [ Iron Roadmap ](../roadmap/roadmap.html#iron-roadmap)
    * [ Humble Roadmap ](../roadmap/roadmap.html#humble-roadmap)
  * [ About and Contact ](../about/index.html)
    * [ Related Projects ](../about/related_projects.html)
    * [ ROS to ROS 2 Navigation ](../about/ros1_comparison.html)
    * [ About ](../about/index.html#id1)
    * [ Contact ](../about/index.html#contact)
  * [ Robots Using ](../about/robots.html)


###  Other Forms  ¶


The general task in Nav2 for a smoother is to receive a path and return its
improved version. However, different input paths, criteria of the improvements
and methods of acquiring them exist, creating space for multitude of smoothers
that can be registered in this server.


[
![@GMahmoud](https://avatars.githubusercontent.com/u/29754310?s=80&u=1493f619be29310ca5f6e336f7f72f4d945ab80f&v=4)
](/GMahmoud)


The general task in Nav2 for a controller is to compute a valid control effort
to follow the global plan. However, many classes of controllers and local
planners exist. It is the goal of this project that all controller algorithms
can be plugins in this server for common research and industrial tasks.


> You have the option in a costmap layer to "override" cost instead of taking
> the maximum. So you can have the detector layer of your pallet that you'd be
> using to clear the costmap as the highest layer and it would wipe out all
> the sensor measurements as long as you're detecting the pallet there (or
> whatever your logic). That's probably the easiest way and only ~200 lines of
> code.


If you have a vector of points making up a polygon stored in a layer, it can
be used to fill in the costmap2D entries of the master grid on request (or
retain an internal grid structure of the polygons, I suppose, depending on
what's more optimal from an update cycle perspective). There's no real need to
be thinking about ROS interfaces like ` OccupancyGrid ` s or `
nav2_msgs/Costmap ` s. That's all handled for you in the backend for
publication and visualization in rviz.


  auto node = node_.lock();
  if (!node) {
    throw std::runtime_error{"Failed to lock node"};
  }


Copy link


**[ AlexeyMerzlyakov ](/AlexeyMerzlyakov) ** commented  Feb 6, 2023  •


**[ dharanish-nh ](/dharanish-nh) ** commented  Jun 9, 2023  •


* [ GitHub Sponsors  Fund open source developers  ](/sponsors)


Within Nav2, we use a wrapper of LifecycleNodes, ` nav2_util  LifecycleNode  `
. This wrapper wraps much of the complexities of LifecycleNodes for typical
applications. It also includes a ` bond  ` connection for the lifecycle
manager to ensure that after a server transitions up, it also remains active.
If a server crashes, it lets the lifecycle manager know and transition down
the system to prevent a critical failure. See [ Eloquent to Foxy
](../migration/Eloquent.html#eloquent-migration) for details.


[
![@SteveMacenski](https://avatars.githubusercontent.com/u/14944147?s=80&u=0925d37e9d3569c71d930114b66e6394c2efb3c6&v=4)
](/SteveMacenski)


Labels


#  robot doesn't navigate in custom costmap layer.  #3613


However, I haven't found a good way to do this.


[
![@AlexeyMerzlyakov](https://avatars.githubusercontent.com/u/60094858?s=80&u=bb82ce480f0854e3758a8c4f07129af932258cb1&v=4)
](/AlexeyMerzlyakov)


**[ GMahmoud ](/GMahmoud) ** commented  Oct 5, 2022  •


###  Action Server  ¶


* Product


Member


error: no matching function for call to ‘std::function<void(const geometry_msgs::msg::Pose2D_<std::allocator<void> >&)>::function(std::_Bind<void (jackstand_objective_costmap_plugin::JSLayer::*(std::shared_ptr<rclcpp_lifecycle::LifecycleNode>, std::_Placeholder<1>))(const geometry_msgs::msg::Pose2D_<std::allocator<void> >&)>&)’  394 |       callback_variant_ = static_cast<typename scbth::callback_type>(callback);


[ JSLbotbuilder ](/users/145125/jslbotbuilder/)
1  ●  2  ●  3  ●  3


Next update of feature HLD is here: [ VO_design_20230222.pdf
](https://github.com/ros-
planning/navigation2/files/10804353/VO_design_20230222.pdf) .
New Costmap2D layer is not required in this case: the VO-server to be used
with ` KeepoutFilter ` in Costmap2D. It can not be used with ` StaticLayer `
for the following reasons:


    * [ Learning Pathways  ](https://resources.github.com/learn/pathways/)
    * [ White papers, Ebooks, Webinars  ](https://resources.github.com/)
    * [ Customer Stories ](/customer-stories)
    * [ Partners  ](https://partner.github.com/)


##  Nav2 Academic Overview  ¶


[ enhancement  ](/ros-planning/navigation2/labels/enhancement) New feature or
request


> You mean the costmap filters (keepout + speed), right? To be able to do
> other non-just-cost tasks with the polygon's values


Costmap filters - is costmap layer based approach of applying spatial-
dependent behavioral changes annotated in filter masks, into Nav2 stack.
Costmap filters are implemented as costmap plugins. These plugins are called
“filters” as they are filtering a costmap by spatial annotations marked on
filter masks. In order to make a filtered costmap and change robot’s behavior
in annotated areas, filter plugin reads the data came from filter mask. This
data is being linearly transformed into feature map in a filter space. Having
this transformed feature map along with a map/costmap, any sensors data and
current robot coordinates filters can update underlying costmap and change
behavior of the robot depending on where it is. For example, the following
functionality could be made by using of costmap filters:


  node->get_parameter(name_ + "." + "enabled", enabled_);
  node->get_parameter(name_ + "." + "subscribe_to_updates", subscribe_to_updates_);
  std::string private_map_topic, global_map_topic;
  node->get_parameter(name_ + "." + "map_topic", private_map_topic);
  node->get_parameter("map_topic", global_map_topic);
  if (!private_map_topic.empty()) {
    map_topic_ = private_map_topic;
  } else {
    map_topic_ = global_map_topic;
  }
  node->get_parameter(
    name_ + "." + "map_subscribe_transient_local",
    map_subscribe_transient_local_);
  node->get_parameter("track_unknown_space", track_unknown_space_);
  node->get_parameter("use_maximum", use_maximum_);
  node->get_parameter("lethal_cost_threshold", temp_lethal_threshold);
  node->get_parameter("unknown_cost_value", unknown_cost_value_);
  node->get_parameter("trinary_costmap", trinary_costmap_);
  node->get_parameter("transform_tolerance", temp_tf_tol);


#include <algorithm>
#include <string>


  * Operating System: Ubuntu 22.04
    *   * ROS2 Version: Humble
    *   * Version or commit hash: 1.1.6-1jammy.20230426.100219
    *   * DDS implementation: RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
    *


The current environmental representation is a costmap. A costmap is a regular
2D grid of cells containing a cost from unknown, free, occupied, or inflated
cost. This costmap is then searched to compute a global plan or sampled to
compute local control efforts.


###  Waypoint Following  ¶


Yep. Moreover, if ` closed ` is set to ` true ` , we will check the ` fill `
value set or not. If ` closed := false ` , talking about filling makes no
sense in this case.


  for (auto parameter : parameters) {
    const auto & param_type = parameter.get_type();
    const auto & param_name = parameter.get_name();


Sorry, something went wrong.


Copy link


  if (subscribe_to_updates_) {
    RCLCPP_INFO(logger_, "Subscribing to updates");
    map_update_sub_ = node->create_subscription<map_msgs::msg::OccupancyGridUpdate>(
      map_topic_ + "_updates",
      rclcpp::SystemDefaultsQoS(),
      std::bind(&StaticLayer::incomingUpdate, this, std::placeholders::_1));
  }
}


Email Address


transform_tolerance_ = tf2::durationFromSec(temp_tf_tol);


In this situation, action servers and clients allow us to call a long-running
task in another process or thread and return a future to its result. It is
permissible at this point to block until the action is complete, however, you
may want to occasionally check if the action is complete and continue to
process work in the client thread. Since it is long-running, action servers
will also provide feedback to their clients. This feedback can be anything and
is defined in the ROS ` .action  ` along with the request and result types. In
the bulldozer example, a request may be an angle, a feedback may be the angle
remaining to be moved, and the result is a success or fail boolean with the
end angle. In the navigation example, a request may be a position, a feedback
may be the time its been navigating for and the distance to the goal, and the
result a boolean for success.


Clear


Please check the following design considerations how this feature could be
added into Nav2 stack.
Since, not all Costmap2D are working with ` nav2_msgs/msg/Costmap.msg ` , but
also with ` nav_msgs/msg/OccupancyGrid.msg ` as well (e.g. [ Speed Limiting
Filter
](https://navigation.ros.org/tutorials/docs/navigation2_with_speed_filter.html)
), we need to support adding vector objects to both Costmap2D and
OccupancyGrid maps.
Having the node, able to working with OccupancyGrids, it is worth to enhance
its influence for all occupancy grid maps, rather that on costmaps and filter
masks only. However, the update rate from local or global costmap node makes
this idea to be almost meaningless.
Thus, it was considered to make a separate VectorObject server, able to work
with Costmap2D layers, Costmap Filters, maps published by Map Server, SLAM,
and many other scenarios, which seems to be more universal. VectorObjects
Layer (or Virtual Obstacle Layer) in Costmap2D to be a wrapper accessing
VectorObject server by using service calls API. This also is having the
potential to be expanded to the Semantic Map server (the has been discussed
many times) some day in the future.


For the API:


* Board an elevator


Costmap layers can be created to detect and track obstacles in the scene for
collision avoidance using camera or depth sensors. Additionally, layers can be
created to algorithmically change the underlying costmap based on some rule or
heuristic. Finally, they may be used to buffer live data into the 2D or 3D
world for binary obstacle marking.


##  Question Tools


**[ SteveMacenski ](/SteveMacenski) ** commented  Feb 2, 2023  •


[ Navigation 2 ![Logo](../_static/nav2_logo.png) ](../index.html)


> Moving forward, we need to have separate input topic, each one per each type
> of shape


Each topic will have ` uuid ` per each shape. If ` uuid ` will be the same, VO
will update the shape. If ` uuid ` will be new, or empty, VO will create a new
shape with data obtained from the corresponding message.


No milestone


edited


For the behavior server, each of the behaviors also contains their own name,
however, each plugin will also expose its own special action server. This is
done because of the wide variety of behavior actions that may be created
cannot have a single simple interface to share. The behavior server also
contains a costmap subscriber to the local costmap, receiving real-time
updates from the controller server, to compute its tasks. We do this to avoid
having multiple instances of the local costmap which are computationally
expensive to duplicate.


add a comment


Contributor


Sorry, something went wrong.


##  Stats


[
![@AlexeyMerzlyakov](https://avatars.githubusercontent.com/u/60094858?s=80&u=bb82ce480f0854e3758a8c4f07129af932258cb1&v=4)
](/AlexeyMerzlyakov)


Author


  has_updated_data_ = false;
}


    * [ Learning Pathways  ](https://resources.github.com/learn/pathways/)
    * [ White papers, Ebooks, Webinars  ](https://resources.github.com/)
    * [ Customer Stories ](/customer-stories)
    * [ Partners  ](https://partner.github.com/)


Copy link


Development


Let me know 😃

---

👍  1  tonynajjar reacted with thumbs up emoji


Member


Additional navigation options


* [ mobile_base ](/questions/scope:all/sort:activity-desc/tags:mobile_base/page:1/)


[ Sign in ](/login?return_to=https%3A%2F%2Fgithub.com%2Fros-
planning%2Fnavigation2%2Fissues%2F3613)


Open


/**
  * @brief Callback executed when a parameter change is detected
  * @param event ParameterEvent message
  */
rcl_interfaces::msg::SetParametersResult
StaticLayer::dynamicParametersCallback(
  std::vector<rclcpp::Parameter> parameters)
{
  std::lock_guard<Costmap2D::mutex_t> guard(*getMutex());
  rcl_interfaces::msg::SetParametersResult result;


> It would likely be stored either way (e.g. in the costmap)


[ ![@jplapp](https://avatars.githubusercontent.com/u/17068999?s=80&v=4)
](/jplapp)


    [velocity_smoother-10] 	velocity_smoother lifecycle node launched.
    [velocity_smoother-10] 	Waiting on external lifecycle transitions to activate
    [velocity_smoother-10] 	See https://design.ros2.org/articles/node_lifecycle.html for more information.
    [waypoint_follower-9] 	waypoint_follower lifecycle node launched.
    [waypoint_follower-9] 	Waiting on external lifecycle transitions to activate
    [waypoint_follower-9] 	See https://design.ros2.org/articles/node_lifecycle.html for more information.
    [waypoint_follower-9] [INFO] [1686316127.594350634] [waypoint_follower]: Creating
    [map_server-1] [DEBUG] [map_io]: Read map /home/bot/Downloads/map/maphallway.pgm: 1207 X 591 map @ 0.05 m/cell
    [lifecycle_manager-3] [INFO] [1686316127.736224766] [lifecycle_manager_localization]: Configuring amcl
    [amcl-2] [INFO] [1686316127.736426398] [amcl]: Configuring
    [amcl-2] [INFO] [1686316127.736512589] [amcl]: initTransforms
    [amcl-2] [INFO] [1686316127.742318473] [amcl]: initPubSub
    [amcl-2] [INFO] [1686316127.745220944] [amcl]: Subscribed to map topic.
    [lifecycle_manager-11] [INFO] [1686316127.748951426] [lifecycle_manager_navigation]: Starting managed nodes bringup...
    [lifecycle_manager-11] [INFO] [1686316127.748996262] [lifecycle_manager_navigation]: Configuring controller_server
    [controller_server-4] [INFO] [1686316127.749286577] [controller_server]: Configuring controller interface
    [controller_server-4] [INFO] [1686316127.749446126] [controller_server]: getting goal checker plugins..
    [controller_server-4] [INFO] [1686316127.749537857] [controller_server]: Controller frequency set to 20.0000Hz
    [controller_server-4] [INFO] [1686316127.749573210] [local_costmap.local_costmap]: Configuring
    [lifecycle_manager-3] [INFO] [1686316127.751077021] [lifecycle_manager_localization]: Activating map_server
    [map_server-1] [INFO] [1686316127.751814379] [map_server]: Activating
    [controller_server-4] [INFO] [1686316127.752903107] [local_costmap.local_costmap]: Using plugin "voxel_layer"
    [map_server-1] [INFO] [1686316127.752980188] [map_server]: Creating bond (map_server) to lifecycle manager.
    [amcl-2] [INFO] [1686316127.754325510] [amcl]: Received a 1207 X 591 map @ 0.050 m/pix
    [controller_server-4] [INFO] [1686316127.764088913] [local_costmap.local_costmap]: Subscribed to Topics: scan
    [controller_server-4] [INFO] [1686316127.777136775] [local_costmap.local_costmap]: Initialized plugin "voxel_layer"
    [controller_server-4] [INFO] [1686316127.777701325] [local_costmap.local_costmap]: Using plugin "inflation_layer"
    [controller_server-4] [INFO] [1686316127.782536788] [local_costmap.local_costmap]: Initialized plugin "inflation_layer"
    [controller_server-4] [INFO] [1686316127.783602477] [local_costmap.local_costmap]: Using costmap filter "keepout_filter"
    [controller_server-4] [INFO] [1686316127.791502001] [local_costmap.local_costmap]: Initialized costmap filter "keepout_filter"
    [controller_server-4] [INFO] [1686316127.806541093] [controller_server]: Created progress_checker : progress_checker of type nav2_controller::SimpleProgressChecker
    [controller_server-4] [INFO] [1686316127.809036232] [controller_server]: Created goal checker : general_goal_checker of type nav2_controller::SimpleGoalChecker
    [controller_server-4] [INFO] [1686316127.811173290] [controller_server]: Controller Server has general_goal_checker  goal checkers available.
    [controller_server-4] [INFO] [1686316127.814787576] [controller_server]: Created controller : FollowPath of type dwb_core::DWBLocalPlanner
    [controller_server-4] [INFO] [1686316127.818525260] [controller_server]: Setting transform_tolerance to 0.200000
    [controller_server-4] [INFO] [1686316127.838180590] [controller_server]: Using critic "RotateToGoal" (dwb_critics::RotateToGoalCritic)
    [controller_server-4] [INFO] [1686316127.839187231] [controller_server]: Critic plugin initialized
    [controller_server-4] [INFO] [1686316127.839466594] [controller_server]: Using critic "Oscillation" (dwb_critics::OscillationCritic)
    [controller_server-4] [INFO] [1686316127.840495697] [controller_server]: Critic plugin initialized
    [controller_server-4] [INFO] [1686316127.840744360] [controller_server]: Using critic "BaseObstacle" (dwb_critics::BaseObstacleCritic)


Already on GitHub? [ Sign in ](/login?return_to=%2Fros-
planning%2Fnavigation2%2Fissues%2Fnew%2Fchoose) to your account


If you put bad information in the costmap, nothing else can be aware that that
information is bad to question it for planning and control. That's a pretty
low level thing to mess with and the expectation is that you're learning what
to do properly or writing unit and integration tests to verify that it works
as expected.

---

👍  1  dharanish-nh reacted with thumbs up emoji


  unsigned int size_x = new_map.info.width;
  unsigned int size_y = new_map.info.height;


[
![@SteveMacenski](https://avatars.githubusercontent.com/u/14944147?s=80&u=0925d37e9d3569c71d930114b66e6394c2efb3c6&v=4)
](/SteveMacenski)


No branches or pull requests


A very common workflow when deploying robots is to map the space and then have
a facility manager (or someone) sit with an ipad and just drag boxes onto the
map to mark docks, safety zones, aisles, etc for semantic information to use
in navigation later. In fact, I'd really like as part of this after we get
done with the MVP of the server is to develop the tools in rviz to essentially
allow for that workflow and save to a file for use.


###  Costmaps and Layers  ¶


    * [ Actions  Automate any workflow  ](/features/actions)
    * [ Packages  Host and manage packages  ](/features/packages)
    * [ Security  Find and fix vulnerabilities  ](/features/security)
    * [ Codespaces  Instant dev environments  ](/features/codespaces)
    * [ Copilot  Write better code with AI  ](/features/copilot)
    * [ Code review  Manage code changes  ](/features/code-review)
    * [ Issues  Plan and track work  ](/features/issues)
    * [ Discussions  Collaborate outside of code  ](/features/discussions)


The client knows it failed to send it, so it can (1) retry so that you make
genuine attempts to get the message over (2) log warnings to debug later
problems in the fleet. There are many things that knowing that Robot A failed
to send the message enables for reliable systems. Its not about what the other
robot's server is doing with that information (because it didn't get the
request, so it knows nothing) its about what the client can do to improve the
chances of it working or introspecting the results. And with a service, you
can know which IDs were successfully added so you can remove them later and
not waste networking resources on trying to ` delete ` some polygon from a
costmap layer that was never ` add ` ed in the first place due to previous
networking problems.


  * Priority: I think a unit8 would be fine, 32 bits seems excessive. Though, I'm trying to think logically about when this wouldn't always be a "use highest" or "use lowest". If this is a keepout layer, then we always want to use the highest value of a region. If its a speed zone, we'd always want to use the lowest value. But either way, that's actually more up the use of the values within the layer. I think ` priority ` could be removed with a bool for ` use_max ` or similar to indicate if we should use the maximum or minimum value for adding the shape to the map.
  * Transparency: How would this enact transparency? How would the vector server know how to interpret the values for the application to know what value means "do nothing" if we have the base+multiplier going on in the costmap filter layer? I don't think this is something of practical need and could probably be removed. If transparency (e.g. invert behavior) is necessary, they could just add a shape with ` value ` that corresponds to that?
  * Fill: I think needs to be in circle and polygon to indicate if we want to fill the shape, or just outline the shape. Closed is whether to connect the start/end points in the polygon, but doesn't say if we want to fill the interior or not.


All reactions


Copy link


Everything in Nav2 is an Occupancy Grid, a costmap is an occupancy grid.
There's not difference. The costmap message should be deleted and shouldn't be
considered here in any differing nature.

---

All reactions


At the end of the day, services are just a paired request and response, over
the same network interfaces and can be run with QoS settings like topics. I
don't think that would be problematic at all and I think it is entirely
necessary so you can (1) verify that an obstacle was successfully added to the
scene and (2) you can verify deletion or moving of obstacles in the scene.


1- When do you expect to have the ROS2 port ready?
2- Are you planning on making a PR to Nav2 yourself?

---

All reactions


You signed in with another tab or window. [ Reload ]() to refresh your
session.  You signed out in another tab or window. [ Reload ]() to refresh
your session.  You switched accounts on another tab or window. [ Reload ]() to
refresh your session.  Dismiss alert


Clear


    * Proc: Straightforward design and maximum re-usage of what have done
    * Cons: Boilerplate works and a bunch of services after many types of objects to be added
  * O2. Try to add some universal object, that could absorb any of possible in foreseen future vector objects, like I've proposed in ` Shape.msg ` in previous comment.
    * Proc: One service calls, one topic, one objects per each Vector Object: ` AddShape.srv ` / ` RemoveShape.srv `
    * Cons: A bit confusing design of ` data ` and ` points ` , or what we go in to be there; and therefore might be non-obvious to the end user.


Going a little further, I might suggest that ` OccupancyGrid ` -s
"vectorizing" might be useful in other areas, like intercepting maps going
form Map Server and dynamically adding static of moving objects on it, e.g.
for testing purposes. For this, having all the logic running on costmap layers
won't look right: costmap layers are working with some restricted update-rate,
which might be a design pitfall in the case. Therefore I thought to have a
separate vector server that will do:


You mean the costmap filters (keepout + speed), right? To be able to do other
non-just-cost tasks with the polygon's values


Query


Milestone


---

All reactions


  * [ Notifications ](/login?return_to=%2Fros-planning%2Fnavigation2)
  * [ Fork  1.1k  ](/login?return_to=%2Fros-planning%2Fnavigation2)
  * [ Star  2.1k  ](/login?return_to=%2Fros-planning%2Fnavigation2)


* [ Pricing ](/pricing)


Feedback and results can be gathered synchronously by registering callbacks
with the action client. They may also be gathered by asychronously requesting
information from the shared future objects. Both require spinning the client
node to process callback groups.


        * [ 2- Run Dynamic Object Following in Nav2 Simulation ](../tutorials/docs/navigation2_dynamic_point_following.html#run-dynamic-object-following-in-nav2-simulation)
    * [ Navigating with Keepout Zones ](../tutorials/docs/navigation2_with_keepout_filter.html)
      * [ Overview ](../tutorials/docs/navigation2_with_keepout_filter.html#overview)
      * [ Requirements ](../tutorials/docs/navigation2_with_keepout_filter.html#requirements)
      * [ Tutorial Steps ](../tutorials/docs/navigation2_with_keepout_filter.html#tutorial-steps)
        * [ 1\. Prepare filter mask ](../tutorials/docs/navigation2_with_keepout_filter.html#prepare-filter-mask)
        * [ 2\. Configure Costmap Filter Info Publisher Server ](../tutorials/docs/navigation2_with_keepout_filter.html#configure-costmap-filter-info-publisher-server)
        * [ 3\. Enable Keepout Filter ](../tutorials/docs/navigation2_with_keepout_filter.html#enable-keepout-filter)
        * [ 4\. Run Nav2 stack ](../tutorials/docs/navigation2_with_keepout_filter.html#run-nav2-stack)
    * [ Navigating with Speed Limits ](../tutorials/docs/navigation2_with_speed_filter.html)
      * [ Overview ](../tutorials/docs/navigation2_with_speed_filter.html#overview)
      * [ Requirements ](../tutorials/docs/navigation2_with_speed_filter.html#requirements)
      * [ Tutorial Steps ](../tutorials/docs/navigation2_with_speed_filter.html#tutorial-steps)
        * [ 1\. Prepare filter mask ](../tutorials/docs/navigation2_with_speed_filter.html#prepare-filter-mask)
        * [ 2\. Configure Costmap Filter Info Publisher Server ](../tutorials/docs/navigation2_with_speed_filter.html#configure-costmap-filter-info-publisher-server)
        * [ 3\. Enable Speed Filter ](../tutorials/docs/navigation2_with_speed_filter.html#enable-speed-filter)
        * [ 4\. Run Nav2 stack ](../tutorials/docs/navigation2_with_speed_filter.html#run-nav2-stack)
    * [ Using Rotation Shim Controller ](../tutorials/docs/using_shim_controller.html)
      * [ Overview ](../tutorials/docs/using_shim_controller.html#overview)
      * [ What is the Rotation Shim Controller? ](../tutorials/docs/using_shim_controller.html#what-is-the-rotation-shim-controller)
      * [ Configuring Rotation Shim Controller ](../tutorials/docs/using_shim_controller.html#configuring-rotation-shim-controller)
      * [ Configuring Primary Controller ](../tutorials/docs/using_shim_controller.html#configuring-primary-controller)
      * [ Demo Execution ](../tutorials/docs/using_shim_controller.html#demo-execution)
    * [ Adding a Smoother to a BT ](../tutorials/docs/adding_smoother.html)
      * [ Overview ](../tutorials/docs/adding_smoother.html#overview)
      * [ Requirements ](../tutorials/docs/adding_smoother.html#requirements)
      * [ Tutorial Steps ](../tutorials/docs/adding_smoother.html#tutorial-steps)
        * [ 0- Familiarization with the Smoother BT Node ](../tutorials/docs/adding_smoother.html#familiarization-with-the-smoother-bt-node)
        * [ 1- Specifying a Smoother Plugin ](../tutorials/docs/adding_smoother.html#specifying-a-smoother-plugin)
        * [ 2- Modifying your BT XML ](../tutorials/docs/adding_smoother.html#modifying-your-bt-xml)
    * [ Using Collision Monitor ](../tutorials/docs/using_collision_monitor.html)
      * [ Overview ](../tutorials/docs/using_collision_monitor.html#overview)
      * [ Requirements ](../tutorials/docs/using_collision_monitor.html#requirements)
      * [ Configuring Collision Monitor ](../tutorials/docs/using_collision_monitor.html#configuring-collision-monitor)
      * [ Preparing Nav2 stack ](../tutorials/docs/using_collision_monitor.html#preparing-nav2-stack)
      * [ Demo Execution ](../tutorials/docs/using_collision_monitor.html#demo-execution)
    * [ Adding a New Nav2 Task Server ](../tutorials/docs/adding_a_nav2_task_server.html)
      * [ Lifecycle Nodes ](../tutorials/docs/adding_a_nav2_task_server.html#lifecycle-nodes)
      * [ Composition ](../tutorials/docs/adding_a_nav2_task_server.html#composition)
      * [ Error codes ](../tutorials/docs/adding_a_nav2_task_server.html#error-codes)


  // If there is a new available map, load it.
  if (map_buffer_) {
    processMap(*map_buffer_);
    map_buffer_ = nullptr;
  }


Copy link


###  Smoothers  ¶


[
![@tonynajjar](https://avatars.githubusercontent.com/u/14879660?s=80&u=e29d50db1bac036eae32b30fec612615ccd3791a&v=4)
](/tonynajjar)


**[ tonynajjar ](/tonynajjar) ** commented  Feb 3, 2023


unsigned char
StaticLayer::interpretValue(unsigned char value)
{
  // check if the static value is above the unknown or lethal thresholds
  if (track_unknown_space_ && value == unknown_cost_value_) {
    return NO_INFORMATION;
  } else if (!track_unknown_space_ && value == unknown_cost_value_) {
    return FREE_SPACE;
  } else if (value >= lethal_threshold_) {
    return LETHAL_OBSTACLE;
  } else if (trinary_costmap_) {
    return FREE_SPACE;
  }


> I have developed also some navigation plugins (global and local planning)
> that I want to make them compatible with ROS2 and Nav2 robot rocket. I will
> let you know in slack or in another Github issue/thread about this work.


I will start doing some update this weekend.
For ROS2 migration, I can do something for mid August if it's good for you.
At first, I will do the migration in my repo and then we can discuss about
creating the Nav2 PR.


Name


* [ nav2 ](/questions/scope:all/sort:activity-desc/tags:nav2/page:1/)


[ @jplapp ](https://github.com/jplapp) I will make sure that there is no
incompatibility with current version when integrating new updates to the demo
package. 😀

---

All reactions


Sorry, something went wrong.


> Cons2. Concept issue


* [ 2DCostmap ](/questions/scope:all/sort:activity-desc/tags:2DCostmap/page:1/)


        * [ 3- Working with SLAM ](../tutorials/docs/navigation2_with_slam.html#working-with-slam)
        * [ 4- Getting Started Simplification ](../tutorials/docs/navigation2_with_slam.html#getting-started-simplification)
    * [ (STVL) Using an External Costmap Plugin ](../tutorials/docs/navigation2_with_stvl.html)
      * [ Overview ](../tutorials/docs/navigation2_with_stvl.html#overview)
      * [ Costmap2D and STVL ](../tutorials/docs/navigation2_with_stvl.html#costmap2d-and-stvl)
      * [ Tutorial Steps ](../tutorials/docs/navigation2_with_stvl.html#tutorial-steps)
        * [ 0- Setup ](../tutorials/docs/navigation2_with_stvl.html#setup)
        * [ 1- Install STVL ](../tutorials/docs/navigation2_with_stvl.html#install-stvl)
        * [ 1- Modify Navigation2 Parameter ](../tutorials/docs/navigation2_with_stvl.html#modify-navigation2-parameter)
        * [ 2- Launch Navigation2 ](../tutorials/docs/navigation2_with_stvl.html#launch-navigation2)
        * [ 3- RVIZ ](../tutorials/docs/navigation2_with_stvl.html#rviz)
    * [ Groot - Interacting with Behavior Trees ](../tutorials/docs/using_groot.html)
      * [ Overview ](../tutorials/docs/using_groot.html#overview)
      * [ Visualize Behavior Trees ](../tutorials/docs/using_groot.html#visualize-behavior-trees)
      * [ Edit Behavior Trees ](../tutorials/docs/using_groot.html#edit-behavior-trees)
      * [ Adding A Custom Node ](../tutorials/docs/using_groot.html#adding-a-custom-node)
    * [ Camera Calibration ](../tutorials/docs/camera_calibration.html)
      * [ Overview ](../tutorials/docs/camera_calibration.html#overview)
      * [ Requirements ](../tutorials/docs/camera_calibration.html#requirements)
      * [ Tutorial Steps ](../tutorials/docs/camera_calibration.html#tutorial-steps)
    * [ Get Backtrace in ROS 2 / Nav2 ](../tutorials/docs/get_backtrace.html)
      * [ Overview ](../tutorials/docs/get_backtrace.html#overview)
      * [ Preliminaries ](../tutorials/docs/get_backtrace.html#preliminaries)
      * [ From a Node ](../tutorials/docs/get_backtrace.html#from-a-node)
      * [ From a Launch File ](../tutorials/docs/get_backtrace.html#from-a-launch-file)
      * [ From Large Project ](../tutorials/docs/get_backtrace.html#from-large-project)
      * [ From Nav2 Bringup ](../tutorials/docs/get_backtrace.html#from-nav2-bringup)
      * [ Automatic backtrace on crash ](../tutorials/docs/get_backtrace.html#automatic-backtrace-on-crash)
    * [ Profiling in ROS 2 / Nav2 ](../tutorials/docs/get_profile.html)
      * [ Overview ](../tutorials/docs/get_profile.html#overview)
      * [ Preliminaries ](../tutorials/docs/get_profile.html#preliminaries)
      * [ Profile from a Node ](../tutorials/docs/get_profile.html#profile-from-a-node)
      * [ Profile from a Launch File ](../tutorials/docs/get_profile.html#profile-from-a-launch-file)
      * [ From Nav2 Bringup ](../tutorials/docs/get_profile.html#from-nav2-bringup)
      * [ Interpreting Results ](../tutorials/docs/get_profile.html#interpreting-results)
    * [ Dynamic Object Following ](../tutorials/docs/navigation2_dynamic_point_following.html)
      * [ Overview ](../tutorials/docs/navigation2_dynamic_point_following.html#overview)
      * [ Tutorial Steps ](../tutorials/docs/navigation2_dynamic_point_following.html#tutorial-steps)
        * [ 0- Create the Behavior Tree ](../tutorials/docs/navigation2_dynamic_point_following.html#create-the-behavior-tree)
        * [ 1- Setup Rviz clicked point ](../tutorials/docs/navigation2_dynamic_point_following.html#setup-rviz-clicked-point)