-
Notifications
You must be signed in to change notification settings - Fork 8
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
Feature/ros2 #40
Feature/ros2 #40
Conversation
32b81ea
to
3f044fd
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.
Looks great! Really like the new features of contexts and CLI!
* @param argc Number of command line arguments | ||
* @param argv Command line argument strings | ||
*/ | ||
YAML::Node loadFromArguments(int& argc, char* argv[], bool remove_args); |
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.
Nice!
@@ -13,6 +13,7 @@ | |||
<license>BSD-3-Clause</license> | |||
|
|||
<buildtool_depend>cmake</buildtool_depend> | |||
<depend>yaml-cpp</depend> |
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.
good catch!
* @param argv Actual command line arguments. | ||
* @param remove_arguments Remove parsed command line arguments. | ||
*/ | ||
void initContext(int& argc, char* argv[], bool remove_arguments = true); |
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.
Nice! I like this version of (process-) global configs!
config_utilities/src/commandline.cpp
Outdated
YAML::Node node; | ||
std::filesystem::path file(filepath); | ||
if (!fs::exists(file)) { | ||
// TODO(nathan) log instead of manual print |
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.
Could just import the conf_utils (abstract) logger?
auto& context = instance(); | ||
auto node = YAML::Clone(other); | ||
moveDownNamespace(node, ns); | ||
// default behavior of context is to act like the ROS1 param server and extend sequences |
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.
Like this! I assume the previous implementation was not extending sequences? I would have thought the recursive implementation would do that (or maybe only maps, not lists).
@@ -4,6 +4,8 @@ This tutorial explains how to create configs and other objects from source data. | |||
**Contents:** | |||
- [Parse from yaml](#parse-from-yaml) | |||
- [Parse from ROS](#parse-from-ros) | |||
- [Parse from the command line](#parse-from-the-command-line) |
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.
Awesome to add docs!
@Schmluk will follow up with you in person later, but was tired of having this half-done in perpetuity. Went a slightly different way than I was originally intending after digging into the the ROS2 launch file parsing infrastructure and as a result implemented something that is in no way tied to ROS2 😅 (but it seems like a useful paradigm even when developing without ROS). Developed the current solution with this as a working example.
Still might need to add a few more tests and think about how logging will function, but hopefully opening this will be a good forcing function for me to finish it.