-
Notifications
You must be signed in to change notification settings - Fork 125
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
Add is_message trait in support of tf2 conversions #412
Conversation
It would be good to add similar traits for services and actions. |
@@ -0,0 +1,85 @@ | |||
@# Included from rosidl_generator_cpp/resource/idl__traits.hpp.em |
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.
Does the resource/idl__traits.hpp.em
template need to be updated in order to include this new file?
Also the test doesn't cover actions yet which based on the above seems to be broken.
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 does.
Also, because action generation depends on action_msgs
, it's likely going to have to reside in a higher package. I discussed with @jacobperron, and I'm going to move forward with putting the trait tests in rclcpp_action
, unless there is another alternative.
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.
Why can the is_action
trait not be tested in this package? The <action>__traits.hpp
doesn't require any other includes.
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.
We can't build test action interfaces in rosidl_generator_cpp
because of a circular dependency on action_msgs
. Unless we can test is_action
without generating an action, we'll have to wait until we remove the circular dependency to add tests to this package.
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.
LGTM (with green CI)
@@ -0,0 +1,85 @@ | |||
@# Included from rosidl_generator_cpp/resource/idl__traits.hpp.em |
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.
We can't build test action interfaces in rosidl_generator_cpp
because of a circular dependency on action_msgs
. Unless we can test is_action
without generating an action, we'll have to wait until we remove the circular dependency to add tests to this package.
|
||
TEST(Test_rosidl_generator_traits, is_message) { | ||
// A message is not a service | ||
ASSERT_TRUE(is_message<rosidl_generator_cpp::msg::Empty>()); |
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.
nit: using EXPECT_*
instead, we'd see multiple failures instead of just the first to fail.
Signed-off-by: Michael Carroll <michael@openrobotics.org>
Additionally add tests for message and service traits Signed-off-by: Michael Carroll <michael@openrobotics.org>
Signed-off-by: Michael Carroll <michael@openrobotics.org>
Signed-off-by: Michael Carroll <michael@openrobotics.org>
Signed-off-by: Michael Carroll <michael@openrobotics.org>
Signed-off-by: Michael Carroll <michael@openrobotics.org>
ec76bd6
to
4fc81a9
Compare
Restores the
IsMessage
trait from ROS1message_traits
.This will simply be a true value for things that are messages and false otherwise.
ROS1 Ref: https://github.com/ros/roscpp_core/blob/kinetic-devel/roscpp_traits/include/ros/message_traits.h#L111
Signed-off-by: Michael Carroll michael@openrobotics.org