This repository contains the code and the hardware source files for the paper:
9DTact: A Compact Vision-Based Tactile Sensor for Accurate 3D Shape Reconstruction and Generalizable 6D Force Estimation
Changyi Lin,
Han Zhang,
Jikai Xu, Lei Wu, and
Huazhe Xu
RAL, 2023
Website /
Arxiv Paper /
Video Tutorial /
Bom (CN)
conda create -n 9dtact python=3.8
conda activate 9dtact
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
pip install -e .
For all the terminals used in this section, they are located in the shape_reconstruction directory and based on the 9dtact conda environment:
cd shape_reconstruction
conda activate 9dtact
Before you start, 3d print the calibration board.
Run:
python _1_Camera_Calibration.py
Just follow the printed instructions.
Firstly, prepare a ball with a radius of 4.0 mm.
(The radius of the ball depends on the thickness of the sensor surface.
4.0 mm is just a recommendation.)
Then, run:
python _2_Sensor_Calibration.py
Just follow the printed instructions.
python _3_Shape_Reconstruction.py
If you want to collect force data with a BOTA MiniONE Pro sensor, you need to:
Create a directory named 'bota_ws' as the ROS workspace, and install the bota driver package.
cd ~/xxx/bota_ws # Modify 'xxx' to enter the workspace directory
source devel/setup.bash
roslaunch rokubimini_serial rokubimini_serial.launch
source ~/xxx/bota_ws/devel/setup.bash
cd data_collection
conda activate 9dtact
python collect_data.py
cd shape-force-ros
conda activate 9dtact
python _1_Sensor_ros.py
cd data_collection
conda activate 9dtact
python wrench_normalization.py # remember to modify the object_num
python split_train_test.py
and also:
python split_train_test(objects).py
To train the model on the stadard training dataset, run:
cd force_estimation
python train.py --model_name="Densenet" --model_layer=169 --optimizer="ADAM" --lrs=False --image_type="RGB" --cuda_index=6 --resize_img=False --train_mode=True --test_object=False --mixed_image=True --pretrained=False --batch_size=64 --num_epoch=200 --learning_rate=5.0e-4 --weight_decay=0.0
You may also choose to use Weights and Bias (wandb) by setting use_wandb as True, which helps to track the training performance.
You need to specify a model saved in the 'saved_models' directory as an estimator,
by modifying the 'weights' parameters in the force_config.yaml.
After that, run:
cd force_estimation
python _1_Force_Estimation.py
cd shape-force_ros
conda activate 9dtact
python _1_Sensor_ros.py
cd shape-force_ros
conda activate 9dtact
python _2_Shape_Reconstruction_ros.py
cd shape-force_ros
conda activate 9dtact
python _1_Sensor_ros.py
cd shape-force_ros
conda activate 9dtact
python _3_Force_Estimation_ros.py
cd force_estimation
conda activate 9dtact
python force_visualizer.py
cd shape-force_ros
conda activate 9dtact
python _3_Force_Estimation_ros.py
cd shape-force_ros
conda activate 9dtact
python _4_Shape_Force_ros.py