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

/request_axis_service is taking a long time to respond #26

Closed
yushi-minemura opened this issue Sep 10, 2024 · 2 comments
Closed

/request_axis_service is taking a long time to respond #26

yushi-minemura opened this issue Sep 10, 2024 · 2 comments

Comments

@yushi-minemura
Copy link
Contributor

yushi-minemura commented Sep 10, 2024

Hello @samuelsadok,

I am using the odrive_can_node to rotate the botwheel. By starting the odrive_can_node and executing ros2 service call /request_axis_state odrive_can/srv/AxisState "axis_requested_state: 8", I was able to change to CLOSED LOOP mode. However, there was a delay of about 1 second in the response of the service after execution.

Upon checking the source code at

(std::chrono::steady_clock::now() - call_time >= std::chrono::seconds(1)); // wait for minimum one second
, I noticed that there is a 1-second wait process, and I believe this might be the cause of the delay.

Is the 1-second wait here because it takes 1 second for the response to be correct? Would it be difficult to change the axis_state without waiting for 1 second?

Best regards

@samuelsadok
Copy link
Member

This is due to a limitation with the protocol which boils down to the fact that the status+error response ("heartbeat") doesn't echo a sequence number or similar. As a consequence, we don't know if a given status+error response was emitted before or after the request went through, and the ROS node could be returning the wrong result if it doesn't ignore too early responses. Note that the request could be delayed due to bus congestion, while the heartbeat is normally sent every 100ms.

The one second delay is a workaround for this, since it's unlikely that the request would be delayed by one second or more. You can probably reduce this and still get reliable results. However to fix it properly, a protocol change is required which we didn't get to yet. I'll make a note to revisit this.

@yushi-minemura
Copy link
Contributor Author

Thank you for your response.

I now have a better understanding of the current situation, and I look forward to seeing improvements in this matter.

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