TimSchneider42 / franky

High-Level Motion Library for Collaborative Robots
https://timschneider42.github.io/franky/
GNU Lesser General Public License v3.0
33 stars 9 forks source link

Impedance control question #5

Closed shaido987 closed 8 months ago

shaido987 commented 8 months ago

Hello,

We have been trying to use franky with impedance control using CartesianImpedenceMotion but haven't gotten it to work. There is no error when running the code. Below is the code we tried. Any idea what is wrong (maybe we are setting the translational_stiffness correctly)?

from franky import Affine, CartesianMotion, CartesianImpedanceMotion, Robot, ReferenceType, CartesianPoseStopMotion
import time

robot = Robot("172.16.0.2")
robot.recover_from_errors()
robot.relative_dynamics_factor = 0.2

motion = CartesianImpedanceMotion(Affine([0.103205, -0.554416, 0.399998], [0.768303, -0.637665, 0.0449731, 0.0327324]), 100, translational_stiffness=10)

robot.move(motion, asynchronous=True)
time.sleep(30)
TimSchneider42 commented 8 months ago

Hey,

To be honest, I have not really touched this code at all, so I don't know how it works. However, why don't you use CartesianMotion and set the impedance with Robot.set_cartesian_impedance? This will use the Frankas internal impedance controller, which I have found to work quite well.

Best, Tim

shaido987 commented 8 months ago

Thanks for the answer! We will try out your suggestion next time we have access to the Franka robot.

TimSchneider42 commented 8 months ago

Okay, let me know if you have any other issues!