Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3732 +/- ##
==========================================
- Coverage 62.09% 62.08% -0.00%
==========================================
Files 385 385
Lines 32743 32746 +3
==========================================
Hits 20327 20327
- Misses 12416 12419 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rhaschke
left a comment
There was a problem hiding this comment.
While the fix will solve the described issue, I don't yet see why the issue occurs in first place. Shouldn't this code snippet in addController() avoid duplicate controller names in first place:
https://github.com/moveit/moveit/blob/26716fabb765bcbebeac8ff059da33bc255ca461/moveit_setup_assistant/src/tools/moveit_config_data.cpp#L1957-L1961
Also, why are duplicate controller names an issue at all? The YAML looks like this:
controller_list:
- name: ...
type: ...
joints: [...]
- name: ...
type: ...
joints: [...]This is a list of maps.
I think it would be more important to have such a fix for outputROSControllersYAML(), which generates a YAML of the following structure:
<name 1>:
type: ...
joints: [...]
<name 2>:
type: ...
joints: [...]So, please, describe your original issue in more detail. How to reproduce it?
| if (!written_checker.insert(controller.name_).second) | ||
| continue; |
There was a problem hiding this comment.
This should be moved to line 971, because only there we really attempt to write the config.
There was a problem hiding this comment.
Yeah, you're right
- if (!written_checker.insert(controller.name_).second)
-
continue;
Should be moved inside the if (type == "FollowJointTrajectory" || type == "GripperCommand") statement marking it when we actually need to output it.
The addController() suppose to check and prevent duplicate controller name however since controller could be loaded in from existing files, or added through other path it could bypass the check. Therefore the configs could still contain duplicates name leading to ambiguous configuration when generating since it expect each of the controller name to be unique.
|
I just noticed that you linked the issue moveit/moveit2#3434. However this refers to MoveIt2! With which MoveIt version do you actually have issues? |
|
@yonteels, please comment on #3732 (review) and #3732 (comment). |
This PR fixes a bug in outputSimpleControllersYAML() where duplicate YAML keys (action_ns and default) were being generated for the same controller entry when processing controller_configs_ #3434 .
When generating the simple controllers YAML, controllers could be written multiple times, resulting in duplicated fields
In order to fix this I Added a std::setstd::string to track which controllers have already been written.
Thereby skipping duplicate controller entries using the if case:
if (!written_checker.insert(controller.name_).second)
continue;