Skip to content
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

Demo nodes cpp native #164

Merged
merged 1 commit into from
Aug 25, 2017
Merged

Demo nodes cpp native #164

merged 1 commit into from
Aug 25, 2017

Conversation

dirk-thomas
Copy link
Member

Demonstrate how to access the RMW specific native handles exposed in ros2/rmw_fastrtps#145 and ros2/rmw_fastrtps#146.

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status
    • The Windows linker fails to find libfastrtps-1.5.lib. According to the linked rmw_fastrtps_cpp_LIBRARIES it is supposed to link against C:/J/workspace/ci_windows/ws/install/fastrtps/lib/fastrtps-1.5.lib. I don't see where the additional lib prefix is coming from (the file itself exists but the linker probably doesn't know where to find it). Any ideas what is going wrong here would be appreciated.

@dirk-thomas dirk-thomas added the in progress Actively being worked on (Kanban column) label Aug 23, 2017
@dirk-thomas dirk-thomas self-assigned this Aug 23, 2017
string(REPLACE ";" "_" exe_list_underscore "${tutorial_executables}")
configure_file(
test/test_executables_tutorial.py.in
test_${exe_list_underscore}${target_suffix}.py.configured
Copy link
Member

Choose a reason for hiding this comment

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

Where does target_suffix come from?

<buildtool_depend>ament_cmake</buildtool_depend>

<build_depend>rclcpp</build_depend>
<build_depend>rmw_implementation_cmake</build_depend>
Copy link
Member

Choose a reason for hiding this comment

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

What is this dependency used for (I didn't see it being used in the cmake code)?

<build_depend>std_msgs</build_depend>

<exec_depend>rclcpp</exec_depend>
<exec_depend>rmw_implementation</exec_depend>
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed too? I see it in the other demos, but shouldn't this be provided transitively by rclcpp (I don't see this package uses it directly)?


<exec_depend>rclcpp</exec_depend>
<exec_depend>rmw_implementation</exec_depend>
<exec_depend>rosidl_default_runtime</exec_depend>
Copy link
Member

Choose a reason for hiding this comment

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

Again, shouldn't this be brought in implicitly by the message packages this package depends on (like std_msgs in this case)? Put another way, if this package did not use messages would you depend on this package?



def setup():
os.environ['OSPL_VERBOSITY'] = '8' # 8 = OS_NONE
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed?

exit_handler = ignore_exit_handler
exit_on_match = False

filtered = get_default_filtered_prefixes() + [b'service not available, waiting again...']
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this package uses services?

rcl_node_t * rcl_node = node->get_node_base_interface()->get_rcl_node_handle();
rmw_node_t * rmw_node = rcl_node_get_rmw_handle(rcl_node);
eprosima::fastrtps::Participant * p = rmw_fastrtps_cpp::get_participant(rmw_node);
printf("eprosima::fastrtps::Participant * %zu\n", reinterpret_cast<size_t>(p));
Copy link
Member

Choose a reason for hiding this comment

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

Does this actually prove anything? Maybe it would be better to call a function on the participant, something like getting the name out of it or the entity id? Then at least you know the pointer is valid.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it is sufficient to check that we get a valid pointer to a FastRTPS specific type.

I updated the regex to ensure that the received pointer is not 0 - otherwise the test would also pass for that case.

@dirk-thomas
Copy link
Member Author

dirk-thomas commented Aug 24, 2017

I addresses all of the other comments by basically removing the pointed out part since it was copy-n-pasted from another demo package. Sorry for the noise and not cleaning it up earlier.

@dirk-thomas
Copy link
Member Author

Together with the workaround from ros2/rmw_fastrtps#148 this demo finally works on Windows:

CI builds with FastRTPS only:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

CI builds with both FastRTPS and Connext

  • Linux Build Status
  • macOS Build Status
  • Windows Build Status

CI builds with only Connext

  • Linux Build Status warning addressed in a5fc0bb Build Status
  • macOS Build Status
  • Windows Build Status

A bit extensive on the builds but better be safe than sorry 😉

@mikaelarguedas
Copy link
Member

Is the goal to have this demo only for Fast-RTPS or also have a Connext version of it ?
It may be worth put fastrtps in the name of the package to avoid confusion

@dirk-thomas
Copy link
Member Author

I don't plan to extend this demo to include a Connext example. But it could certainly be added if anyone would like to contribute it. Therefore I wouldn't change the package name either.

@dirk-thomas dirk-thomas merged commit 35d145a into master Aug 25, 2017
@dirk-thomas dirk-thomas removed the in progress Actively being worked on (Kanban column) label Aug 25, 2017
@dirk-thomas dirk-thomas deleted the demo_nodes_cpp_native branch August 25, 2017 02:45
@mikaelarguedas
Copy link
Member

I don't plan to extend this demo to include a Connext example. But it could certainly be added if anyone would like to contribute it. Therefore I wouldn't change the package name either.

Maybe a readme could be useful in that case ? explaining what the package does and the fact the it works only for fast-RTPS at the moment

@dirk-thomas
Copy link
Member Author

Maybe a readme could be useful in that case ? explaining what the package does and the fact the it works only for fast-RTPS at the moment

While more information about a package is always helpful most of our other demo packages don't have a README either. The description in the manifest of each package tries to cover the scope / goal / purpose of a package (

C++ nodes which access the native handles of the rmw implemenation.
). Please feel free to create a PR if you think more information is necessary in this case.

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.

3 participants