-
Notifications
You must be signed in to change notification settings - Fork 216
Description
Description
I am using franka::AsyncPositionControlHandler for asynchronous position control, with a joint position target callback defined as follows:
auto calculate_joint_position_target =
[&initial_position, &time, &direction](
std::chrono::milliseconds period)
-> franka::AsyncPositionControlHandler::JointPositionTarget;
During execution of AsyncPositionControlHandler, I found that I am unable to retrieve the current robot state using robot.readOnce(). The call either blocks or does not return valid/updated state information while the async control handler is active.
This makes it difficult to access and update the actual robot state (e.g., joint positions, velocities, external torques) during asynchronous control execution.
Expected Behavior
While using AsyncPositionControlHandler, I would expect to be able to:
Access the current robot state during control execution
Periodically read and update the real robot state (e.g., for monitoring, logging, or feedback purposes)
For example, being able to safely call:
franka::RobotState state = robot.readOnce();
while the async control handler is running.
Observed Behavior
Calling robot.readOnce() during AsyncPositionControlHandler execution does not work as expected
Robot state cannot be retrieved or updated while the async handler is active
Question
What is the recommended way to access and update the actual robot state while using AsyncPositionControlHandler?
Specifically:
Is it expected that readOnce() cannot be used during async control?
Is there an alternative API or callback mechanism to retrieve RobotState during asynchronous position control?
Should robot state be accessed inside the async control callback itself, or via another thread-safe interface?
Any guidance or best practices would be greatly appreciated.
Environment
Robot: Franka Research 3
Control mode: AsyncPositionControlHandler
OS: Ubuntu 20.04
libfranka version: 0.18.2