Skip to content

Commit 7527934

Browse files
committed
rewrte README; restructure code
1 parent 554a645 commit 7527934

7 files changed

+41
-22
lines changed

CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
77

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

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

16+
# Add the include directory for headers
17+
include_directories(include)
18+
1719
# Create the Python module with the desired name
1820
pybind11_add_module(allegro_pybind ${SOURCES})
1921

README.md

+32-13
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,33 @@
1-
# Allegro Hand Interface
2-
Adapted from https://github.com/simlabrobotics/allegro_hand_linux_v4
1+
# allegro_pybind
2+
3+
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.
4+
35

4-
## TODO
56

6-
- have a class-based API
7+
**Tested on**:
78

9+
- Ubuntu 20.04
10+
- g++ 9.4.0
11+
- cmake 3.16.3
12+
- python 3.8.20
813

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

13-
# Setup instructions
14-
## Prerequisites
15-
### 1. PCAN-USB driver
20+
## Setup instructions
21+
### Prerequisites
22+
#### 1. PCAN-USB driver
1623
Download, build, and install PCAN-USB driver for Linux "libpcan"
1724
```bash
1825
tar -xzvf peak-linux-driver-x.x.tar.gz
1926
cd peak-linux-driver-x.x
2027
make NET=NO
2128
sudo make install
2229
```
23-
#### Troubleshooting
30+
##### Troubleshooting
2431
* If encounter
2532
```bash
2633
src/pcan-settings.c:47:10: fatal error: popt.h: No such file or directory
@@ -33,7 +40,7 @@ sudo make install
3340
sudo apt install libpopt-dev
3441
```
3542

36-
### 2. `libpcanbasic`
43+
#### 2. `libpcanbasic`
3744
Download, build, and install PCAN-Basic API for Linux: libpcanbasic
3845
```bash
3946
tar -xzvf PCAN_Basic_Linux-x.x.x.tar.gz
@@ -42,7 +49,7 @@ make
4249
sudo make install
4350
```
4451

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

5461

55-
## Installing this interface
62+
### Installation
63+
64+
Besides the dependencies mentioned above, ensure the following dependencies are installed before building the package:
5665

66+
- pybind11
67+
- Eigen3
68+
69+
70+
After installing the dependencies, you can build and install the package with:
5771

5872
```
5973
pip install .
6074
```
6175

6276
# Usage
6377

64-
See `example.py`
78+
See `example.py`
79+
80+
81+
## TODO
82+
83+
- have a class-based API

src/canAPI.h include/canAPI.h

File renamed without changes.

src/canDef.h include/canDef.h

File renamed without changes.
File renamed without changes.

pyproject.toml

+6
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ build-backend = "scikit_build_core.build"
55
[project]
66
name = "allegro_pybind"
77
version = "0.1.0"
8+
authors = [{ name = "Sicheng He", email = "sichengh@usc.edu" }]
9+
description = "A Python binding for controlling the Allegro Hand."
10+
11+
readme = "README.md"
12+
13+
classifiers = ["Programming Language :: Python :: 3"]

src/CMakeLists.txt

-8
This file was deleted.

0 commit comments

Comments
 (0)