-
Notifications
You must be signed in to change notification settings - Fork 163
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
Calculate type hash from TypeDescription (rep2011) #1027
Calculate type hash from TypeDescription (rep2011) #1027
Conversation
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.
I've left a few suggestions for improvement inline, along with some questions.
Besides that, this PR should be retargeted to rolling
, which is our default branch. Also, this can't be merged until we merge in the type_description_interfaces
package.
Changed the base branch, Yes, I've marked the dependency in the description - though github doesn't understand that language, it has only the "closes" behavior semantic for cross-linking issues. Addressing other comments shortly. |
Thanks. Yeah, it would be nice if we could express these dependencies in GitHub somehow. The good news is that this will totally fail to compile in CI until |
OK - I think I've addressed everything. I appreciate the feedback, round 2 welcome :) |
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.
Overall, I love this new structure; so much better than the macros. Thanks for taking the time to investigate this!
I've left a couple of minor comments inline; otherwise, I think this is ready to go modulo getting the type_description_interface
package in.
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.
This looks good to me! We should discuss how to get ros2/rcl_interfaces#146 landed.
ca813b1
to
024c4c5
Compare
024c4c5
to
d5cae44
Compare
Moving this back to draft while working out the type hash struct - which this calculator should also provide |
0ffcc0f
to
96a8486
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.
I left a few more nits to fix here, otherwise looks pretty good to me.
30144b6
to
ade7055
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.
other than the implicit dependency on libyaml, this lgtm
rcl/include/rcl/type_hash.h
Outdated
* the JSON representation of type_description. Note that output_repr will have a | ||
* terminating null character, which should be omitted from hashing. To do so, use | ||
* (output_repr.buffer_length - 1) or strlen(output_repr.buffer) for the size of data to hash. | ||
* \return RCL_RET_OK on success, RCL_RET_ERROR if any problems occur in translation |
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.
nitpick: you might want to have a look at how the other rcl functions document return types, I think they use one per \return
and wrap the return types in `RCL_RET_...`
for a reason, but I can't remember them off-hand. Thought I do think it's best to just emulate them.
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.
Done (they use
\return #RCL_RET_... for reason, or
\return #RCL_RET_... for a final reason, period.
so I did that
|
||
#include <stdio.h> | ||
|
||
#include <yaml.h> |
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.
This concerns me, I think it's coming in implicitly through rcl_yaml_param_parser
. I actually don't love depending on libyaml from rcl proper like this, though the effect is the same as the current situation, since we hard depend on the yaml stuff in rcl_yaml_param_parser
.
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.
I don't think we should do something different, I think we should use libyaml, but I do think we need to explicitly depend on libyaml, via package.xml and CMake.
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.
Done
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
9245a40
to
febd2ff
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.
Two small comment updates, then this looks good to me.
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Gist: https://gist.githubusercontent.com/emersonknapp/ff276a843492f27fd1afac2806fdb849/raw/e273147f65788680698e21401ce10184f120cdfd/ros2.repos |
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Gist: https://gist.githubusercontent.com/emersonknapp/e163a4a54a5fa58279b131748d54a31b/raw/e273147f65788680698e21401ce10184f120cdfd/ros2.repos |
FYI, windows build is failing with:
We might need an extra export or something? Not sure. |
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
I noticed that the other project using this dependency, |
I almost think it is worth it, but there is enough going on here that we can punt it. Assuming what you did already fixes the problem for now, I'll do a follow-up where we switch to |
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
* Convert TypeDescription to YAML and hash Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com> Signed-off-by: Hans-Joachim Krauch <achim.krauch@gmail.com>
* Convert TypeDescription to YAML and hash Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Related to ros-infrastructure/rep#358
Part of ros2/ros2#1159
Depends on ros2/rosidl#729
This PR introduces a utility function to provide a stable reproducible hash for
type_description_interfaces/msg/TypeDescription
for use in type comparison/advertising in REP-2011