flexivrobotics / flexiv_rdk

RDK (robotic development kit) for Flexiv robots. Supports C++ and Python. Compatible with Linux, macOS, and Windows.
Apache License 2.0
58 stars 18 forks source link

[Question] Is Flexiv.Robot threadsafe? #68

Closed skyrimax closed 1 month ago

skyrimax commented 1 month ago

I am working with the RDK for a project and I had a small question. We would like to have an "introspection" thread, basically checking the state and position of the robot arm to inform a PLC. We would like this introspection to be done in a separate thread from the one sending commands to the robot for simplicity and separation of concerns. So basically, I was wondering if that was possible or if I needed to wrap the fleiv.Robot class in a threadsafety class that would implement a lock acquisition and release mechanism. We are using python version 3.10.

pzhu-flexiv commented 1 month ago

@skyrimax In RDK v1.4, flexiv::rdk::Robot::states() is non-blocking and thread safe, the whole data accessing operation is lock protected.

skyrimax commented 1 month ago

Thank you!