Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added transient local subscription qos profile parameter to map saver #1871

Merged

Conversation

Michael-Equi
Copy link
Contributor

Basic Info

Info Please fill out this column
Ticket(s) this addresses #1864
Primary OS tested on Ubuntu
Robotic platform tested on TB3 simulation

Description of contribution in a few bullet points

Added parameter to map saver that configures it to subscribe to the /map topic as transient local.

@@ -50,6 +50,8 @@ MapSaver::MapSaver()

free_thresh_default_ = declare_parameter("free_thresh_default", 0.25),
occupied_thresh_default_ = declare_parameter("occupied_thresh_default", 0.65);
map_subscribe_transient_local_ = declare_parameter("map_subscribe_transient_local", false);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't the default be 'true'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Old behavior was false as it just used system default QoS, but if you think we should make this is the default I support that.

Copy link
Member

Choose a reason for hiding this comment

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

I could go either way on it, but I'd lean towards True as well

Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

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

@mkhansenbot seems like you're interested, what's your review?

Copy link
Collaborator

@mkhansenbot mkhansenbot left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for changing the default to true, I think that's the correct behavior

@SteveMacenski
Copy link
Member

@Michael-Equi please fix the linter errors

- nav2_map_server.cpplint whitespace/blank_line [3] (/opt/overlay_ws/src/navigation2/nav2_map_server/src/map_saver/map_saver.cpp:54)

  <<< failure message

    Redundant blank line at the end of a code block should be deleted.

  >>>



# 'worlds/turtlebot3_worlds/waffle.model'),
default_value=os.path.join(bringup_dir, 'worlds', 'waffle.model'),
# 'worlds/turtlebot3_worlds/house.world'),
default_value=os.path.join(bringup_dir, 'worlds', 'house.world'),
Copy link
Member

Choose a reason for hiding this comment

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

We don't have a house.world file in our package for that to be a valid default. If you'd like to propose adding one, we can talk about that for sure, but in another ticket / PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like my IDE did some automatic refactor with cached information about a house world I worked on for a bit. My bad for not checking.

@codecov
Copy link

codecov bot commented Jul 16, 2020

Codecov Report

Merging #1871 into master will decrease coverage by 0.80%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1871      +/-   ##
==========================================
- Coverage   70.14%   69.34%   -0.81%     
==========================================
  Files         218      218              
  Lines       10586    10592       +6     
==========================================
- Hits         7426     7345      -81     
- Misses       3160     3247      +87     
Impacted Files Coverage Δ
nav2_map_server/src/map_saver/map_saver.cpp 87.05% <100.00%> (+0.98%) ⬆️
...re/include/dwb_core/illegal_trajectory_tracker.hpp 40.00% <0.00%> (-60.00%) ⬇️
...roller/dwb_core/src/illegal_trajectory_tracker.cpp 25.00% <0.00%> (-55.00%) ⬇️
nav2_map_server/src/map_server/main.cpp 63.63% <0.00%> (-36.37%) ⬇️
...map_2d/include/nav2_costmap_2d/inflation_layer.hpp 91.66% <0.00%> (-8.34%) ⬇️
nav2_navfn_planner/src/navfn_planner.cpp 82.09% <0.00%> (-6.80%) ⬇️
nav2_costmap_2d/src/clear_costmap_service.cpp 17.89% <0.00%> (-6.32%) ⬇️
..._dwb_controller/dwb_core/src/dwb_local_planner.cpp 77.32% <0.00%> (-4.97%) ⬇️
...tree/include/nav2_behavior_tree/bt_action_node.hpp 79.26% <0.00%> (-4.88%) ⬇️
nav2_controller/src/nav2_controller.cpp 79.38% <0.00%> (-3.10%) ⬇️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 69977cd...f2a8165. Read the comment docs.

@SteveMacenski SteveMacenski merged commit 9f1d8a1 into ros-navigation:master Jul 16, 2020
@Michael-Equi Michael-Equi deleted the mapsaver-transient-local branch July 25, 2020 21:21
SteveMacenski pushed a commit that referenced this pull request Aug 11, 2020
…#1871)

* Added transient local subscription qos profile parameter to map saver

* Made transient local default true

* Fixed linter problem

* switched back house world to waffle model
@QQting
Copy link
Contributor

QQting commented Dec 8, 2020

Could we also apply the transient_local QoS to the map saver in foxy-devel?

@SteveMacenski
Copy link
Member

I believe that is already the case, but if it does not, we cannot change it. That is API breaking

@v-lopez
Copy link
Contributor

v-lopez commented Feb 19, 2021

This is not applied on foxy and we're forced to use a reimplement it to save maps.

Could you check this again? I believe it is not API breaking, at most ABI breaking due to declaring a new member variable. And on a header probably unused outside of this node.

Is it because of the QoS profile? What If I reworked it for foxy so by default it has the old behavior, and only if you set the param explicitely it has the new behavior?

For other people who come here, map can be saved by calling directly the service:
ros2 service call /map_saver/save_map nav2_msgs/srv/SaveMap "{map_topic: 'map', map_url: '/tmp/mymap', free_thresh: 0.25, occupied_thresh: 0.65}"

@SteveMacenski
Copy link
Member

SteveMacenski commented Feb 19, 2021

@v-lopez The main differences are the QoS settings now being used before and after the changes

The new one changes depending on RMW vendor and potentially even platform its being run on what the default settings are for that DDS vendor. I believe this counts as an ABI breaking change, correct me if I'm wrong.

Is it because of the QoS profile? What If I reworked it for foxy so by default it has the old behavior, and only if you set the param explicitely it has the new behavior?

Yes, I'd be OK considering a PR directly onto Foxy that maintains rclcpp::SystemDefaultsQoS() when map_subscribe_transient_local_ is not set - that should be easy to implement and solve the basic concern I have.

I understand its annoying, but one of the big points of ROS2 is maturity of software support and we cannot break ABI after release in a given distribution. It could have real ramifications of current users expecting certain behaviors. If you want the latest and greatest, main has all of this (and more) available! Nav2 is moving considerably faster than Navigation in ROS1 did for the better part of a decade, so part of that is that every new shiny feature isn't going to be in every distribution as we 'move fast and break things [ABI]' 😄. I'm always happy to field work-around PRs to maintain ABI for certain features in certain released distributions, but I myself will probably not spend my resources on it (e.g. would you rather me work on new-shiny-features or try to guess what people will find useful in legacy distros to individually backport them all 😆 ).

@v-lopez
Copy link
Contributor

v-lopez commented Feb 19, 2021

Alright I'll see if I can prepare a PR for foxy next week with this.

I understand the need for stability and for closing a version and focusing developments on a new one. But I also believe in putting the effort on these ABI compatible changes for at least the LTS versions.
As a company we're not going to ship robots with rolling or galactic, so our next viable LTS distribution is scheduled for May 2022.

As I am getting familiar with ROS2, I'm finding often small details like these, that are in no way game breakers, but if left unfixed worsen the experience of our users.

Thanks a lot for the lengthy explanation and for the work you're putting into this. It looks great.

@SteveMacenski
Copy link
Member

SteveMacenski commented Feb 19, 2021

Totally understand that, and happy to have industry people looking at this work to backport necessary things. But I think we'd both agree we'd rather have an awesome navigation system moving forward with a ba-jillion features than me and my team bogged down in backporting patches to every distribution when there's a question about ABI. For every 1 that someone brings up as a problem, there's 5 that no one really cares about. Picking which ones to spend time on and which not to is difficult (e.g. would you rather have new features requiring backport, or much fewer features at all to even backport).

Many companies are actually using our main branch on their robots - though I understand why someone the size of Pal might not want to do that.

@v-lopez
Copy link
Contributor

v-lopez commented Feb 19, 2021

100% agree with you.

I think you and your team should not spend time developing many backports, being open to backwards compatible contributions and leaving the work to whoever needs the backport is very reasonable.

We'll consider using main on our robots, but one of our targets is that anyone can "apt install" our robot public simulation and start using it.
In ROS1 they have to prepare huge workspaces and we'd like to steer away from that. But that "apt install" could be on rolling too, I had not considered it.

@SteveMacenski
Copy link
Member

SteveMacenski commented Feb 19, 2021

We also have docker containers available!

Definitely understand on apt-install.

v-lopez pushed a commit to pal-robotics-forks/navigation2 that referenced this pull request Mar 3, 2021
…ros-navigation#1871)

* Added transient local subscription qos profile parameter to map saver

* Made transient local default true

* Fixed linter problem

* switched back house world to waffle model
SteveMacenski pushed a commit that referenced this pull request Mar 3, 2021
* Added transient local subscription qos profile parameter to map saver (#1871)

* Added transient local subscription qos profile parameter to map saver

* Made transient local default true

* Fixed linter problem

* switched back house world to waffle model

* Make transient map subscribe backwards compatible for foxy

Co-authored-by: Michael Equi <[email protected]>
ruffsl pushed a commit to ruffsl/navigation2 that referenced this pull request Jul 2, 2021
…ros-navigation#1871)

* Added transient local subscription qos profile parameter to map saver

* Made transient local default true

* Fixed linter problem

* switched back house world to waffle model
ghost pushed a commit to logivations/navigation2 that referenced this pull request Mar 7, 2022
* Fix deprecated usage of FutureReturnCode::SUCCESS (ros-navigation#2140)

Use rclcpp::FutureReturnCode::SUCCESS replace rclcpp::executor::FutureReturnCode::SUCCESS

* backporting to foxy checking goal index on backchecks (ros-navigation#2202)

* Fix recovery action collision check. (ros-navigation#2193)

* Fix recovery action collision check.

* Fix linting issue.

* Fix back up action behavior tree node name issue (ros-navigation#2206)

* Export nav2_bt_navigator library and dependencies (ros-navigation#2212)

Signed-off-by: Marco Lampacrescia <[email protected]>

* Optional transient map saver (ros-navigation#2215)

* Added transient local subscription qos profile parameter to map saver (ros-navigation#1871)

* Added transient local subscription qos profile parameter to map saver

* Made transient local default true

* Fixed linter problem

* switched back house world to waffle model

* Make transient map subscribe backwards compatible for foxy

Co-authored-by: Michael Equi <[email protected]>

* Add has_node_params launch utility (ros-navigation#2257)

* corrected backup plugin name for multirobot params (ros-navigation#2288)

Co-authored-by: Simon Honigmann <[email protected]>

* foxy Sync 5.1 (ros-navigation#2291)

* merge conflict

* Add groot monitoring behavior tree visualization (ros-navigation#1958)

* include ZMQ publisher for Groot

very plain integration, should be made optionally through a launch parameter

* fix Groot crashing finding custom nodes in monitor mode

straight forward working fix. The manifest was missing, so Groot searched custom node IDs that it did not have. This is implemented correctly directly in BT.CPP V3 and should be used instead of an implementation in nav2_bt_engine

* refactor buildTreeFromText to createTreeFromText as in BT.CPP v3

* forward XML to createTreeFromText from BT.CPP v3 factory function

* Add createTreeFromFile forware to BT-factory function

* fix createTreeFromFile args..

* add personal copyright

I think this is okay for finding a nasty bug.. :)

* move creating ZMQ Publisher from run to dedicated function

this way the ZMQ Publisher ca be added to individual trees within the same factory. Should be important for switching trees (XML files)

* Add parameter for Groot Monitoring - default true. Also cleanup ZMQ

* Move haltAllActions() Implementation from .hpp to .cpp

* update Copyright in hpp of BT-engine

* make linters happy.. :)

* Update Groot parameter naming and chg default=0

* rename resetZMQGrootMonitor -> resetGrootMonitor

* add parameter to nav2_params.yaml - default = false

* add ZMQ params and logic for server/pub ports

* Fix RewrittenYaml ignoring Integers

Integers where converted as floats before which crashes get_parameter.. fun thing....

* add launch based tests for params and ZMQ

* Activate Dijkstra and A* switching tests, thanks to RewrittenYaml

* add pyzmq==19.0.2 via pip3 to CI test_workspace

* make flake8 linter happy

* make cpp linters happy

* add personal copyright

* add GoalUpdated BT node description in order to view the full default BT

only affects editor mode of Groot and not live monitoring

* make linter happy (unused import)

* remove unused groot-port replacement functions in test_system_launch.py

* add groot parameters to params.md

* get reloading BTs to work nicely with Groot

* pretty space for smac :)

* switch from unsinged to uint16_t

* fix converting string into float or int

* Revert "add pyzmq==19.0.2 via pip3 to CI test_workspace"

This reverts commit 7bca081.

* Switch to 4 spaces indent and other linter stuff for RewrittenYaml

* removed prints in test_system_launch.py

* linter stuff

* add python-zmq as test_depend in package.xml (instead of .CI_conf)

* enable groot monitoring by default

* remove ZMQ from naming (function / variable)

* remove variable zmq ports from testing scripts

* remove default ports in BT_engine, as they are set through (def-)params

* Remove complete test for "dynamic" ZMQ ports testing

* fix python-zmq depend location

* fix style

* swap missing Groot to default True

* fix rosdep zmq + flake8 fixes in system_tests

* remove debug logs + c_str()

* remove final debug_log

* return failure on plugin failure (ros-navigation#2119)

* Move voxel publisher activation into conditional that its on

* fix boundary point exclusion in convexFillCells (ros-navigation#2161)

* Regulated pure pursuit controller (ros-navigation#2152)

* regulated pure pursuit migration commit

* adding speed limit API

* adding review comments + adding rotate to goal heading

* adding test dir

* add some initial tests

* more tests

* remove old comment

* improve readme

* fix CI

* first attempt at changing algos in tests

* allowing full path parameter substitutions

* adding integration tests

* enable SMAC testing too with new changes

* swap algos

* revert

* Update angular velocity after constraining linear velocity (ros-navigation#2165)

This ensures the robot moves towards the lookahead point more closely.
If the angular velocity is not updated, then the robot tries to take cuts while turning,
which could lead to collisions when near obstacles

Signed-off-by: Shrijit Singh <[email protected]>

* Update cost scaling heuristic to vary speed linearly with distance (ros-navigation#2164)

* Update cost scaling to vary linearly with distance instead of relying on costmap cost

Signed-off-by: Shrijit Singh <[email protected]>

* Resolve suggested changes

Signed-off-by: Shrijit Singh <[email protected]>

* Add documentation for cost scaling parameters

Signed-off-by: Shrijit Singh <[email protected]>

* Improve parameter descriptions

Signed-off-by: Shrijit Singh <[email protected]>

* Comment cost scaling tests since layered costmap is not initialized

A valid layered costmap reference is needed to get the inscribed radius

Signed-off-by: Shrijit Singh <[email protected]>

Co-authored-by: Shrijit Singh <[email protected]>

* Updating example yaml to include extra params (ros-navigation#2183)

* Fixing control_frequency to controller_frequency typo (ros-navigation#2182)

* Write doxygen for navfn (ros-navigation#2184)

* Write doxygen for navfn

* Remove forward slashes

* expose dwb's shorten_transformed_plan param

* Adding RPP to metapackage.xml

* [NavFn] Make the 3 parameters changeable at runtime (ros-navigation#2181)

* make the 3 params changeable at runtime

* use parameter events callbacks

* doxygen

* lint

* Install test_updown to lib/ (ros-navigation#2208)

* Remove optimization check on carrot, incorrect optimization (ros-navigation#2209)

* [RPP] Remove dependency on collision checking to carrot location (ros-navigation#2211)

* Remove dependency on collision checking to carrot location

* Fix i removal

* changing API to be consistent with collision updates

* fix typo in regulated pure pursuit readme (ros-navigation#2228)

* Rviz state machine waypoint follower updates (ros-navigation#2227)

* working on canceling state machine for waypoint mode

* fixing cancelation logic

* fix linting isue

* adding cherry pick fixes

Co-authored-by: Sarthak Mittal <[email protected]>
Co-authored-by: Florian Gramß <[email protected]>
Co-authored-by: ChristofDubs <[email protected]>
Co-authored-by: Shrijit Singh <[email protected]>
Co-authored-by: Phone Thiha Kyaw <[email protected]>
Co-authored-by: simutisernestas <[email protected]>
Co-authored-by: G.Doisy <[email protected]>
Co-authored-by: Uladzslau <[email protected]>
Co-authored-by: Erwin Lejeune <[email protected]>

* bumping to 0.4.6

* bump to 0.4.7 and add missing dep to RPP

* [nav2_bringup] Update waffle.model (ros-navigation#2296)

Changed to the latest tire mesh file names for waffle as per the latest `turtlebot3_gazebo` package.

This results in faster loading and resolves the errors that come in `gazebo --verbose`

* Update list of behavioural tree nodes (ros-navigation#2329)

* Update list of nodes with nodes compiled in the branch and excluding unexistant to prevent runtime exceptions.

* Updated documentation

Co-authored-by: Pau Carre <[email protected]>

* fix merge errors

* not currenlty used -> no need to depend on it

Co-authored-by: Homalozoa X <[email protected]>
Co-authored-by: Steve Macenski <[email protected]>
Co-authored-by: Albert Yen <[email protected]>
Co-authored-by: MarcoLm993 <[email protected]>
Co-authored-by: Victor Lopez <[email protected]>
Co-authored-by: Michael Equi <[email protected]>
Co-authored-by: shonigmann <[email protected]>
Co-authored-by: Simon Honigmann <[email protected]>
Co-authored-by: Sarthak Mittal <[email protected]>
Co-authored-by: Florian Gramß <[email protected]>
Co-authored-by: ChristofDubs <[email protected]>
Co-authored-by: Shrijit Singh <[email protected]>
Co-authored-by: Phone Thiha Kyaw <[email protected]>
Co-authored-by: simutisernestas <[email protected]>
Co-authored-by: G.Doisy <[email protected]>
Co-authored-by: Uladzslau <[email protected]>
Co-authored-by: Erwin Lejeune <[email protected]>
Co-authored-by: Jovian Dsouza <[email protected]>
Co-authored-by: Pau Carré Cardona <[email protected]>
Co-authored-by: Pau Carre <[email protected]>
savalena pushed a commit to savalena/navigation2 that referenced this pull request Jul 5, 2024
…ros-navigation#1871)

* Added transient local subscription qos profile parameter to map saver

* Made transient local default true

* Fixed linter problem

* switched back house world to waffle model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants