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

AsyncParametersClient stacks in get parameter #192

Open
fafux opened this issue Apr 13, 2023 · 3 comments
Open

AsyncParametersClient stacks in get parameter #192

fafux opened this issue Apr 13, 2023 · 3 comments

Comments

@fafux
Copy link

fafux commented Apr 13, 2023

OS: Ubuntu 20.04
ROS Distro: Foxy
Gazebo version: 11.12.0

Hi all,
I launch a Gazebo simulation with the joint state broadcaster and everything works.
Once I try to load my own controller, this stacks in the function "on_configure()" in which it tries to get a parameter. If I try to get the same parameter from the command line it works. Below, you can find the part of the code in which the controller stacks.

std::shared_ptr<rclcpp::AsyncParametersClient> parameters_client = std::make_shared<rclcpp::AsyncParametersClient>(get_node(), "/robot_state_publisher");
parameters_client->wait_for_service();
auto param = parameters_client->get_parameters({"robot_description"}).get();

It stacks in ".get()". The same code works without Gazebo.
I replicated the same error just adding the three lines of code to the example_position right after the declaration of the ros node substituting "get_node()" with "node". Also in this case stacks.

@bmagyar
Copy link
Member

bmagyar commented Apr 13, 2023

By "stacks" you mean "gets stuck"?

@fafux
Copy link
Author

fafux commented Apr 13, 2023

Yes sorry for the typos.

@fafux
Copy link
Author

fafux commented Jul 21, 2023

Do you have any update on this?
The problem is that I expect the robot_description to be a parameter of the controller_manager but it's not. I want to access from a custom ros2 controller to the robot_description. Since it's not a parameter of the controller manager, the only way to access it is from a client (both service or parameter). In both cases, waiting the response of the future blocks the execution.

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

No branches or pull requests

2 participants