frankaemika / franka_ros

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

Reading Efforts and Velocities in Gripper node #334

Open ayralth opened 1 year ago

ayralth commented 1 year ago

Hello,

I wanted to read grasping forces of the gripper, but the franka_gripper_node publishes a state topic with gripper-joints efforts and velocities set to zero.

https://github.com/frankaemika/franka_ros/blob/41a3c7808b1a141a242a1258cbdbfebc76ae2a7a/franka_visualization/src/gripper_joint_state_publisher.cpp#L44

Can you clarify what is going on here ? Is there a way to read gripper efforts with franka_ros or libfranka ? Thanks

marcbone commented 1 year ago

Unfortunately, there is no way to read the gripper speed and the gripper efforts. Thats why there are always zero. On the other side when you use the gripper to grasp you always set the speed and grasping force. Best you can do is to calculate the speed yourself. If you use libfranka directly you can also get a boolean that states if you are currently grasping. The grasping force is then the one which you commanded.

gavanderhoorn commented 1 year ago

Would it perhaps be more semantically correct to not set those entries to 0.0 (ie: not set them at all)?

Those lists containing entries basically implies whatever is in those entries is the actual state of those joints.

The way gripper_joint_state_publisher is implemented, there'd be no way to determine whether the state is really 0.0 (ie: no velocity, no effort), or something else.

The documentation of sensor_msgs/JointState seems to suggest things are optional:

This message consists of a multiple arrays, one for each part of the joint state. The goal is to make each of the fields optional. When e.g. your joints have no effort associated with them, you can leave the effort array empty.

rucha6198 commented 1 month ago

Why is gripper velocity and effort always zero?

I am trying to read the velocity of the gripper of Franka Emika Panda in the real-world. However, I always get the gripper velocity and effort to be zero. I get correct values for gripper velocity and effort when I use the Panda in Gazebo simulation.

I get correct values for other joints in Gazebo as well as for real-world Panda.

Could anyone please help me out? I don't understand what could be going wrong. Thank you!