Skip to content

[YAML Parser] Depend on rcutils only - #470

Merged
hidmic merged 2 commits into
masterfrom
hidmic/use-rcutils-on-yaml-parser
Jul 12, 2019
Merged

hidmic merged 2 commits into
masterfrom
hidmic/use-rcutils-on-yaml-parser

Conversation

@hidmic

@hidmic hidmic commented Jul 5, 2019

Copy link
Copy Markdown
Contributor

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

@hidmic
hidmic requested review from mikaelarguedas and wjwwood July 5, 2019 20:35
@hidmic hidmic changed the title Make rcl_yaml_param_parser depend on rcutils only [YAML Parser] Depend on rcutils only Jul 5, 2019

@ivanpauno ivanpauno left a comment

Copy link
Copy Markdown
Member

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.

rcl_params_t * params_st);

/// \brief Print the parameter structure to stdout
/// \brief Print the parameter structure to

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread rcl_yaml_param_parser/src/parser.c Outdated
break;
default:
res = RCL_RET_ERROR;
ret = RCUTILS_RET_OK;

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread rcl_yaml_param_parser/src/parser.c Resolved
Comment thread rcl_yaml_param_parser/src/parser.c Resolved
Comment thread rcl_yaml_param_parser/src/parser.c Outdated
if (NULL == value) {
RCUTILS_SET_ERROR_MSG("event argument has no value");
return RCUTILS_RET_INVALID_ARGUMENT;
}

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread rcl_yaml_param_parser/src/parser.c Outdated
if (NULL == value) {
RCUTILS_SET_ERROR_MSG("event argument has no value");
return RCUTILS_RET_INVALID_ARGUMENT;
}

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread rcl_yaml_param_parser/src/parser.c Resolved
Comment thread rcl_yaml_param_parser/src/parser.c Outdated
RCL_SET_ERROR_MSG("YAML file path is NULL");
RCUTILS_SET_ERROR_MSG("YAML file path is NULL");
return false;
}

Copy link
Copy Markdown
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
Copy Markdown
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 <[email protected]>

@ivanpauno ivanpauno left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! (with green CI)

RCUTILS_SET_ERROR_MSG_WITH_FORMAT_STRING(
"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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

hidmic commented Jul 10, 2019 •

Copy link
Copy Markdown
Contributor Author

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

hidmic commented Jul 11, 2019

Copy link
Copy Markdown
Contributor Author

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

@hidmic

hidmic commented Jul 12, 2019

Copy link
Copy Markdown
Contributor Author

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