frankaemika / franka_ros

ROS integration for Franka research robots
https://frankaemika.github.io
Apache License 2.0
339 stars 307 forks source link

`force` parameter no effect when performing `GraspAction` #376

Open SuperN1ck opened 4 months ago

SuperN1ck commented 4 months ago

Dear Franka Development Team, thanks for the tools. A colleague (https://github.com/ARoefer/) and I are confused about the force set when performing a GraspAction using a Panda robot.

Please see the MEW below. When running, we can neither feel nor see a difference (grasping a sponge), when we apply the different force values.

import rospy
import actionlib

from franka_gripper.msg import (
    GraspAction as GraspActionMsg,
    GraspEpsilon as GraspEpsilonMsg,
    GraspGoal as GraspGoalMsg,
)

from franka_gripper.msg import MoveAction as MoveActionMsg, MoveGoal as MoveGoalMsg

OPEN_GOAL = MoveGoalMsg(width=0.08, speed=0.1)

def main():
    rospy.init_node("franka_gripper_force_test")

    gripper_grasp_client = actionlib.SimpleActionClient(
        "/franka_gripper/grasp", GraspActionMsg
    )

    gripper_move_client = actionlib.SimpleActionClient(
        "/franka_gripper/move", MoveActionMsg
    )

    print("waiting for the action server to start")
    gripper_grasp_client.wait_for_server()
    gripper_move_client.wait_for_server()

    # Open fully

    gripper_move_client.send_goal_and_wait(OPEN_GOAL)
    goal = GraspGoalMsg(
        width=0.0, speed=0.1, force=1.0, epsilon=GraspEpsilonMsg(inner=0.1, outer=0.1)
    )
    gripper_grasp_client.send_goal_and_wait(goal)
    rospy.sleep(2)

    gripper_move_client.send_goal_and_wait(OPEN_GOAL)
    goal = GraspGoalMsg(
        width=0.0, speed=0.1, force=5.0, epsilon=GraspEpsilonMsg(inner=0.1, outer=0.1)
    )
    gripper_grasp_client.send_goal_and_wait(goal)
    rospy.sleep(2)

    gripper_move_client.send_goal_and_wait(OPEN_GOAL)

if __name__ == "__main__":
    main()

We are running the latest available version through apt (ros-noetic-franka-ros (0.10.1-1focal.20240125.211037)) and Panda system firmware 4.2.2 and robot firmware 1.3.4-F-AX (last entry 1.3.4-F-A7). It says though Franka Hand: Disconnected.

We hope there is a quick solution to our problem. Please let us know if you need any further information.

Cheers, -Nick

lossfaller commented 3 months ago

Have you solved this issue now? We have also encountered this problem, and our 'width' parameter is not working either.

ARoefer commented 3 months ago

Hello! No, we have not really found a solution for it. In the end we control the closing of the gripper manually using the set_position interface. We have fingertip sensors that allow us to measure the applied force and thus we stop according to their readings. You could also try to monitor the position and stop according to a decrease in change. One thing to note is that we also rewrote (not a huge deal, but with mentioning) the gripper node because the gripper would not open reliably. This is because the c++ gripper API is blocking while it executed a position command and cannot be interrupted. The timeout is also hard coded and seems to be more than a minute.

Hope this gives you an insight. If you are interested, I can share our gripper node in the next days.