uw-biorobotics / raven2

Raven II Surgical Robot
http://brl.ee.washington.edu/
GNU Lesser General Public License v3.0
47 stars 38 forks source link

how to control gripper via rosnode #29

Open junhui1997 opened 1 month ago

junhui1997 commented 1 month ago

hi, currently,I'm using node automove to control the robot, but there is no API for grasp control, how could I control? many thanks!

awlewi commented 1 month ago

Good day,

Glad to hear that you're able to use the automove functionality to move the RAVEN around. The easiest way to use the graspers from a ROS message is to use the servo_jr message that is part of the CRTK API. If your RAVEN is already on the CRTK branch, the servo_jr message allows for relative control of each joint. Joints 6 and 7 control the grasper jaws.

The documentation for the CRTK project is here: https://github.com/collaborative-robotics/documentation/wiki/Robot-API-motion#general-concepts

A CPP example for this message can be found here: https://github.com/collaborative-robotics/crtk-cpp/tree/master/src/crtk_test_servo_jr

A python utility that you may find helpful in figuring out how this functionality can be used is this keyboard controller: https://github.com/uw-biorobotics/raven2_CRTK_Python_controller/tree/main

If CRTK is not installed, the general setup is switching to the CRTK raven2 branch (from UW repo) and cloning the crtk-msgs into your catkin workspace: https://github.com/collaborative-robotics/crtk_msgs The CRTK-cpp repo has directions to build the messages before rebuilding the RAVEN.

If you're committed to an older version of the RAVEN code, it shouldn't be too hard to copy or extend the functionality of the automove function. Adding another field into automove will allow you to specify a relative grasp angle. Then, copy the method that automove uses to update the desired position and orientation for updating the desired grasp position. This would look very similar to how teleoperation commands are used - both functionalities start within the local_io.cpp file.

I hope this helps get you rolling again. Please feel free to send me an email at alewi at uw dot edu.

Best, Andy

PS - Out of curiosity, which RAVEN are you using for your research?