-
Notifications
You must be signed in to change notification settings - Fork 119
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
Question about timeout parameter of rmw_uros_ping_agent function #1551
Comments
The first parameter is the maximum time that the ping can take. So for example if there is no agent found, this call will take take this number of milliseconds.
Yes, the function will return as fast as the agent responds to the ping. The 100 ms is the maximum amount of time allowed for the ping operation.
Just reduce the timeout in order to provide a smaller time window to perform the ping operation. |
thank you. Thanks, it was helpful. (reconnection example : https://github.com/micro-ROS/micro_ros_arduino/blob/humble/examples/micro-ros_reconnection_example/micro-ros_reconnection_example.ino) In the reconnection example, if EXECUTE_EVERY_N_MS(200, state = (RMW_RET_OK == rmw_uros_ping_agent(100, 1)) ? AGENT_CONNECTED : AGENT_DISCONNECTED;); is set in the EXECUTE_EVERY_N_MS function, |
Every 200 ms it will try to ping the agent for a maximum time of 100 ms. |
oh! I misunderstood. Thanks for your help. Close the issue. |
Issue template
Steps to reproduce the issue
(1) Code Behavior Description
micro-ros_reconnection_example example code
(examples/micro-ros_reconnection_example/micro-ros_reconnection_example.ino)
https://github.com/micro-ROS/micro_ros_arduino/blob/humble/examples/micro-ros_reconnection_example/micro-ros_reconnection_example.ino
Question about the Timeout parameter when using the rmw_uros_ping_agent function in the following example code:
Q1 : While testing the program, it seems that when using the rmw_uros_ping_agent function, a delay occurs as much as the number in the first parameter, the timeout parameter. Is my understanding correct?
Q2 : When timeout is set to 100 in the rmw_uros_ping_agent function, when ping with the agent is successful faster than 100msec, what is the delay of 100msec? Or is it possible to escape the function faster than that?
Additional question: If the function set in the second question is implemented so as not to escape quickly, is there a way to reduce the delay?
Expected behavior
To operate the micro-ros_reconnection_example example code.
To understand the rmw_uros_ping_agent function in the micro-ros_reconnection_example example code and operate it to minimize delay.
Actual behavior
Additional information
The text was updated successfully, but these errors were encountered: