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

[Polymetis] Reading Gripper (Franka Hand) State Slow #1380

Open
AlexanderKhazatsky opened this issue Oct 7, 2022 · 11 comments
Open

[Polymetis] Reading Gripper (Franka Hand) State Slow #1380

AlexanderKhazatsky opened this issue Oct 7, 2022 · 11 comments

Comments

@AlexanderKhazatsky
Copy link

It seems that reading the gripper state is over 10x slower than reading from the robot state, and I was wondering if it would be possible to get them both on par :)

Extra details: I'm using a robotic gripper

Robot State Reading:
Avg Delay: 0.0021165368556976317
Std Delay: 0.0008280045818800743
Min Delay: 0.000965118408203125
Max Delay: 0.011021852493286133

Gripper State Reading:
Avg Delay: 0.032056391954421996
Std Delay: 0.0017448229778961374
Min Delay: 0.02130889892578125
Max Delay: 0.05079293251037598

@1heart
Copy link
Contributor

1heart commented Oct 7, 2022

image

Seems expected when comparing a 200Hz vs. 1kHz robot. See #756 if you want non-blocking reads.

@1heart 1heart closed this as completed Oct 7, 2022
@AlexanderKhazatsky
Copy link
Author

Hmm so a couple questions:

  1. I can't seem to find a non-blocking read, but I do see non blocking commands
  2. The commands with blocking=Flase still seem to still take a significant amount of time? Usually on the scale of 0.01 seconds. Is this expected?

@AlexanderKhazatsky
Copy link
Author

Similarly, I'm observing that even robot.update_desired_joint_positions takes ~7ms to run. I was under the impression it would be non blocking and pretty much instantaneous?

@exhaustin
Copy link
Contributor

Non-blocking reads does not provide any value as it would be nearly as fast as a blocking read.

Sending non-blocking commands should indeed be quite fast, can you check your ping between the two machines to see if you're being bottlenecked by internet speed? Also, arm commands usually takes a bit longer than gripper commands to send (especially the move_to commands) because it's a bit more complicated to construct the commands.

@AlexanderKhazatsky
Copy link
Author

Definitely not blocked by server speed, ping time is under ~0.5 ms.

Also, actually finding that arm commands are ~3ms faster than gripper commands :)

@AlexanderKhazatsky
Copy link
Author

AlexanderKhazatsky commented Oct 10, 2022

I also have a temp fix of running the commands in a new thread

@exhaustin
Copy link
Contributor

That is interesting, thanks for the detailed info.
We'll try to repro/fix when bandwidth allows, reopening the issue to keep track.
Good to know you have a working fix!

@exhaustin exhaustin reopened this Oct 10, 2022
@exhaustin exhaustin changed the title Reading Gripper State Slow Reading Gripper (Franka Hand) State Slow Oct 10, 2022
@exhaustin exhaustin changed the title Reading Gripper (Franka Hand) State Slow [Polymetis] Reading Gripper (Franka Hand) State Slow Oct 10, 2022
@AlexanderKhazatsky
Copy link
Author

Thank you as always! Oh also one argument for the non-blocking read:

I'd like to get current gripper width to feed into a policy. Giving it current pose / joints takes ~1ms, but if I want to give it gripper it requires an extra ~10ms currently. I'd much prefer a quicker, but less potentially older read :)

@AlexanderKhazatsky
Copy link
Author

I'm now realizing that this command runs in ~1ms. How did you guys fix this? :)

@exhaustin
Copy link
Contributor

exhaustin commented Dec 18, 2022

We didn't make any changes with regard to this issue :D
Should we consider it resolved now?

@AlexanderKhazatsky
Copy link
Author

Hahah interesting!! Especially since the gripper hz is stil 200…

I wouldn’t consider it fully resolved since robot.update_desired_joint_positions takes ~7ms for some reason, but the running the command in a thread solution works works well :)

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

3 participants