Skip to content

rise-lab-skku/rise-barrett-hand

Repository files navigation

Barrett Hand

Ubuntu ROS Python

ROS packages to control the Barrett Hand. Supported models: BH8-280 and BH8-282

Table of Contents

  1. Quick start with real Barrett
  2. Prerequisites
    1. 1. Essentials
    2. 2. Peak-CAN driver
    3. 3. pcan_python
  3. Troubleshooting
    1. Error openning port /dev/pcanusb32
  4. Collections
    1. bhand_controller
    2. rqt_bhand
    3. barrett_hand_description
    4. barrett_hand_sim

Quick start with real Barrett

  1. Prepare prerequisites

  2. Catkin build

  3. Connect to hand

    roslaunch bhand_controller bhand_controller.launch
  4. Testing through ROS services

    1. rosservice call /bhand_node/actions "action: 1" : INIT_HAND
    2. rosservice call /bhand_node/actions "action: 6" : CLOSE_HALF_GRASP
    3. rosservice call /bhand_node/actions "action: 3" : OPEN_GRASP

Prerequisites

For Python3, please check the Barret manual from the RISE Notion.

1. Essentials

sudo apt-get install swig libelf-dev libpopt-dev

2. Peak-CAN driver

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.

  1. Download peak-linux-driver-8.x from here. Scroll down and you will find the 'Download PCAN Driver Package' button.
  2. 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
  3. 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)

3. pcan_python

The pcan_python is a Python 2.x wrapper for the Peak-CAN driver. We need to build this for Python 3.x.

  1. Git clone git clone https://github.com/RobotnikAutomation/pcan_python.git

  2. Fix some files. The below are examples for python3.8.

    1. Line 11 of Makefile: INC = -I/usr/include/python3.8 -I/usr/include
    2. Line 01 of setup.py: #!/usr/bin/env python3
  3. Change the code style and build

    sudo apt install python3-dev
    cd pcan_python
    2to3 -w -n .
    make
  4. 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
  5. Install

    sudo make install
  6. Add /usr/lib to PYTHONPATH

    export PYTHONPATH=/usr/lib:$PYTHONPATH

Troubleshooting

Error openning port /dev/pcanusb32

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

Collections

bhand_controller

rqt_bhand

barrett_hand_description

barrett_hand_sim

  • 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 or bh280.urdf.xacro)
  • 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

About

Common packages for Barrett Hand

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published