Add pseudo code for bi teleoperation (4channel)

This commit is contained in:
Pepijn
2025-06-26 18:28:25 +02:00
parent e171fa788a
commit 9ad19d4e81
@@ -1,6 +1,37 @@
import math
import time
## Pseudo code for Impedance control and 4 channel bilateral tele-op
# 1. Read the leader and follower
# 2. Compute the follower's impedance torque
# 3. Compute the leader's torque
# 4. Set the leader and follower's torque
# # Read leader
# θ_, ω_, F_ = leader.read_state()
# # Read the follower
# θ_f, ω_f, F_f = follower.read_state()
# # Compute the followers impedance torque
# τ_f = (
# Kp*(θ_ - θ_f) # position coupling
# + Kd*(ω_ - ω_f) # velocity coupling
# + K_ff * F_ # force feed-forward from the leader
# )
# follower.set_torque(τ_f)
# # Compute the leaders torque
# τ_ = (
# K_mp*(θ_f - θ_) # motion-feedback
# + K_md*(ω_f - ω_) # velocity-feedback
# - K_mf * F_f # force-feedback (negative)
# )
# leader.set_torque(τ_)
# Other details mentioned by Bi-ACT paper:
# The controller design adopted a control of position and force
# for each axis, as shown in Fig. 3. Angle information was
# obtained from encoders, and angular velocity was calculated
# by differentiating this information. The disturbance torque τdis
# was calculated using a disturbance observer (DOB) [29], and
# the torque response value τres was estimated using a force
# reaction observer (RFOB) [30].
from lerobot.common.robots.so101_follower_torque.config_so101_follower_t import SO101FollowerTConfig
from lerobot.common.robots.so101_follower_torque.so101_follower_t import SO101FollowerT