ROS packages to control the Barrett Hand. Supported models: BH8-280 and BH8-282
Table of Contents
-
Prepare prerequisites
-
Catkin build
-
Connect to hand
roslaunch bhand_controller bhand_controller.launch
-
Testing through ROS services
rosservice call /bhand_node/actions "action: 1"
: INIT_HANDrosservice call /bhand_node/actions "action: 6"
: CLOSE_HALF_GRASProsservice call /bhand_node/actions "action: 3"
: OPEN_GRASP
For Python3, please check the Barret manual from the RISE Notion.
sudo apt-get install swig libelf-dev libpopt-dev
The PEAK driver is included in the Linux kernel, but there is a problem that some packages cannot be built. Therefore, it is recommended to overwrite and install the PEAK driver according to the following install guide.
- Download
peak-linux-driver-8.x
from here. Scroll down and you will find the 'Download PCAN Driver Package' button. - Build and install
tar -xzf peak-linux-driver-X.Y.Z.tar.gz cd peak-linux-driver-X.Y.Z make clean make NET=NO_NETDEV_SUPPORT sudo make install
- Load PCAN driver w/o reboot and check the result. Example:
$ sudo modprobe pcan $ pcaninfo PCAN driver version: 8.15.2 PCAN-Basic version: 4.6.2.36 * pcanusb32: "PCAN_USBBUS1" (0x051), PCAN-USB #1, devid=0x00 (/sys/class/pcan/pcanusb32)
The pcan_python is a Python 2.x wrapper for the Peak-CAN driver. We need to build this for Python 3.x.
-
Git clone
git clone https://github.com/RobotnikAutomation/pcan_python.git
-
Fix some files. The below are examples for python3.8.
- Line 11 of
Makefile
:INC = -I/usr/include/python3.8 -I/usr/include
- Line 01 of
setup.py
:#!/usr/bin/env python3
- Line 11 of
-
Change the code style and build
sudo apt install python3-dev cd pcan_python 2to3 -w -n . make
-
Modify lines 12 to 15 of
pcan_python/pcan_module.py
(generated file) as follows:# if __package__ or "." in __name__: # from . import _pcan_module # else: # import _pcan_module import _pcan_module
-
Install
sudo make install
-
Add
/usr/lib
to PYTHONPATHexport PYTHONPATH=/usr/lib:$PYTHONPATH
Check your pcan with:
sudo modprobe pcan
pcaninfo
If you couldn't solve the issue with sudo modprobe pcan (or pcan_usb)
, then reinstall the driver:
cd peak-linux-driver-X.Y.Z
make clean
make NET=NO_NETDEV_SUPPORT
sudo make install
- ROS controller based on the Barrett pyHand library to command and read the state of the hand.
bhand_controller
is forked from RobotnikAutomation/barrett_hand (kinetic-devel)
- RQT plugin to control and monitor the hand
rqt_bhand
is forked from RobotnikAutomation/barrett_hand (kinetic-devel)
- Barrett Hand description (urdf and meshes)
barrett_hand_description
is forked from RobotnikAutomation/barrett_hand_common (kinetic-devel)
-
Barrett hand simulation package for ROS
-
barrett_hand_sim
is forked from RobotnikAutomation/barrett_hand_sim (kinetic-devel) -
Launch the Gazebo simulation:
roslaunch barrett_hand_gazebo barrett_hand.launch
-
How to switch to available hand models:
- Edit file
barrett_hand_description/robots/bh_alone.urdf.xacro
and change the name of the included file (bh282.urdf.xacro
orbh280.urdf.xacro
)
- Edit file
-
Publish topics to control the hand:
rostopic pub /bh_j11_position_controller/command std_msgs/Float64 'desired_angle'
-
Controller list:
- bh_j11_position_controller -> spread DoF
- bh_j12_position_controller -> finger 1 grasp
- bh_j22_position_controller -> finger 2 grasp
- bh_j32_position_controller -> finger 3 grasp