This is the GitHub repo for the thesis of Max Waterhout for my master Robotics at the Technical University of Delft. The full thesis can be read at: https://repository.tudelft.nl/islandora/object/uuid%3A4506c969-220d-4257-ad5b-91853ea83ccb?collection=education
Before running the code, make sure you have the following prerequisites installed:
- Install BlenderProc using the command:
pip install blenderproc
or clone it directly from the GitHub repository:https://github.com/DLR-RM/BlenderProc
. - Test if BlenderProc is correctly installed with
blenderproc quickstart
. It also downloads Blender for you. - Download textures by running the following command in the command line:
blenderproc download cc_textures
. Place the textures in dedatasets
folder. - Download the BOP toolkit by cloning the repository:
git clone https://github.com/thodan/bop_toolkit.git
. Place the toolkit in your working folder.
Ensure that you have completed these prerequisites before proceeding with the code.
To generate synthetic data, we need CAD models to be inserted into the scene. If you don't have the CAD model, you can follow these steps:
- Use a scanner (In this work the ARTEC EVA-S 3D Scanner is used) to create a CAD model.
- Load the model in Blender. Ensure that the model is in meters since the script expects it to be in that unit.
- Align the object frame with the world frame. In our dataset, the Z-axis represents the sky. You can achieve this by entering edit mode and using the mesh transformation tools to align the axis.
- (Optional) Add a modifier in the Modifier properties. Choose the decimate option to reduce the point cloud's size and potentially improve computational costs. You can adjust the decimation ratio to your preference but we use 0.5 for a balance between point cloud detail and computational costs.
- Convert the model into a point cloud by exporting it as Stanford (.ply) format. Make sure to select the ASCII format. Save the object in the folder
datasets/models/chess/models
with the nameobj_00000*.ply
. - Run the command
python bop_toolkit/scripts/calc_model_info.py
to generate themodels_info.json
file. - If your 3D scanner does not capture colors, such as the ARTEC EVA-S, you will need to manually select a texture for the object. In Blender, navigate to the shading tab and ensure that the model is in object-mode with viewport shading enabled. From the available textures in the datasets/cc_textures folder, choose a folder and select the *_Color.jpg file in Blender. Connect the color output to the base_color input of the Principled BSDF shader. You can now preview your object with the applied texture. In our case, we used multiple wood textures, which were placed in the datasets/models/chess/textures folder.
This process will help you create the necessary CAD models for your synthetic data.
To generate images, you can execute the following command in your terminal:
blenderproc run main_chess_upright.py datasets/models datasets/cc_textures output --num_scenes=2
Let's break down the arguments:
datasets/models
: Path to the parent directory containing the BOP datasets.datasets/cc_textures
: Path to the directory containing the textures.output
: Folder where the generated images will be saved.--num_scenes=2
: Specifies the number of scenes to render, each with a different textured wall.
Executing this command initiates the image generation process. It will render the specified number of scenes, applying the desired textures, and save the resulting images in the output folder.
- Read the paper "EfficientPose: An efficient, accurate and scalable end-to-end 6D multi object pose estimation approach" and clone its repo at: https://github.com/ybkscht/EfficientPose
- Put the images in LineMod format. This way EfficientPose can be trained on them.
- Follow the instructions on the EfficientPose GitHub page to train the models.
- First get the robot to work: https://frankaemika.github.io/docs/overview.html
ROS/picking_ws
contains the ROS network for the picking pipeline. The whole pipeline is explained in the thesis itself. An example command for picking is:roslaunch franka_scripts pick_and_place.launch robot_ip:=192.168.0.200 real_robot:=true robot:=fr3 use_rviz:=False