Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/continuous-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Continuous Deployment and push to PyPI

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5.1.0
with:
python-version: 3.12

- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install -r src/requirements.txt

- name: Create Tag
shell: bash
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
NEW_TAG=$(echo $TAG | awk -F. -v OFS=. '{$NF++; print}')
git tag -a $NEW_TAG -m "Release version $NEW_TAG"
sed -i "s/version='.*',/version='${NEW_TAG}',/" setup.py
git commit -am "Bump version to ${NEW_TAG}"
git push origin $NEW_TAG
echo "NEW_TAG=$NEW_TAG" >> $GITHUB_ENV

- name: Create Release
uses: softprops/action-gh-release@v2.0.5
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ env.NEW_TAG }}
generate_release_notes: true

- name: Build package
run: python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include LICENSE
include README.md
81 changes: 60 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
# ABB-EGM-Python
# ABBRobotEGM

A Python library for interfacing with ABB robots using Externally Guided Motion (EGM). This library provides real-time streaming communication with ABB robots at rates up to 250Hz using UDP.
![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)

`ABBRobotEGM` is a Python library for interfacing with ABB robots using Externally Guided Motion (EGM). This library provides real-time streaming communication with ABB robots at rates up to 250Hz using UDP. It's based on the official ABB EGM [documentation](https://github.com/FLo-ABB/ABB-EGM-Python/blob/main/doc/3HAC073318%20AM%20Externally%20Guided%20Motion%20RW7-en.pdf) and examples, and it's designed to be easy to use and to integrate with other systems.

## Prerequisites

- Python 3.x
- ABB RobotWare 7.X (should work with 6.X with few modifications)
- ABB Robot with EGM option (3124-1 Externally Guided Motion)
- The following Python packages:
```txt
numpy
protobuf
```

## Documentation
Please refer to the [documentation](ttps://github.com/FLo-ABB/ABB-EGM-Python/blob/main/doc/3HAC073318%20AM%20Externally%20Guided%20Motion%20RW7-en.pdfh) for detailed information on EGM option.

## Installation
## Installation 🚀

### Using pip 🐍

1. Clone the repository
To install the library using pip, run the following command:

2. Install dependencies:
```sh
pip install -r requirements.txt
```bash
pip install ABBRobotEGM
```

### Manual Installation 📦

To use this library in your project, first download the repository and place the `ABBRobotEGM` folder in your project's directory. You can then import the `EGM` class from this library to use it in your project.

## Simple Examples

The library includes several examples demonstrating different EGM functionalities. Inside each python example file, you can find the relative **RAPID** code that should be running on the robot controller.
The repository includes several examples demonstrating different EGM functionalities. Inside each python example file, you can find the relative **RAPID** code that should be running on the robot controller.

### Guidance Mode

Expand All @@ -41,10 +41,52 @@ example_pose_guidance.py - Makes the robot move in a circular pattern
### Streaming Mode

#### 1. Joint Streaming
example_joint_stream.py - Streams robot joint positions
example_joint_stream.py - Streams robot joint positions :
```python
from ABBRobotEGM import EGM

def main() -> None:
"""
Example showing how to stream the robot's position.
Be sure the robot is running before running this script.
"""
with EGM() as egm:
while True:
success, state = egm.receive_from_robot()
if not success:
print("Failed to receive from robot")
break
print(f"{state.clock[1]}, {state.joint_angles[0]}, {state.joint_angles[1]}, {state.joint_angles[2]}, {state.joint_angles[3]}, {state.joint_angles[4]}, {state.joint_angles[5]}")


if __name__ == "__main__":
main()

```


#### 2. Cartesian Streaming
example_pos_stream.py - Streams robot cartesian position
```python
from ABBRobotEGM import EGM

def main() -> None:
"""
Example showing how to stream the robot's position.
Be sure the robot is running before running this script.
"""
with EGM() as egm:
while True:
success, state = egm.receive_from_robot()
if not success:
print("Failed to receive from robot")
break
print(f"{state.clock[1]}, {state.cartesian.pos.x}, {state.cartesian.pos.y}, {state.cartesian.pos.z}")


if __name__ == "__main__":
main()
```

### 3. Data Exchange
example_table.py - Demonstrates exchanging data arrays with the robot
Expand All @@ -54,7 +96,7 @@ Example of a more complex scenario where the robot is scanning a surface giving

https://github.com/user-attachments/assets/03f151de-e098-4255-ac46-7dff42231071

## Features
## Features 🚀

- Real-time communication at up to 250Hz
- Joint position control
Expand All @@ -66,10 +108,7 @@ https://github.com/user-attachments/assets/03f151de-e098-4255-ac46-7dff42231071
- Force measurement reading
- Comprehensive robot state feedback

## License

Licensed under the Apache License, Version 2.0. See LICENSE file for details.

## Contributing
## Contributing 🤝

Contributions are welcome! Please feel free to submit pull requests.
Empty file removed abb_egm/_egm_protobuf/__init__.py
Empty file.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from abb_egm.egm import EGM
from ABBRobotEGM import EGM
import matplotlib.pyplot as plt
import numpy as np
import time
Expand Down
2 changes: 2 additions & 0 deletions examples/complex/scenario_scan/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
matplotlib
numpy
1 change: 1 addition & 0 deletions examples/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ABBRobotEGM
2 changes: 1 addition & 1 deletion example_table.py → examples/simple/example_table.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from abb_egm.egm import EGM
from ABBRobotEGM import EGM
import numpy as np

# Robot Module #
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from abb_egm.egm import EGM
from ABBRobotEGM import EGM
import numpy as np

# Robot Module #
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from abb_egm.egm import EGM
from ABBRobotEGM import EGM
import numpy as np

# Robot Module #
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from abb_egm.egm import EGM
from ABBRobotEGM import EGM

# Robot Module #
# MODULE MainModule
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from abb_egm.egm import EGM
from ABBRobotEGM import EGM

# MODULE MainModule
# VAR egmident egmID1;
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

24 changes: 24 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from setuptools import setup, find_packages

setup(
name='ABBRobotEGM',
version='1.0.0',
description='A Python library for real-time control and data streaming of ABB robots using EGM protocol, enabling high-frequency (250Hz) communication through UDP for industrial automation applications.',
long_description=open('README.md', encoding='utf-8').read(),
long_description_content_type='text/markdown',
author='Florian LOBERT',
url='https://github.com/FLo-ABB/ABB-EGM-Python',
packages=find_packages(where='src'),
package_dir={'': 'src'},
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: Apache Software License', # Fixed classifier
'Operating System :: OS Independent',
'Intended Audience :: Developers',
],
python_requires='>=3.6', # Specify minimum Python version
install_requires=[
'numpy',
'protobuf',
],
)
1 change: 1 addition & 0 deletions src/ABBRobotEGM/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .egm import EGM
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion abb_egm/egm.py → src/ABBRobotEGM/egm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import numpy as np
import errno
from typing import Tuple, NamedTuple, Any, Optional
from abb_egm._egm_protobuf import egm_pb2
from ABBRobotEGM._egm_protobuf import egm_pb2
from .abb_data import Pos, Orientation, Euler, Pose

# Constants
Expand Down
4 changes: 4 additions & 0 deletions src/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
numpy
protobuf
setuptools
build
Loading