Skip to content

Commit

Permalink
rewrte README; restructure code
Browse files Browse the repository at this point in the history
  • Loading branch information
hesic73 committed Nov 13, 2024
1 parent 554a645 commit 7527934
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 22 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Enable pybind11's automatic Python detection
set(PYBIND11_FINDPYTHON ON)
set(pybind11_DIR /home/abrar/hsc/pybind11-2.6.2/build/lib/pybind11/share/cmake/pybind11)
find_package(pybind11 CONFIG REQUIRED)
find_package(Eigen3 REQUIRED) # Find Eigen3

# Define the source files
set(SOURCES src/main.cpp src/canAPI.cpp)

# Add the include directory for headers
include_directories(include)

# Create the Python module with the desired name
pybind11_add_module(allegro_pybind ${SOURCES})

Expand Down
45 changes: 32 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
# Allegro Hand Interface
Adapted from https://github.com/simlabrobotics/allegro_hand_linux_v4
# allegro_pybind

A Python binding for controlling the Allegro Hand, heavily based on https://github.com/simlabrobotics/allegro_hand_linux_v4. The setup instructions are also borrowed from the original project.


## TODO

- have a class-based API
**Tested on**:

- Ubuntu 20.04
- g++ 9.4.0
- cmake 3.16.3
- python 3.8.20

# Required hardware


## Required hardware
1. [Allegro hand v4](http://wiki.wonikrobotics.com/AllegroHandWiki/index.php/Allegro_Hand_v4.0)
2. [PCAN-USB interface](https://www.peak-system.com/PCAN-USB.199.0.html?&L=1)

# Setup instructions
## Prerequisites
### 1. PCAN-USB driver
## Setup instructions
### Prerequisites
#### 1. PCAN-USB driver
Download, build, and install PCAN-USB driver for Linux "libpcan"
```bash
tar -xzvf peak-linux-driver-x.x.tar.gz
cd peak-linux-driver-x.x
make NET=NO
sudo make install
```
#### Troubleshooting
##### Troubleshooting
* If encounter
```bash
src/pcan-settings.c:47:10: fatal error: popt.h: No such file or directory
Expand All @@ -33,7 +40,7 @@ sudo make install
sudo apt install libpopt-dev
```

### 2. `libpcanbasic`
#### 2. `libpcanbasic`
Download, build, and install PCAN-Basic API for Linux: libpcanbasic
```bash
tar -xzvf PCAN_Basic_Linux-x.x.x.tar.gz
Expand All @@ -42,7 +49,7 @@ make
sudo make install
```

### 3. `libBHand` grasping library
#### 3. `libBHand` grasping library
Download, build, and install Grasping Library for Linux, "libBHand": Grasping_Library_for_Linux
```bash
unzip LibBHand_{32|64}.zip
Expand All @@ -52,13 +59,25 @@ sudo ldconfig
```


## Installing this interface
### Installation

Besides the dependencies mentioned above, ensure the following dependencies are installed before building the package:

- pybind11
- Eigen3


After installing the dependencies, you can build and install the package with:

```
pip install .
```

# Usage

See `example.py`
See `example.py`


## TODO

- have a class-based API
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ build-backend = "scikit_build_core.build"
[project]
name = "allegro_pybind"
version = "0.1.0"
authors = [{ name = "Sicheng He", email = "[email protected]" }]
description = "A Python binding for controlling the Allegro Hand."

readme = "README.md"

classifiers = ["Programming Language :: Python :: 3"]
8 changes: 0 additions & 8 deletions src/CMakeLists.txt

This file was deleted.

0 comments on commit 7527934

Please sign in to comment.