Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Porting rosapi package. #388
Porting rosapi package. #388
Changes from 3 commits
f9dcf6b
9d6fe34
e6449e8
9665be8
a5b4fec
9cebbc7
afcd59c
63df0a1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
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.
Just a heads up:
_fields_and_field_types
is likely going to be replaced on master soon, see ros2/rosidl_python#33.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.
Thanks for the heads up; I'll keep an eye on that PR and update this code once it's merged.
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.
It seems that in the end it was not replaced (see rosidl_generator_py/_msg.py.em).
It should then be fine to keep this as is.
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.
@jubeira Sorry to dig up this old PR, but I'm having some trouble with a client that calls on this API and I think I've isolated the issue to this spot. It seems as though when
value
is a JSON-encoded string, the later call toget_parameter_value()
sets theParameterValue.string_value
attribute with double-quotes, meaning it's impossible to set a string parameter via this method without double quotes being applied.If the client sends the
value
without JSON encoding, the aboveValueError
is thrown andset_param()
fails altogether.I think inside the
try
block, there could be a linevalue = d if isinstance(d, str) else value
.This would ensure that a valid string object is later passed to
get_parameter_value()
rather than a JSON-encoded one, but otherwise behaviour would stay the same. Would this potentially work?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.
Hi @travipross!
Honestly it's been a while so I'm not sure what the actual consequences of that change could be. Your proposal makes sense but I can't be 100% sure without trying the code.
I'd suggest you to fork the repo, apply the change and check if it works for you. If it does, please feel free to contribute the change with a PR explaining what you did.
Thanks!
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.
Thanks, opened one here: #521