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

Add smoke test adapted from ROS 1 smoke test #585

Merged
merged 6 commits into from
Aug 12, 2021

Conversation

jtbandes
Copy link
Member

Re-enable the smoke test from develop on the ROS 2 branch.

  • Uses launch_testing instead of a .test xml file.
  • The server now allows choosing port:=0 to select an ephemeral port, and sets the port number in the actual_port ROS param (similar to the Autobahn server implementation on develop). The test uses the GetParameters service to retrieve the port number.

I used various tricks to get async/await working in the test. This was difficult because rclpy has its own executor that doesn't interoperate with other event loops (like twisted or asyncio). Since the test uses both ROS publishers/subscribers and a Twisted WebSocket client, both event loops are needed, so I ran rclpy.spin_until_future_complete in a thread managed by Twisted. Mostly this worked nicely, but required care to use reactor.callFromThread in certain places, and required some explicit executor.wake() since the rclpy executor didn't automatically wake up when futures were resolved.

@jtbandes jtbandes merged commit 0751df3 into RobotWebTools:ros2 Aug 12, 2021
@jtbandes jtbandes deleted the jacob/smoke-test branch August 12, 2021 21:55
@jtbandes jtbandes mentioned this pull request Aug 12, 2021
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.

None yet

1 participant