Tanneguydv / pyolp_robotics

A full python tool to sketch serial robots offline programming
GNU General Public License v3.0
8 stars 2 forks source link
collision-detection opencascade planning python pythonocc robot robotframework robotics toolpath

image

pyolp_robotics

A 3D graphic tool to sketch serial robots offline programming\ Full python framework, simple and easy to implement.

Robotic fk & ik implemented into a Pythonocc CAD kernel, enabling collision detection, 3d operations and trajectory planning in the same framework.\ For the moment two robots are available : an UR10 and an UR10e from Universal Robot (6 axes) and an Iiwa from Kuka (7axes).

This tool is mainly a pedagogic tool to understand the basic concepts of robotic kinematics in a friendly programming environment.

Use

Find robot's pose with a given configuration/3D frame to reach/collision environment/etc.\ The tool use IKPY to solve the inverse kinematics of the robot model (but used my fork for compatibility with this repo) . The model is specified with its Denavit Hartenberg parameters.\ Thanks to the Pythonocc library we can unleash the 3d operations possibilities, as it has the potential to treat nurbs objects. pythonocc-core=7.8.1 is used along with PySide6.\ It also enables a realistic visualisation of the poses and to define collisions environnement.\ The Flexible Collision Library python wrapper is used with Pythonocc to deal with collision, this is not optimized though.\ @jf--- has reworked the collision using AIS from pythonocc, and it works well, thank you for your contribution!

Examples / tests

A simple forward kinematic example with sliders image

An example of poses obtained from two frames, and intermediates poses calculated in a linear articular space image

Another example using the extraction of an edge from a shape to generate poses, similar than a linear one in the cartesian space\ image

A pose computed taking into account the collision environment image

The capability to detect self-collision events\ image

and finally an example of application, a simple slicer method and poses generation (taken from pythonocc-demos) image

Installation

Successfully runned on windows 10 and Ubuntu 22 Install pyolp_robotis as a package inside a conda environment :

conda env create -f environment.yml
conda activate pyolp
pip install .

run a test

cd tests
python ./ik_articular_poses.py

you're good!

How to define your robot

Create a new class such as ur.py that inherits from Robot.\ All you need is to :

You can also define new tool, in the tool directory. As the robot's axes all you need to do is to save the 3D stp file in its initial position, name it your_tool, add its name to the available tool of the robot.\ You will need to create a your_tool.txt file containing the coordinates of its TCP : "(x, y, z), (DirZx, DirZy, DirZz), (DirXx, DirXy, DirXz)". Softwares like Rhinoceros3d or Blender could be useful for this.

Connect it to robot

Tried successfully using these interfaces with few minor ergonomic changes :\ ur interface\ IiwaPy3

Warning

This tool is mainly a pedagogic tool to understand the basic concepts of robotic kinematics

Further work to be done

Implement jacobian method to deal with trajectory speed and so on\ add other robots\ better interaction between robot's model and FCL mesh ...\ feel free to contribute :)