Skip to content

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.

@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
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.

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.

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.

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.

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_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 <[email protected]>
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)

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
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

3 participants