-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Rewrite the scan topic costmap plugins for multi-robot(namespace) before launch navigation. #3572
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
Rewrite the scan topic costmap plugins for multi-robot(namespace) before launch navigation. #3572
Conversation
1a64d01 to
bbbe990
Compare
hyunseok-yang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SteveMacenski I'm not 100% sure if this kind of approach is aligned to what you thinking.
How does it look like?
|
@hyunseok-yang, your PR has failed to build. Please check CI outputs and resolve issues. |
|
@hyunseok-yang if you look at the current multirobot setup - it uses the parent-most launch file to enable the multi-robot behavior. I'm suggesting doing the same thing so it doesn't impact any of the single robot stuff and that both of the multirobot "modes" (using 1 config file vs N config files) look analogous to each other. So I'm suggesting you create a new multirobot launch file from the current one and adjusting it to use 1 config file (with a new config file with that namespace substitution for the sensor data) and perform the substitution there. Then provide the already substituted configuration to the other nested launch files that they they (e.g navigation.launch.py) don't need to know anything about what happened above it |
@SteveMacenski I will let you check soon. |
bbbe990 to
ff8abf8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SteveMacenski
How about this? I guess this kind of approach is quite straighforward and simple.
The user who wants to run whichever single or multi robot can luanch it intuitively.
ae05fae to
0454f04
Compare
afe7581 to
f431e75
Compare
|
I just pushed new commit. @SteveMacenski |
|
I think we're going in circles here a bit - I don't think this should need so many rounds of editing. You're looking to add a method to do multirobot launching using 1 params file and I agree that's valuable. We have already a multirobot launch file that uses What I'm looking for is basically for you to add that exact same launch file but modified for the needs of 1 param file instead of N param files (e.g. your text substitution and reading in a single params file). If you want to change the way we handle multirobot for your 1-param-file multirobot launch method, you should change the N-param-file multirobot launch method to match so that they're exact analogs except for the necessary and exact changes between them to enable them. Consistency is really important. But, I don't think you really should need to change much other than reading in the single param file + adding in the text substitution for the Agree? |
Right, it looks we're going there and here. It is too simple but I guess there was misunderstanding during our discussion. In terms of the comment you mentioned that it is redundant above, my first thought was just let's separate two functionality 'applying namespace(replace substitution)' and 'iterating number of robots'. The functionality of 'iterating number of robots' shall apply the number trailing the namespace(as a prefix). Let me summarize what we need to be on same page.
@SteveMacenski |
Oh I don't disagree with you, but I think though that these things are usually (but not always) related. For the most part, there's not really much incentives to throw all of Nav2 into a namespace when there's only 1 robot running on a system/domain ID. I'm not saying it doesn't happen, but its a less common thing. And in that case, they could still just hardcode the namespace for the sensor topics and really not be a problem. Its only a scaling problem when we're talking about The more I think about it, the more I generally agree that adding that
Yes! On the same page 😄 |
Like you mentioned, it is better to separate PRs. Then I'd like to modify a bringup launch file on this PR if you don't mind. I would just add only below section just after rewrite the param yaml file. configured_params = RewrittenYaml(
source_file=params_file,
root_key=namespace,
param_rewrites={},
convert_types=True)
# '<robot_namespace>' keyword shall be replaced by 'namespace' launch argument
# in config file 'nav2_namespaced_params.yaml' as a default.
# User defined config file should containe '<robot_namespace>' keyword
# for the proper parameter wherever you want to get parameters thet namespace applied.
namespaced_replaced_params_file = ReplaceString(
source_file=params_file,
replacements={'<robot_namespace>': (namespace)})oh, and new params file will be added too. => This will not affect any side-effect for the user who want to bring up just 1 robot or new beginners. We need to handle scaling |
f431e75 to
d2979c2
Compare
... close enough 🙃 That change for the normal bringup is what I wanted in another PR since this PR's description + title is about multirobot. So this PR should have the multi-robot changes too - which you have the yaml file, but not the other launch file anymore. So I'm OK with you putting the change in How about the for the multirobot file naming we do |
Now, we don't need to touch the
Sure, that's good idea. |
d2979c2 to
6947321
Compare
Correct. We can call everything in this PR right now as good.
Correct, because now you have a param file with that Sorry we're missing each other so much on this PR, next time will be easier, I promise 😄 |
Ok. that's good to hear 😄
With latest commit, as you can see, the current change in 'bringup_launch.py' shall replace that keyword. So if the new parameter which have Anyway, this one also will be updated soon. But it needs to take some trick how to looping the number of robots.
No problem not at all. These kind of discussions are always required to head to a right way! Pleasure to have a talk✌️ |
I don't quite follow you. But what you change does is if if
If you have |
Oh, I just talked and asked like above because you said "now you have a param file with that which is not currently being used anywhere". BUT, I guess that was a lack of my explanation or mis-understanding. (Sorry for that 🥲) What you desribed is expected scenario(Yes, your're right). Then, I will leave the 'bringup_launch.py' as it is on my last commit(6947321)
It would be great if configured_params = ReplaceString(
condition=IfCondition(PythonExpression(['not ', namespace])),
source_file=configured_params,
replacements={'<robot_namespace>': ('/', namespace)})Or, just give a guidance as a comment do not use the param file which have substitutions like
Next job I have to do is iterating That's why I've utilized a |
|
Just tried if And, accordint to these document. It's not allows 😩 must not be empty, e.g. the name //bar is not allowed |
Can't you use the same
|
I'd really like to use the If not, it would be better to leave a note like you mentioned.
Then I guss I need to modify ReplaceString method also. |
Please review this PR. :) |
82ed0cc to
edc68a7
Compare
|
Just merge those grammatical fixes into your branch + the linting failures and we can merge this! I'd merge those grammatical changes in myself, but your branch appears to be protected |
I added your suggestion into commit now. |
|
Still have the linting errors: https://app.circleci.com/pipelines/github/ros-planning/navigation2/9881/workflows/2fb30bf2-57ed-47df-92cd-dfa0d232ae79/jobs/31563/tests That's the only thing blocking! |
hm, :( |
…espace>` to namespace. - It allows to apply namespace automatically on specific target topic path in costmap plugins. Add new nav2 params file for multi-robot(rewriting `<robot_namespace>`) as an example. - nav2_multirobot_params_all.yaml Modify nav2_common.ReplaceString - add condition argument
Co-authored-by: Steve Macenski <[email protected]>
Rename luanch script for multi-robot simulation bringup Add new nav2_common script - Parse argument - Parse multirobot pose Update README.md
Oh, I only checked ament_flake8 Here's the result for ament_pep257 after fixed. |
Apply suggestions from code review Fix pep257 erors Co-authored-by: Steve Macenski <[email protected]>
ff828b8 to
2580f1a
Compare
|
Great!! Happy to have this in finally 🙂 |
Basic Info
Description of contribution in a few bullet points
This changes make it more convinient to manage nav2_params.yaml file for multi-robot environment and easy to launch the navigation.
According to latest guideline, each robot requires different nav2_param files since absoulte path of topic ifor scan is required in local_costmap/global_costmap node.
if we set the topic name without slash'/' like 'scan', rclpp node will add prefix automatically for example ,
local_costmap/local_costmap/scan. So we should specify absoulute path such as/scanor/namespace/scanBut, the code I suggested will rewrite the value for the key 'topic:'.
As far as I know, 'topic' key is only used for costmap plugins
I think this changes quite make sense. :)
Description of documentation updates required from your changes
For multi-robot launch, it should be launched with namespace leading prefix '/'.
This shall try to subscribe
local_costmap/local_costmap/acloi00/scan.So the guideline for mutli-robot bringup should be noticed.
Future work that may be required in bullet points
First time when I faced this inconvenient environemnt, I'd like to describe the 'param_rewirtes' like this.
{'local_costmap.local_costmap.ros__parameters.*.*.topic': (namespace,'/scan')}I tried to modify RewrittenYaml() class what I thougt and expected but gave up :) because I''m not familiar with this class.
For Maintainers: