Skip to content

cleanup all globally hardcoded remaps for multirobots#1214

Merged
SteveMacenski merged 24 commits intoros-navigation:masterfrom
SteveMacenski:multi_cleanup
Nov 3, 2019
Merged

cleanup all globally hardcoded remaps for multirobots#1214
SteveMacenski merged 24 commits intoros-navigation:masterfrom
SteveMacenski:multi_cleanup

Conversation

@SteveMacenski
Copy link
Copy Markdown
Member

@SteveMacenski SteveMacenski commented Oct 10, 2019

Fixes #746

This PR cleans up all the hardcoded global scope topics across the stack so were not unnecessarily remapping basic topics.

Passes tests but I think @orduno is in the best position to give this the thumbs up that it resolves all the issues he needed the remaps for.

Now the remaps are just for things genuinely needed (TF) where there isn't (yet) an option for a prefix

@SteveMacenski SteveMacenski requested a review from orduno October 10, 2019 18:49
@SteveMacenski
Copy link
Copy Markdown
Member Author

Also @orduno I see you have a multirobot system test PR, you're more than welcome to pull my commit into that branch and I can close this PR. It was just a quick cleanup job

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 10, 2019

Codecov Report

Merging #1214 into master will decrease coverage by 0.79%.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #1214     +/-   ##
========================================
- Coverage      39%   38.2%   -0.8%     
========================================
  Files         244     244             
  Lines       11033   11033             
  Branches     4565    4565             
========================================
- Hits         4303    4215     -88     
- Misses       3874    3990    +116     
+ Partials     2856    2828     -28
Flag Coverage Δ
#project 38.2% <0%> (-0.8%) ⬇️
Impacted Files Coverage Δ
nav2_bt_navigator/src/bt_navigator.cpp 20.83% <ø> (ø) ⬆️
...map_2d/test/integration/test_collision_checker.cpp 51.33% <0%> (ø) ⬆️
...av2_costmap_2d/test/integration/obstacle_tests.cpp 33.33% <0%> (ø) ⬆️
..._tests/src/localization/test_localization_node.cpp 68% <0%> (ø) ⬆️
nav2_costmap_2d/src/costmap_2d_ros.cpp 22.22% <0%> (ø) ⬆️
nav2_controller/src/nav2_controller.cpp 22.05% <0%> (ø) ⬆️
...v2_costmap_2d/test/integration/inflation_tests.cpp 29.35% <0%> (ø) ⬆️
...cpp/nav2_msgs/srv/clear_entire_costmap__struct.hpp 0% <0%> (-100%) ⬇️
...dl_generator_cpp/nav2_msgs/action/wait__struct.hpp 9.52% <0%> (-57.15%) ⬇️
...dl_generator_cpp/nav2_msgs/action/spin__struct.hpp 9.09% <0%> (-54.55%) ⬇️
... and 13 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 cd239d6...45fdac6. Read the comment docs.

@orduno
Copy link
Copy Markdown
Contributor

orduno commented Oct 16, 2019

Thanks for making these changes Steve.

I pulled your branch and applied #1243 on top. Tests pass! (however, we're not testing "dynamic" obstacles -- see above)

Here's the branch in case you're interested.

Besides my comment above, all looks good.

@SteveMacenski
Copy link
Copy Markdown
Member Author

Seems to me best action is to have the / added back in front of the configuration file as a configuration file is meant to configure for a specific use case. For the case of multirobot, I think its reasonable to have an overloading configuration file with the total namespace for these nodes, ei nav_params.yaml and nav_params_multirobot.yaml

@SteveMacenski
Copy link
Copy Markdown
Member Author

@crdelsey @orduno can I get reviews?

@orduno
Copy link
Copy Markdown
Contributor

orduno commented Oct 23, 2019

For the case of multirobot, I think its reasonable to have an overloading configuration file with the total namespace for these nodes, ei nav_params.yaml and nav_params_multirobot.yaml

Are you planning on adding this to this PR?

@SteveMacenski
Copy link
Copy Markdown
Member Author

I can. What namespace(s) would you like?

@orduno
Copy link
Copy Markdown
Contributor

orduno commented Oct 24, 2019

<robot_namespace>/scan to match what we have on nav2_namespaced_view.rviz

@SteveMacenski
Copy link
Copy Markdown
Member Author

What I'm asking is what is that <robot_namspace> this is a yaml file so you need to specify a specific namespace string for me to use

@orduno
Copy link
Copy Markdown
Contributor

orduno commented Oct 24, 2019

we'll need one per robot, so robot1/scan and robot2/scan

@SteveMacenski
Copy link
Copy Markdown
Member Author

I think you mean /robot1/... so that we're going out to the global namespace?

@SteveMacenski
Copy link
Copy Markdown
Member Author

SteveMacenski commented Oct 24, 2019

@orduno done.

This also has the added benefit of allowing a user to launch multiple heterogenerous (ei completely different robots) if they require unique configuration files.

I usually hate eval but this is a sweet sweet use of it

Edit: Forgot to update the multirobot tests to do this -- one moment

@SteveMacenski
Copy link
Copy Markdown
Member Author

SteveMacenski commented Oct 25, 2019

This PR should be squash merged, battling small python flake issues that only appear in CI. I'll force push a squashed last commit from this garbage but in general this is a small change and shouldn't need more than 1

@SteveMacenski
Copy link
Copy Markdown
Member Author

SteveMacenski commented Oct 25, 2019

@orduno this is ready again for review.

I'm not seeing anything subscribed/published to the global /scan. The test is failing for me locally from signal failure drops in the costmaps, but otherwise it seems fine (for what little that means). I see travis succeeded but it uses the run test suite script that doesn't include multirobot. I added the multirobot test back to travis to see if it passes off my machine. The multirobot CircleCI is failing for the spawn_robot bug so its hard for me to know that this isworking.

So this is probably going to have to sit here until the spawn_robot CI bug is fixed or I can get the stack running on my computer again. That's fine

@SteveMacenski
Copy link
Copy Markdown
Member Author

SteveMacenski commented Oct 25, 2019

Travis also fails on the spawn_robot problem, reverted that commit.

Edit: Thanks to @crdelsey that's all handled now, passing tests 👍

@SteveMacenski
Copy link
Copy Markdown
Member Author

Can I get a couple reviews? I'm passing the multi-robot CI & I'd love it if I didn't have to fix another 5 merge conflicts on this one PR 😿

source_file=rviz_config_file,
replacements={'<robot_namespace>': ('/' + robot['name'])})

params_file = eval(robot['name'] + '_params_file')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we change this to:

params_file = LaunchConfiguration(robot['name'] + '_params_file')

Then we can get rid of the LaunchConfiguration lines above.

Maybe it's just me, but I find the use of eval here difficult to read.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So on first glance I agree with you, but something that came to mind was that since we're doing this eval in a loop, that if someone changes 2 robots to N robots and there aren't N parameter files, you're not going to be able to statically look at the initialization of the launch configurations and see that there are things missing.

If you don't think that's a real problem, I can do that -- I'm just thinking and if there's a bug, some analyzer isn't going to catch that.

@SteveMacenski
Copy link
Copy Markdown
Member Author

Build breaking from branching issue, given it was passing and this is a 1 line change, I'm inclined to push this

@SteveMacenski SteveMacenski merged commit a227539 into ros-navigation:master Nov 3, 2019
savalena pushed a commit to savalena/navigation2 that referenced this pull request Jul 5, 2024
…#1214)

* cleanup all globally hardcoded remaps for multirobots

* fixing map path

* fix pep8 indent

* linter happy now?

* Fix linter errors

* reincluding /scan on scan

* multirobot launch with unique configurations

* multirobot tests using both configuration files

* make flake8 happy

* flake8 try2

* flakey9

* flake10

* attempt flake exception

* flake11

* flake12

* noqa on lin

* changing launch configuration in loop
Forsyth-Creations pushed a commit to Forsyth-Creations/navigation2 that referenced this pull request Feb 19, 2025
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.

Problem of using namespace

2 participants