Skip to content
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

[YAML Parser] Depend on rcutils only #470

Merged
merged 2 commits into from
Jul 12, 2019

Conversation

hidmic
Copy link
Contributor

@hidmic hidmic commented Jul 5, 2019

Closes #252. In preparation for pushing parameter parsing (from file and command line arguments) down to rcl.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic hidmic changed the title Make rcl_yaml_param_parser depend on rcutils only [YAML Parser] Depend on rcutils only Jul 5, 2019
Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

I left some minor comments. Besides that, LGTM.

@@ -47,7 +47,7 @@ bool rcl_parse_yaml_file(
const char * file_path,
rcl_params_t * params_st);

/// \brief Print the parameter structure to stdout
/// \brief Print the parameter structure to
Copy link
Member

Choose a reason for hiding this comment

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

Unintended change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeap. Fixed in cf8bff1.

@@ -170,19 +171,19 @@ static rcl_ret_t add_name_to_ns(
sep_str = PARAMETER_NS_SEPERATOR;
break;
default:
res = RCL_RET_ERROR;
ret = RCUTILS_RET_OK;
Copy link
Member

Choose a reason for hiding this comment

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

RCL_RET_ERROR -> RCUTILS_RET_OK ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops. Fixed in cf8bff1.

rcl_yaml_param_parser/src/parser.c Show resolved Hide resolved
rcl_yaml_param_parser/src/parser.c Show resolved Hide resolved
if (NULL == value) {
RCUTILS_SET_ERROR_MSG("event argument has no value");
return RCUTILS_RET_INVALID_ARGUMENT;
}
Copy link
Member

Choose a reason for hiding this comment

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

and here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here it makes sense. Done in cf8bff1.

return RCL_RET_INVALID_ARGUMENT;
if (NULL == value) {
RCUTILS_SET_ERROR_MSG("event argument has no value");
return RCUTILS_RET_INVALID_ARGUMENT;
}
Copy link
Member

Choose a reason for hiding this comment

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

Use RCUTILS_CHECK_FOR_NULL_WITH_MSG

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in cf8bff1.

rcl_yaml_param_parser/src/parser.c Show resolved Hide resolved

if (NULL == file_path) {
RCL_SET_ERROR_MSG("YAML file path is NULL");
RCUTILS_SET_ERROR_MSG("YAML file path is NULL");
return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

Use RCUTILS_CHECK_ARGUMENT_FOR_NULL

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in cf8bff1.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

LGTM! (with green CI)

"The name length exceeds the MAX size %d at line %d", MAX_STRING_SIZE, line_num);
return RCL_RET_OK;
ret = RCUTILS_RET_ERROR;
Copy link
Member

Choose a reason for hiding this comment

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

RCUTILS_RET_ERROR -> RCL_RET_OK?

Copy link
Member

Choose a reason for hiding this comment

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

Reading it again, I think it was wrong before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's what I thought.

@hidmic
Copy link
Contributor Author

hidmic commented Jul 10, 2019

Running CI (up to system_tests to make sure nothing broke downstream):

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@hidmic
Copy link
Contributor Author

hidmic commented Jul 11, 2019

Re-running CI, looks like some code in rclcpp was depending on rcl_yaml_param_parser depending on rcl.

@hidmic
Copy link
Contributor Author

hidmic commented Jul 12, 2019

The sole CI failure on Linux is due to a flake8 complaint on rclpy, which has since been fixed in ros2/rclpy#385.

@hidmic hidmic merged commit f9ceef5 into master Jul 12, 2019
@delete-merged-branch delete-merged-branch bot deleted the hidmic/use-rcutils-on-yaml-parser branch July 12, 2019 14:01
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.

[YAML parser] Be able to use the parser in rcl without circular dependency
2 participants