We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Required Info:
vcs export --exact
Build an rclcpp executable with the following code
#include <string> #include "rclcpp/rclcpp.hpp" int main(int argc, char ** argv) { rclcpp::init(argc, argv); std::string node_name = "initial_params_node"; std::string namespace_ = "/"; auto node = rclcpp::Node::make_shared(node_name, namespace_); rclcpp::spin(node); rclcpp::shutdown(); return 0; }
Run the following python code (change the hardcoded path to initial_params_rclcpp to the above binary)
from rcl_interfaces.srv import GetParameters import rclpy import subprocess import threading import time rclpy.init() node = rclpy.create_node('tests_yaml') def background_spin(node): while rclpy.ok(): # workaround ros2/rclpy#188 rclpy.spin_once(node, timeout_sec=time.sleep(0.25)) try: # Keep an executor running in the background thr = threading.Thread(target=background_spin, args=(node,), daemon=True) thr.start() while True: print('start loop') proc = subprocess.Popen(['/workspace/ros2-dev0/build/test_cli/initial_params_rclcpp', '__node:=listener']) # Using the listener node instead fixes the issue # proc = subprocess.Popen(['ros2', 'run', 'demo_nodes_cpp', 'listener']) try: # print('about to create client') client = node.create_client(GetParameters, '/listener/get_parameters') # print('about to wait for service') client.wait_for_service() # Sleeping here fixes the issue # time.sleep(1) # print('about to send service request') request = GetParameters.Request() request.names = ('use_sim_time',) client.call(request) # print('about to destroy client') node.destroy_client(client) finally: # print('about to kill subprocess') proc.kill() finally: node.destroy_node() rclpy.shutdown()
start loop would be printed forever
start loop
start loop prints twice. The program is forever waiting in the second invocation of client.call(request)
client.call(request)
ros2/system_tests#274 (comment)
The text was updated successfully, but these errors were encountered:
Possibly related to ros2/rmw_fastrtps#205
Sorry, something went wrong.
No branches or pull requests
Bug report
Required Info:
vcs export --exact
https://gist.github.com/sloretz/fa3f96d81cb1a7b479309fdf26566e14Steps to reproduce issue
Build an rclcpp executable with the following code
Run the following python code (change the hardcoded path to initial_params_rclcpp to the above binary)
Expected behavior
start loop
would be printed foreverActual behavior
start loop
prints twice. The program is forever waiting in the second invocation ofclient.call(request)
Additional information
ros2/system_tests#274 (comment)
The text was updated successfully, but these errors were encountered: