-
Notifications
You must be signed in to change notification settings - Fork 11
YAMLParser: Some minor fixes/additions #5
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
base: master
Are you sure you want to change the base?
Conversation
Added another commit,
|
|
@YaseenAlk Thanks a lot for your PR! The YAMLParser (whyever it was called that - it should be renamed to MessageGenerator or similar) is really the place that still requires significant improvements. So any help here is really appreciated. I will review in detail and integrate it when I find a free slot. |
Thanks for the ref to natemcmaster/CommandLineUtils. I was not aware that MSFT stopped dev of that very popular extension, very crazy decision to drop support for a package with >4 mio nuget installs... I think it would make sense fo upgrade to the follow-up community fork. But may I ask again what did not work for you? I just tested specifying the |
|
I may have been using |
I had originally made a PR on
uml-robotics/ROS.NET, which included a couple of the commits in this PR. But then I found this fork, and I realized that I was rewriting code that you guys have been rewriting for 2 years! 😝 So this PR includes differences that I found between my own fork and this one. Feel free to cherry-pick any commits you find useful.Specific details to follow:
Commit 1:
YAMLParser: Fix some character escaping for string constantsCommit 5:
YAMLParser: (experimentation) Allow strings to be constantsCommit 6:
YAMLParser: (attempt to) Fix KnownStuff.WhatItIs bugCommit 7:
Merge code to sort messages by priorityI'm not sure if it is common practice to use string constants in ROS. But regardless, in its current state, YAMLParser had some issues parsing the following lines in one of my .msg files:
Commit 1fixes character escaping for this specific case. ButCommit 1also breaks resolving for certain messages (for example, the fieldfilenameincommon_msgs/map_msgs/SaveMapdoesn't resolve its type properly).Commit 6fixes this by checking if the left-side of the/has been a resolved package name.Commit 7(which I merged fromuml-robotics/ROS.NET/master) sorts the msg file queue by priority, ensuring thatstd_msgs/geometry_msgs/actionlib_msgsare resolved first, which should hopefully increase the success rate ofCommit 6.Commit 5comments out some old code that the original author had, which made string constants non-static. I personally prefer string constants to be static, so I commented the lines out. Feel free to skip this commit if not interested.Note: I kept strings
constinstead ofstatic readonlybecause I needed them to be processed at compile-time for my own use case.Commit 2:
YAMLParser: temp workaround to allow multiple arguments in -mI think the
CommandLineUtilslibrary cannot actually support multiple arguments? Either that, or I was too dumb to figure it out. I tried many combinations of commas, quotes, and spaces, but it just kept combining them into oneValue. I added a temporary workaround, but the bug needs some type of intervention in the future. Perhaps this updated version might work better?Commit 3:
YAMLParser: expand list of CSharpKeywordsCommit 4:
YAMLParser: Add check to ensure pkgs/fields will be valid C# identifiersCommit 3expands the list of CSharpKeywords to include every keyword listed on Microsoft's website.Commit 4checks the package and field names of every message folder to make sure that they would work as valid identifier names in C#. (For example, if you had a folder namedtest-msgs, or if the name were in a different language, then YAMLParser would still run successfully, but the autogenerated code would not build)Commit 8:
YAMLParser: Ensure Messages.dll has parsed required ROS packages for libCommit 9:
YAMLParser: comment out actionlib_msgs from required_packages checkCommit 8ensures that required message packages (std_msgs, etc) were included in the args. In instances where they were not included, I have run into 2 distinct issues:Headercannot resolve in the MD5 hash, so the code autogeneration gets stuck in an infinite loopusingstatements from the template:Commit 9comments outactionlib_msgsfrom therequired_packagesarray, because it is not included incommon_msgs, and the autogenerated code seems to build without it...Thank you!