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

Change publishers to publish unique ptrs #1673

Merged

Conversation

Sarath18
Copy link
Contributor

@Sarath18 Sarath18 commented May 2, 2020


Basic Info

Info Please fill out this column
Ticket(s) this addresses #1672
Primary OS tested on Ubuntu 18.04
Robotic platform tested on gazebo simulation of TurtleBot3 (Waffle)

Description of contribution in a few bullet points

  • Change all the publishers to publish unique pointers.

Description of documentation updates required from your changes

  • Publishers in navigation2 should publish unique pointers rather than raw messages.

Future work that may be required in bullet points

  • I have tried to cover all ROS publishers in navigation2. I'll make the necessary changes if any required.

@@ -53,7 +54,7 @@ class TestAmclPose : public ::testing::Test
subscription_ = node->create_subscription<geometry_msgs::msg::PoseWithCovarianceStamped>(
"amcl_pose", rclcpp::QoS(rclcpp::KeepLast(1)).transient_local().reliable(),
std::bind(&TestAmclPose::amcl_pose_callback, this, _1));
initial_pose_pub_->publish(testPose_);
initial_pose_pub_->publish(*testPose_);
Copy link
Contributor

Choose a reason for hiding this comment

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

isnt't it initial_pose_pub_->publish(std::move(*testPose_))?

Copy link
Member

Choose a reason for hiding this comment

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

Not quite, you're moving the pointer ownership, not the object.

@@ -81,15 +82,15 @@ class TestAmclPose : public ::testing::Test

bool TestAmclPose::defaultAmclTest()
{
initial_pose_pub_->publish(testPose_);
initial_pose_pub_->publish(*testPose_);
Copy link
Contributor

Choose a reason for hiding this comment

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

same here initial_pose_pub_->publish(std::move(*testPose_))?

Copy link
Member

Choose a reason for hiding this comment

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

Not quite, you're moving the pointer ownership, not the object.

while (!pose_callback_) {
// TODO(mhpanah): Initial pose should only be published once.
initial_pose_pub_->publish(testPose_);
initial_pose_pub_->publish(*testPose_);
Copy link
Contributor

Choose a reason for hiding this comment

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

same here initial_pose_pub_->publish(std::move(*testPose_))?

Copy link
Member

Choose a reason for hiding this comment

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

Not quite, you're moving the pointer ownership, not the object.

@Sarath18
Copy link
Contributor Author

Sarath18 commented May 2, 2020

I realized a few mistakes on my side. Firstly, I shouldn't have modified the code and the test cases together.

Secondly, modifications to this test case essentially do the same thing. During publishing, it is dereferencing the pointer which leads to the publishing of raw message instead.

isnt't it initial_pose_pub_->publish(std::move(*testPose_))?

@fmrico, let's look at the changes you suggested together. testPose_ is a unique_ptr inside the class and modifications to testPose_ happens in multiple functions of the class. So when the publish statement is called, the pointer gets dereferenced and then the data is moved to the publisher. Now the block that contained the data is deallocated and the pointer is still valid. This resulted in a failure of the test case. Even initial_pose_pub_->publish(std::move(testPose_)); won't work as this statement will pass the ownership to the publisher and testPose_ will become a null pointer.

I am unclear on how to tackle this problem. If testPose_ was a normal data member instead of a pointer, how do publish a unique pointer when publish statement is called?
The current implementation was to create a unique_ptr using the raw message and then publish it. But this might problems again as it will return a pointer to a newly allocated memory after moving the contents from the variable. This will deallocate that data member. Looking at it again I found out that this implementation worked out because data is being populated every time before being published.
Please do correct me if I am wrong.

@fmrico
Copy link
Contributor

fmrico commented May 3, 2020

Hi @Sarath18,

You are right!! But in this case, I suggest not to change this file. As you said, this is test code and maybe it shouldn't be changed.

I have run your code in sim and seems to be working properly. IMHO you did great work!!

I have done a little experiment comparing your improved code and the baseline. The robot performs a navigation along three waypoint, as shown in the desktop capture. The files contain a record every second of cpu (2nd column) and mem (3rd column).

Hope it helps!!
cpu_baseline.txt
cpu_improve.txt
Captura de pantalla de 2020-05-03 12-14-28

@Sarath18
Copy link
Contributor Author

Sarath18 commented May 3, 2020

You are right!! But in this case, I suggest not to change this file. As you said, this is test code and maybe it shouldn't be changed.

I should revert back the test cases.

I have run your code in sim and seems to be working properly. IMHO you did great work!!

Great! Thanks :)

I have done a little experiment comparing your improved code and the baseline. The robot performs a navigation along three waypoint, as shown in the desktop capture. The files contain a record every second of cpu (2nd column) and mem (3rd column).

Thank you for benchmarking the updates. Can you please clarify what baseline is? Is without the updates? Looking at the results you provided, I noticed that in general cpu_improve.txt shows more cpu usage compared to the baseline while memory usage remains the same. Weird.

@fmrico
Copy link
Contributor

fmrico commented May 4, 2020

Hi @Sarath18

Maybe we should repeat this experiment. I think that the first values of improved (this PR) are affected in some way by the execution of the experiment with baseline (master).

Anyway, If you see the sequence discarding first results, using unique_ptr significative reduces the cpu computation (second column). There are no significant changes in the mem computation (3rd column).

If you want to obtain your own values, in the screenshot you can find the command that I used to obtain these results.

@Sarath18
Copy link
Contributor Author

Sarath18 commented May 4, 2020

Hi @fmrico,

Anyway, If you see the sequence discarding first results, using unique_ptr significative reduces the cpu computation (second column). There are no significant changes in the mem computation (3rd column).

Thank you for clarifying. I made a plot of your results and that helped me understand the CPU utilization difference.
plot_legend

The current implementation was to create a unique_ptr using the raw message and then publish it. But this might problems again as it will return a pointer to a newly allocated memory after moving the contents from the variable. This will deallocate that data member. Looking at it again I found out that this implementation worked out because data is being populated every time before being published.

Any ideas on how to solve Costmap and Grid publishers in costmap_2d_publisher.cpp? @SteveMacenski mentioned in the ticket:

We should transition all ROS publishers in navigation (and anywhere we can) to this method. This is especially important for topics publishing larger messages like pointclouds, maps, and images.

Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

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

I see 2 publishes missing in the map server for the map and in the planner server publishing paths. Otherwise LGTM

nav2_recoveries/plugins/back_up.cpp Outdated Show resolved Hide resolved
nav2_recoveries/plugins/spin.cpp Outdated Show resolved Hide resolved
@SteveMacenski
Copy link
Member

SteveMacenski commented May 4, 2020

@Sarath18 when you do std::move it nulls out the pointer, so it needs to be reallocated. For all the cases when you publish something, you need to make sure that the variable is local to the function so that a new unique_ptr will be made each time its called or that the class variables are reallocated before a next call.

i'm not overly concerned with changing the tests because those aren't used in production and this is a production optimization.

Those charts do look suspect. I don't see why gazebo would drop so much CPU based on a far downstream change. I think this would have to be re-run at least 5 times on the same computer to get results. I would be really interested in this analysis though (and a number like saved N%), that could make a very useful write up in the ROS2 documentation and if we had tangible proof of its impact, that could be really valuable.

See below on costmap_2d_publisher

@fmrico what script did you use for that? Can you share it with us? Might be useful to add to the tools/ directory. If we can get the recording code and then a plotting code, that could be useful for making optimizations.

@Sarath18
Copy link
Contributor Author

Sarath18 commented May 4, 2020

For all the cases when you publish something, you need to make sure that the variable is local to the function

Got it.

i'm not overly concerned with changing the tests because those aren't used in production and this is a production optimization.

I reverted back the test case anyway.

Those charts do look suspect. I don't see why gazebo would drop so much CPU based on a far downstream change. I think this would have to be re-run at least 5 times on the same computer to get results.

I'll rerun the tests as you said on my computer and then share the results. @fmrico, it would be great if you could throw some more light on this.

@fmrico what script did you use for that? Can you share it with us?

You can find the script in the screenshot @fmrico attached above.

while true; do ps -a -o comm= -o pcpu= -o pmem=; echo "================================"; sleep 1; done >> cpu_baseline.txt

I would be really interested in this analysis though (and a number like saved N%), that could make a very useful write up in the ROS2 documentation and if we had tangible proof of its impact, that could be really valuable.

Might be useful to add to the tools/ directory. If we can get the recording code and then a plotting code, that could be useful for making optimizations.

I believe we both have written rough scripts to test this feature. If you really want to add it to the tools directory we can polish the logging/visualization before that. I think this can be moved to a separate ticket to populate ideas and incorporate more features.

@fmrico
Copy link
Contributor

fmrico commented May 5, 2020

Hi @SteveMacenski

As @Sarath18 wrote, the command used was very simple:

while true; do ps -a -o comm= -o pcpu= -o pmem=; echo "================================"; sleep 1; done >> cpu_baseline.txt

It's simple, but it gives us a quick idea about the improvement

Francisco

@Sarath18
Copy link
Contributor Author

Sarath18 commented May 5, 2020

I see 2 publishes missing in the map server for the map and in the planner server publishing paths.

Hey @SteveMacenski, I didn't update these publishers to publish unique_ptrs because they were not in the local scope of the publisher and were being used in multiple places. I see a few ways to update this but I am not sure if that is the best way to do so. result in planner_server is a shared pointer being passed to action_server_ and msg_ (occupancy_grid) in map_server is a unique pointer that is being updated in different methods of the class.

I have made all other requested changes.

@SteveMacenski
Copy link
Member

I think the map server msg_ is only published by 1 entity (correct me if I'm wrong). You should be able to create the unique_ptr on bringup, and then after std::move to publish, instantiate it again. If everything is single threaded, then there's no risk of someone calling on that nullptr.

For the planner the path isn't a shared pointer, the result is a shared pointer. You can change the path return from the planner to be a unique_ptr local variable that's dereferenced and copied to the result shared pointer. There's going to be 1 copy somewhere, lets just own it in the code explicitly.

grid_width = costmap_->getSizeInCellsX();
grid_height = costmap_->getSizeInCellsY();

auto grid_ = std::make_unique<nav_msgs::msg::OccupancyGrid>();
Copy link
Member

Choose a reason for hiding this comment

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

You can leave grid_ as a class variable, in fact, I'd prefer it. You just need to std::make_unique<nav_msgs::msg::OccupancyGrid>(); on the class variable at the start of prepare grid to instantiate it. I'd revert this commit and just make the simpler change here and in publish grid. You don't want to return smart pointer types.

@SteveMacenski
Copy link
Member

Looks like you have some merge conflicts (somehow?) with amcl

@Sarath18
Copy link
Contributor Author

Sarath18 commented May 6, 2020

For the planner the path isn't a shared pointer, the result is a shared pointer. You can change the path return from the planner to be a unique_ptr local variable that's dereferenced and copied to the result shared pointer. There's going to be 1 copy somewhere, lets just own it in the code explicitly.

If there is going to be one copy somewhere, why not do it just before the publish (just before or inside publishPlan)? By doing this we can incorporate any updates to the path (if any) before publishing. I tested it out and it works just fine.

I think the map server msg_ is only published by 1 entity (correct me if I'm wrong).

There are two publishers in the MapServerClass. One int the on_activate lifecycle state and the other one in the loadMapCallback.

You should be able to create the unique_ptr on bringup, and then after std::move to publish, instantiate it again. If everything is single threaded, then there's no risk of someone calling on that nullptr.

I did this. But I had to populate the OccupancyGrid by calling loadMapFromYaml after instantiation. I don't think this is a good way to do that. By having another class variable that stores the OccupancyGrid and then copying it into unique_ptr we will again face a 1 copy somewhere.

Looks like you have some merge conflicts (somehow?) with amcl

This is because of the update to amcl particle cloud to incorporate weights. I'll merge this once everything else is solved.

I have made all other requested changes.

@SteveMacenski
Copy link
Member

If there is going to be one copy somewhere, why not do it just before the publish (just before or inside publishPlan)? By doing this we can incorporate any updates to the path (if any) before publishing. I tested it out and it works just fine.

You could also do make_unique<...>(result->path) as well, sure. I was just pointing out that the path wasn't the shared ptr, it was a member of one so there's no a conversion from shared_ptr -> unique_ptr required. Its just copying the contents of a memory of the result to the unique_ptr to publish.

There are two publishers in the MapServerClass. One int the on_activate lifecycle state and the other one in the loadMapCallback.

That's fine. In both places do

occ_pub_->publish(std::move(msg_));
msg_ = ... make_unique<>();

The only issue you would run into is if the activate was called at the exact same time as loadMapCallback, which I don't think is possible since the on_activate is called from a callback that will be taking up the node executor so no other service calls can be made, and vise versa.

But I had to populate the OccupancyGrid by calling loadMapFromYaml after instantiation.

You are correct. Mhm. That makes map server really interesting. Maybe we should change the map msg_ to be a stack variable and we copy it to a unique_ptr to publish.

* Change nav2_map_server publisher to publish occupancy grid unique ptr

* Change publisher in nav2_planner to publish path unique ptr

* Remove smart pointer return from functions in nav2_costmap_2d

* Run cpp_lint manually in nav2_costmap_2d
* Adhere to conventions of smart pointers passing to function

* Change publisher in dwb_core to publish unique pointer
@Sarath18
Copy link
Contributor Author

Sarath18 commented May 7, 2020

@SteveMacenski, I have made all the changes. If everything seems fine, I'll merge master here and fix any conflicts that occur.

I am not sure if I encounter a bug or not but ament_cpplint was not configured for nav2_costmap_2d when running tests. I had to manually run the checks and resolve the issues in that package.

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.

One last question and LGTM

@AlexeyMerzlyakov can you review the map server part?

@SteveMacenski
Copy link
Member

I am not sure if I encounter a bug or not but ament_cpplint was not configured for nav2_costmap_2d when running tests. I had to manually run the checks and resolve the issues in that package.

You're welcome to add that then.

Also, you still have conflicts to resolve.

@codecov
Copy link

codecov bot commented May 8, 2020

Codecov Report

Merging #1673 into master will decrease coverage by 0.28%.
The diff coverage is 15.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1673      +/-   ##
==========================================
- Coverage   39.41%   39.13%   -0.29%     
==========================================
  Files         205      205              
  Lines       10302    10310       +8     
  Branches     4187     4204      +17     
==========================================
- Hits         4061     4035      -26     
- Misses       3665     3693      +28     
- Partials     2576     2582       +6     
Flag Coverage Δ
#project 39.13% <15.96%> (-0.29%) ⬇️
Impacted Files Coverage Δ
nav2_bt_navigator/src/ros_topic_logger.cpp 38.09% <0.00%> (-4.77%) ⬇️
nav2_controller/src/nav2_controller.cpp 25.65% <0.00%> (-0.53%) ⬇️
...d/include/nav2_costmap_2d/costmap_2d_publisher.hpp 100.00% <ø> (ø)
...costmap_2d/include/nav2_costmap_2d/voxel_layer.hpp 8.00% <ø> (ø)
nav2_costmap_2d/src/costmap_2d_cloud.cpp 0.00% <0.00%> (ø)
nav2_costmap_2d/src/costmap_2d_markers.cpp 0.00% <0.00%> (ø)
nav2_costmap_2d/src/costmap_2d_ros.cpp 27.23% <0.00%> (ø)
nav2_dwb_controller/dwb_core/src/publisher.cpp 21.55% <0.00%> (-0.27%) ⬇️
...lifecycle_manager/src/lifecycle_manager_client.cpp 0.00% <0.00%> (ø)
nav2_planner/src/planner_server.cpp 24.60% <0.00%> (-1.00%) ⬇️
... and 15 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 0c4aea8...e3e7314. Read the comment docs.

@AlexeyMerzlyakov
Copy link
Collaborator

@AlexeyMerzlyakov can you review the map server part?

Checked. Map server change looks good to me. I agree that there is no need to keep msg_ to be unique_ptr since it will be converted to rvalue later.

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.

Thanks for this work, you've probably touched the most code throughout the stack of the new developers! Learn anything from looking at these files?

@SteveMacenski SteveMacenski merged commit 2113b6a into ros-navigation:master May 8, 2020
@Sarath18
Copy link
Contributor Author

Sarath18 commented May 9, 2020

Thank you for this opportunity. This helped me to understand the navigation2 structure and the inner working much more clearly. Along with this, I got to learn about smart pointers, memory management, code practices and conventions too 😄.

That makes map server really interesting.

I agree, but the entire navigation stack is one beautiful piece of art and it just keeps getting better 🌟

@Sarath18 Sarath18 deleted the feature_pub_unique_ptr branch May 9, 2020 16:22
SteveMacenski added a commit to SteveMacenski/navigation2 that referenced this pull request Jun 17, 2020
* Corrected check to detect collision (ros-navigation#1404) (ros-navigation#1601)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Script (ros-navigation#1599)

* Add eloquent option to build script and made it default

* Add eloquent in the error message

* Remove dashing

* setStatus(BT::NodeStatus::IDLE) removed (ros-navigation#1602)

the removed code has no effect at all: the status of a node will be its returned value!.

In general, you never set your status to IDLE, unless halted.

* Spin recovery (ros-navigation#1605)

* Corrected check to detect collision (ros-navigation#1404)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Changed collision check to detect only lethal and unknown cells (ros-navigation#1404)(ros-navigation#1603)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* making documentation distro agnostic (ros-navigation#1610)

* Issue 1608 segmentation fault planner server node master (ros-navigation#1612)

* corrected wrong indexing in NavfnPlanner::smoothApproachToGoal function

* resolved uncrustify errors

* corrected the condition inside NavfnPlanner::smoothApproachToGoal to replace last pose of computed path

Co-authored-by: chikmagalore.thilak <chikmagalore.thilak@bshg.com>

* BehaviorTree refactoring (ros-navigation#1606)

* Proposed refactoring to avoid issues with CoroAction

* correctly haltAllActions (related to ros-navigation#1600)

* not really needed and will be deprecated soon

* Applying changes suggested in the comments of ros-navigation#1606

- fix haltAllActions
- changes method signature on_success()
- reverts the changes made here:
https://github.com/ros-planning/navigation2/pull/1515/files

* fix warnings and errors

* make uncrustify happy?

* Update bt_navigator.cpp

* Update bt_navigator.cpp

* uncrustify fix

Co-authored-by: daf@blue-ocean-robotics.com <Davide Faconti>

* Decide the output of BtServiceNode based on the service-response (ros-navigation#1615)

- `BtServiceNode::check_future()` was created, to encapsulate the logic
where a the output of the BtServiceNode is computed.
- Inherited classes can overload this function according to the requirement
of the user

* Add server_name parameter to BtActionNode (ros-navigation#1616)

A BT port is introduced in case the user wants to change the default action_name
of BtActionNode.

* Added thread synchronization to KinematicParameters (ros-navigation#1459) (ros-navigation#1621)

* Added thread synchronization to KinematicParameters (ros-navigation#1459)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Doxygen fix (ros-navigation#1459)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Docs (ros-navigation#1629)

* Updated website gifs (ros-navigation#1228)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Created new gifs (ros-navigation#1228)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Corrected gif name (ros-navigation#1228)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Allow reaction to cancellation and preemption on wait recovery plugin (ros-navigation#1636)

* Changed onCycleUpdate to allow preemption (ros-navigation#1622)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Deleted unnecessary wait and corrected style (ros-navigation#1622)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Nav2 planner plugin tutorial (ros-navigation#1633)

* Nav2 planner plugin tutorial draft 1

* Reduced gif size

* Updated the config code block

* Remove RRTConnect plugin and add StraightLine plugin.

* Address reviewer's comments

* Add information about planners mapping in Navigation2

* Minor path fix for gif (ros-navigation#1638)

* Minor improvement on best practice for pluginlib export (ros-navigation#1637)

* Add caps to headers (ros-navigation#1639)

* Fix segfault in test_planner_random_node/test_planner_costmaps_node (ros-navigation#1640)

The problem appears while addressing zero-length path vector
after planner failed to create a plan.

* Fix trans_stopped_velocity comparison with x & y velocity (ros-navigation#1649)

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* map_server refactor and cleanup (ros-navigation#1624)

* [WIP] map_server refactor and cleanup

nav2_map_server/mapio (map input-optput library):
* Move OccupancyGrid messages saving code from MapSaver::mapCallback()
  to saveMapToFile() function
* Rename and move try_write_map_to_file() MapSaver method
  to tryWriteMapToFile() function
* Move map saving parameters into one SaveParameters struct
* Reorganize map saving parameters verification code from MapSaver
  to new checkSaveParameters() function
* Correct logging for incorrect input cases in checkSaveParameters()
* Copy loadMapFromYaml() method from OccupancyGridLoader
* Move loadMapFromFile() method from OccupancyGridLoader
* Rename and move load_map_yaml() OccupancyGrid method
  to loadMapYaml() function
* Move LoadParameters struct from OccupancyGridLoader

nav2_map_server/map_saver:
* Completely re-work MapSaver node:
 - Switch MapSaver from rclcpp::Node to nav2_utils::LifecycleNode
 - Revise MapSaver node parameters model
 - Add saveMapTopicToFile() method for saving map from topic
 - Remove future-promise synchronization model as unnecessary
* Add "save_map" service with new SaveMap service messages
* Rename map_saver_cli.cpp -> map_saver_cli_main.cpp file
  and map_saver -> to map_saver_cli executable
* Add ability to save a map from custom topic ("-t" cli-option)
* Restore support of "--ros-args" remappings
* Update help message in map_saver_cli
* New map_saver_server_main.cpp file and map_saver_server executable:
  continuously running server node
* New launch/map_saver_server.launch.py: map_saver_server launcher

nav2_map_server/map_server:
* Revise MapServer node parameters model
* Rename loadMapFromYaml() -> loadMapResponseFromYaml()
* Add node prefix to "map" and "load_map" service names
* Fix crash: dereferencing nullptr in map_server running as a node
  while handling of incorrect input map name
* Add updateMsgHeader() method for correcting map message header
  when it belongs to instantiated object
* Rename main.cpp -> map_server_main.cpp file
* Minor changes and renames to keep unified code style

nav2_util/map_loader:
* Remove as duplicating of loadMapFromFile() from MapIO library

other:
* Update nav2_map_server/README
* Fix testcases

* Fixes for cpplint, uncrustify, flake8 and test_occ_grid_node failures

* Fixing review comments

* Rename mapio -> map_io
* Move all OccGridLoader functionality into MapServer. Remove OccGridLoader
* Switch all thresholds to be floating-point
* Switch loadMapFromYaml() returning type to LOAD_MAP_STATUS and remove
  duplicating code from loadMapResponseFromYaml()
* Make mapCallback() to be lambda-function
* Make saveMapCallback() to be class method
* Utilize local rclcpp_node_ from LifecycleNode instead of map_listener_.
  Remove map_listener_ and got_map_msg_ variables.
* Rename load_map_callback() -> loadMapCallback() and make it to be class method
* Rename handle_occ_callback() -> getMapCallback() and make it to be class method
* Force saveMapTopicToFile() and saveMapToFile() to work with constant arguments
* map_saver_cli: move arguments parsing code into new parse_arguments() function
* Rename test_occ_grid_node -> test_map_server_node and fix test
* Rename test_occ_grid -> test_occ_grid and fix test
* Fix copyrights
* Fix comments
* Update README

* Increase test coverage

* Fixing review comments

* Separate map_server and map_saver sources
* Fix copyrights
* Suppress false-positive uncrustify failure

* Map Server docs update for Foxy (ros-navigation#1650)

* Map Server docs update for Foxy

* Fixes after review

* Add brief description of map_io

* Initialize variabes to avoid errors during build (ros-navigation#1654)

Signed-off-by: Pablo Vega <epvega@gmail.com>

* Temporarily remove planner tests (ros-navigation#1656)

* Replace deprecated ament_export_interfaces

* Revert edf9b9a

Accidental commit into github ui

* remove docs from navigation2 repo (ros-navigation#1657)

* Update hyperlinks in readme for new website docs (ros-navigation#1668)

* Update hyperlinks in readme for new website docs

* Adding link to join slack

* Ignore codecov paths in tests (ros-navigation#1671)

* Ignore codecov paths in tests

* adding missing string test case for stripping leading slash

* Update test_string_utils.cpp

* Update test_string_utils.cpp

* Update codecov.yml

* Update codecov.yml

* Update codecov.yml

* Update codecov.yml

* Fix bug in the condition to publish local plan (ros-navigation#1674)

Signed-off-by: Francisco Martin Rico <fmrico@gmail.com>

* Fix infinite rotation in Spin recovery when angle > PI (ros-navigation#1670)

* Fix infinite rotation in Spin recovery when angle > PI

* Add test for spin recovery

* Fix formatting

* Add general optimizations

* Fix copyright

* Add weights to AMCL particle cloud (ros-navigation#1677)

* Add Particle and ParticleCloud msgs to publish amcl particle cloud with weights

* Add deprecation warning

* Remove dead code from navfn planner (ros-navigation#1682)

* adding wait recovery integration test (ros-navigation#1685)

* adding recovery wait test

* adding copy rights

* fixing gaurds

* Add ignoring code cov any files named test_ (ros-navigation#1691)

* Add ignoring code cov any files named test_

* Update slack URL

* Update codecov.yml

* Replace current cell reference with copy (ros-navigation#1690)

The cell reference becomes invalidated as the reference becomes invalid when a new  cell is added to the vector

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* Fix segfault in test_planner_random_node (ros-navigation#1694)

deactivate needs to be called before cleanup
to stop the mapUpdateLoop()

Signed-off-by: Siddarth Gore <siddarth.gore@gmail.com>

* Adding more simple action server, nav2_utils, and lifecycle bringup CLI tests (ros-navigation#1695)

* adding tests to simple action server and fixed bug

* more test coverage in nav2_utils

* testing lifecycle cli program

* shifting action server test around for stability

* adding test temp commented out

* flake

* w/o resetting

* Change publishers to publish unique ptrs (ros-navigation#1673)

* Change publishers to publish unique ptrs

* Revert test case modification

* Update function signature to receive unique_ptrs

* Update publishers in nav2_costmap_2d to publish unique ptrs

* Update publishers in nav2_planner and nav2_map_server

* Change nav2_map_server publisher to publish occupancy grid unique ptr

* Change publisher in nav2_planner to publish path unique ptr

* Remove smart pointer return from functions in nav2_costmap_2d

* Run cpp_lint manually in nav2_costmap_2d

* Minor fixes

* Adhere to conventions of smart pointers passing to function

* Change publisher in dwb_core to publish unique pointer

* update for BT.cpp master (ros-navigation#1714)

* Update CI for ROS2 Foxy (ros-navigation#1684)

* Update Dockerfile

* Update repo paths

* Copy all of workspaceto include .repo files expected by CI in image

* Patch Docker and CI for missing gazebo 11
Revert once gazebo 11 is ready

* Disable connext for now

* Disable debug jobs in nightly workflow

* Remove unused install_deployment_key refrence

* Update the release Dockerfile

* Use buildkit to speed up loacal builds

* Add example of running tests

* Roll back BTcpp and no-error deprecated warnings

* Revert "Roll back BTcpp and no-error deprecated warnings"

This reverts commit 301eb54.

* Move extra Dockerfiles to tools folder

* Replace deprecated ament_export_interfaces (ros-navigation#1669)

with ament_export_targets
See notice here:
https://index.ros.org/doc/ros2/Releases/Release-Foxy-Fitzroy/

* Refactor rclcpp::executor::FutureReturnCode deprecation (ros-navigation#1702)

* Refactor deprecated code

* Add ompl repo (for test)

* Fix indent

* Remove OMPL

* Fix cppcheck errors (ros-navigation#1718)

* Fix cppcheck errors

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* Fix test name generator

* Fix returning after it is deallocated / released error

* Increase sleep to 10 seconds to allow map server node to start up

* Fix infinite wait for service in nav2_map_server tests

* [WIP] Checking line coverage in codecov (ros-navigation#1713)

* Add parsers options

* Disable all branch detection option

* Replace lcov with gcov

* Revert changes in codecov.yaml and remove branch coverage from coverage bash script

* [master] Windows bring-up (ros-navigation#1704)

* Windows bringup.

* nullity check.

* nullity check.

* Added goal updated condition node (ros-navigation#1712)

* Added goal updated condition node

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Updated bt_navigator readme and added missing failure condition

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Updated bt_navigator readme

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Update nav2_bt_navigator/README.md

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>

* Update nav2_bt_navigator/README.md

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>

* Update nav2_bt_navigator/README.md

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>

* Tf timeout (ros-navigation#1724)

* Parameterized tf_timeout in amcl
* Refactored the existing transform_tolerance parameter in amcl to transform_publish_shift.
* Refactored tf_buffer method calls to use transform_tolerance according to [978].

* Added tf_timeout to static_layer and observation_buffer

* declared transform_tolerance parameter

* change transform_tolerance default value

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>

* Removed transform_publish_shift param

* Fixed linting errors

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>

* Fix system_tests flaky issue (ros-navigation#1723)

* Return back planning system tests

* Fix testcase failure related to not updating costmap

This appeared while compiler treated costmap pointer
to be unused and optimized it out

* Fix flake8 E128 failure

* Fix uninitialized variable warnings and change default value (ros-navigation#1728)

* Fix uninitialized warning for variable temp_tf_tol.

* Change default GridBased.tolerance to 0.5 meters

* Add DistanceController decorator node (ros-navigation#1699)

* Add DistanceController decorator node

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* Update documentation and rename behavior tree XMLs

* Add tests for distance controller

* Fix test

* Update readme and add BT image

* Rename test files

* Remove protected setStatus calls

* Add option to inflate unknown space (ros-navigation#1675)

* Add option to inflate around unknown space

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* Fix bug regarding lower bound of double in worldToMapEnforceBounds

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* Convert 2D caches to 1D vectors for automatic memory management and better locality

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* Add general optimizations and modern syntax

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* Switch from map<double> to vector<> in using precached integer distances

Credits to original author from ros-planning/navigation#839

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* Add tests for inflate_unknown and inflate_around_unknown

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* Remove commented out assert

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* Add BehaviorTree visualization support using Groot (ros-navigation#1725)

* Add BehaviorTree visualization support using Groot

* Add nav2 TreeNodesModel containing all BT Nodes used

* Add instructions on using Groot to visualize behavior trees

Signed-off-by: Sarathkrishnan Ramesh <sarathkrishnan99@gmail.com>

* Rearrange files and minor updates

* Move nav2_tree_nodes.xml and groot instruction to nav2_beahvior_tree

* Run cmake install rules for nav2_tree_nodes.xml

Signed-off-by: Sarathkrishnan Ramesh <sarathkrishnan99@gmail.com>

* Add distance controller node in nav2 TreeNodesModel

Signed-off-by: Sarathkrishnan Ramesh <sarathkrishnan99@gmail.com>

* Add collision checking for footprint without using subscibers. (ros-navigation#1703)

* Add collision checking for footprint without using subscibers.

* Address reviewer's comments

- Changed the design if the footprint collision checkers
- And propogate the changes to dependencies such as nav2_recoveries and nav2_core

* Remove some extra headers

* Remove debuging code

* Add requested test

* Change weird test names.

* Remove unorientFootprint function dependency

* Imporve tests

* Fix commented Varible

* Expose distance controller frames to ports (ros-navigation#1741)

* Add feedback in navigation2 actions (ros-navigation#1736)

* adding navigate to pose feedback and remove random crawl from master

* adding controller feedback

* recovery feedback actions

* Update nav2_controller/src/nav2_controller.cpp

Co-Authored-By: Carl Delsey <1828778+cdelsey@users.noreply.github.com>

* Add feedback in wait action and make general improvements

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* Fix rebase errors

* Make feedback reset across different goals

Co-authored-by: stevemacenski <stevenmacenski@gmail.com>
Co-authored-by: Carl Delsey <1828778+cdelsey@users.noreply.github.com>

* Switch to nightly tag for release image (ros-navigation#1746)

as tests for connext rmw have been disabled.54

* Parameterization of the tf_tol argument for getCurrentPose calls (ros-navigation#1735)

* parametrized collision_checker getCurrentPose timeout

* Parameterized tf_tol for spin and backup recoveries

* Parameterized tf_tol for goal_reached_condition

* moved transform_tolerance_ to recovery.hpp

* moved transform_tolerance parameter declaration to bt_navigator

* Fixed typo

* Fixed transform_tolerance_ location and transform_tolerance param declaration location

* Parameterized tf_tol for distance_controller.cpp

* Revert libgazebo11 workaround for CI (ros-navigation#1750)

* Revert libgazebo11 workaround

* Revert gazebo_ros_pkgs to main ros2 branch

* Resolves ros-navigation#938 (ros-navigation#1747)

The forward_point_distance used in the GoalAlign and PathAlign critics projects the current pose forward a default 0.325 meters before scoring the trajectory. This can cause velocities that create sharp turns into obstacles to be chosen (reproducible with the Turtlebot3 simulation).

For TB3, which is small in size, 0.325 meters is too far. Instead, enable GoalAlign and PathAlign critics in the DWB controller and shorten the critics' forward_point_distance (how far the current pose is project given the current orientation before scoring the trajectory) from the default 0.325 meters to 0.1 meters which improves stability when running with TB3.

Signed-off-by: Jack Pien <jack@jackpien.com>

* make basic failing test for tf2 wrapper (start of robot utils tests) (ros-navigation#1743)

* make basic failing test for tf2 wrapper

* add file :-)

* Run rosdep update in Dockerfile and CI (ros-navigation#1751)

So we don't have to wait for the nightly parent image to update rosdep

* Don't pass rosdistro when using empty index (ros-navigation#1752)

Context: osrf/docker_images#399

* Explicitly set junit_family parameter for nav2_gazebo_spawner tests (ros-navigation#1753)

* Parameterize frame IDs (ros-navigation#1742)

* Use parameterized frames (ros-planning#1726)

Signed-off-by: ymd-stella <world.applepie@gmail.com>

* Expore frame to ports in GoalReached and add params to bringu yaml files

* Fix recovery interface

* Update launch file and add recovery parameters to bringup yaml

* Remove lifecycle node params

* Update bringup param files

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* Fix cpplint error

* Fix nav2_recoveries cpplint errors

Co-authored-by: ymd-stella <world.applepie@gmail.com>

* Add the goal to NavFN tolerance region traversing algorithm (ros-navigation#1734)

* Consider the goal itself when looking to potential within tolerance region

* Fixed comments

* Re-enable nightly debug builds for codecov (ros-navigation#1760)

Looks like codecov analytics from merged PRs alone do not update codecov status for the master branch.
Re-enabling nightly debug builds to keep codecov status on master up-to-date

* Wait for initial pose and increase timeouts (ros-navigation#1759)

Initial pose is needed for the test to run
so it makes sense to wait for it till it times out.

* removed unused condition (ros-navigation#1769)

* Added use of declare_parameter_if_not_declared. (ros-navigation#1765)

* Added use of declare_parameter_if_not_declared.

* Fixed column width.

* Whitespace removal

* Style cleanup.

* a bugfix of clear costmap service action (ros-navigation#1764)

The following is an example of the error.
[ERROR] [1590171638.335693813] [bt_navigator]: Action server failed while executing action callback: "failed to send request: ros_request argument is null, at /opt/ros/src/ros2/rcl/rcl/src/rcl/client.c:278"a bugfix of clear costmap service action

Signed-off-by: Daisuke Sato <daisukes@cmu.edu>

* Add condition nodes for time and distance replanning (ros-navigation#1705)

* Add condition nodes and behavior tree to enable replan on new goal

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* Fix time expired and distance traveled conditions

* Remove new_goal_received from blackboard

* Fix IDLE check condition in new condition nodes

* Fix lint errors

* Fix lint errors

* Address reviewer's comments

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* Add tests

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* a patch for ros-navigation#1773 BT navigator nodes with use_sim_time (ros-navigation#1776)

Signed-off-by: Daisuke Sato <daisukes@cmu.edu>

* Replace deprecated launch params (ros-navigation#1778)

* Update deprecated launch params

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* Revert internal python changes

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* adding backup tests (ros-navigation#1774)

* adding backup tests

* add negative case

* correct termination logic

* increase speed

* fixish failure test case

* declared default_critic_namespaces param (ros-navigation#1785)

* List of parameters in the stack  (ros-navigation#1761)

* Initial commit

* Added AMCL params and some formatting fixes

* Added some missing params

* Added bt nodes ports

* fixed typo

* Added <> to base names + some reformating

* added default_critic_namespaces param to dwb_local_planner

* Fix some parameters not being passed to getCurrentPose (ros-navigation#1790)

Signed-off-by: ymd-stella <world.applepie@gmail.com>

* Add SLAM Toolbox and map_saver_server into launch-files (ros-navigation#1768)

* Add SLAM launch file

Fix possible collision of laser scan with camera on waffle

* Simplifications and fixes after review

* Increase save_map_timeout to 5 sec to comply with SLAM Toolbox map rate

* BT navigator conversion fix (ros-navigation#1793)

* include bt_conversions.hpp to convert input properly

Signed-off-by: Daisuke Sato <daisukes@cmu.edu>

* delete redundant include statement

Signed-off-by: Daisuke Sato <daisukes@cmu.edu>

* Add complete parameter description documentation (ros-navigation#1786)

* adding a bunch of parameter descriptions

* ading costmap param descriptions

* add AMCL parameters

* adding DWB params

* resolving review questions

* include planner and controller ID parameters

* fixing jack's requests

* Test for lifecycle manager (ros-navigation#1794)

* Add test

* Add more coverage

* Merge test header file with executable

* Address PR reviewer's comment

* Add some more coverage

* Revert accidental changes to localization_launch.py file.

* Update modified default_bt_xml_filename parameter (ros-navigation#1797)

Parameter ``bt_xml_filename`` has changed to ``default_bt_xml_filename``

Co-authored-by: Aitor Miguel Blanco <aitormibl@gmail.com>
Co-authored-by: Shivang Patel <shivaang14@gmail.com>
Co-authored-by: Davide Faconti <davide.faconti@gmail.com>
Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
Co-authored-by: crthilakraj <crthilakraj@users.noreply.github.com>
Co-authored-by: chikmagalore.thilak <chikmagalore.thilak@bshg.com>
Co-authored-by: Ashwin Bose <ashwinbose123@gmail.com>
Co-authored-by: Alexey Merzlyakov <60094858+AlexeyMerzlyakov@users.noreply.github.com>
Co-authored-by: Shrijit Singh <shrijitsingh99@gmail.com>
Co-authored-by: p-vega <vega@enib.fr>
Co-authored-by: Ruffin <roxfoxpox@gmail.com>
Co-authored-by: Francisco Martín Rico <fmrico@gmail.com>
Co-authored-by: Sarthak Mittal <sarthakmittal2608@gmail.com>
Co-authored-by: Siddarth Gore <siddarth.gore@gmail.com>
Co-authored-by: Sarathkrishnan Ramesh <sarathkrishnan99@gmail.com>
Co-authored-by: Sean Yen <seanyen@microsoft.com>
Co-authored-by: Marwan Taher <marokhaled99@gmail.com>
Co-authored-by: TingChang <qting0529@hotmail.com>
Co-authored-by: Carl Delsey <1828778+cdelsey@users.noreply.github.com>
Co-authored-by: Jack Pien <jack@jackpien.com>
Co-authored-by: ymd-stella <world.applepie@gmail.com>
Co-authored-by: tgreier <tgreier@moog.com>
Co-authored-by: Daisuke Sato <43101027+daisukes@users.noreply.github.com>
Co-authored-by: ymd-stella <7959916+ymd-stella@users.noreply.github.com>
@emSko emSko mentioned this pull request Nov 10, 2023
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants