Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Robot Raconteur service #1

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
161 changes: 161 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,164 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

*.pc
*.tp
build/*
Expand Down
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,45 @@ with open("fanuc_log.csv","wb") as f:
print(res.decode('utf-8'))
```

# Robot Raconteur Service

A Robot Raconteur service is available to allow a client to execute multi-move programs. The service
uses a standards track service definition `experimental.robotics.motion_program` that will provide interoperability
between multiple robot types. Due to the differences in the robot commands between controller implementations there
may be slight differences in the commands between robots, but in general the commands are very similar.

When installing the module, include the `robotraconteur` option to get the required dependencies:

```bash
python -m pip install fanuc-motion-program-exec[robotraconteur]
```

Start the service, specifying a robot info file:

```
fanuc-motion-program-exec-robotraconteur --mp-robot-info-file=config/FANUC_lrmate200id_motion_program_robot_default_config.yml
```

Optionally start using a module if the entrypoint does not work:

```
python -m fanuc_motion_program_exec_client.robotraconteur --mp-robot-info-file=config/FANUC_lrmate200id_motion_program_robot_default_config.yml
```

The following options are supported:

* `--mp-robot-info-file=` - The info file that specifies information about the robot
* `--mp-robot-ip=` - The connection IP address of the robot. Defaults to `127.0.0.1`
for use with RoboGuide virtual controllers. Set `127.0.0.1` to the WAN IP address of the robot.
* `--mp-robot-username=` - The robot controller username. Defaults to "robot"
* `--mp-robot2-ip=` - Connection IP of second robot controller
* `--mp-robot2-username=` - Username for second robot controller

Examples for a single robot and multi-move robots are in the `examples/robotraconteur` directory. The motion
programs make heavy use of `varvalue` types to allow for flexibility in the motion program contents.
The Python type `RR.VarValue` is used to represent the `varvalue` type. See the Robot Raconteur Python documentation
for more inforamtion on how `RR.VarValue` works and why it is necessary.

## License

Apache 2.0 License, Copyright 2022 Rensselaer Polytechnic Institute
Expand Down
162 changes: 162 additions & 0 deletions config/FANUC_lrmate200id_motion_program_robot_default_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
robot_info:
device_info:
device:
name: fanuc_lrmate200id
manufacturer:
name: FANUC
uuid: d80db3c2-3de8-41e3-97f9-62765a7063b8
model:
name: lrmate200id
uuid: 1d3f5111-01fa-4ecf-a11e-76810d5e1dde
user_description: FANUC lrmate200id Robot
serial_number: 123456789
device_classes:
- class_identifier:
name: robot
uuid: 39b513e7-21b9-4b49-8654-7537473030eb
subclasses:
- serial
- serial_six_axis
- cobot
implemented_types:
- com.robotraconteur.robotics.robot.Robot
robot_type: serial
robot_capabilities:
- jog_command
- trajectory_command
- position_command
- velocity_command
chains:
- kin_chain_identifier: robot_arm
H:
- x: 0.0
y: 0.0
z: 1.0
- x: 0.0
y: 1.0
z: 0.0
- x: 0.0
y: 1.0
z: 0.0
- x: 1.0
y: 0.0
z: 0.0
- x: 0.0
y: 1.0
z: 0.0
- x: 1.0
y: 0.0
z: 0.0
P:
- x: 0.0
y: 0.0
z: 330
- x: 50
y: 0.0
z: 0.0
- x: 0.
y: 0.0
z: 330
- x: 0.0
y: 0.0
z: 35
- x: 335
y: 0.0
z: 0.0
- x: 80
y: 0.0
z: 0.0
- x: 0.0
y: 0.0
z: 0.0
flange_identifier: tool0
flange_pose:
orientation:
w: 0.7071067811882787
x: 0.0
y: 0.7071067811882787
z: 0.0
position:
x: 0
y: 0.0
z: 0
joint_numbers:
- 0
- 1
- 2
- 3
- 4
- 5
joint_info:
- default_effort_units: newton_meter
default_units: radian
joint_identifier: joint_1
joint_limits:
effort: 1000
lower: -2.96705972
upper: 2.96705972
velocity: 7.85398163
acceleration: 10
joint_type: revolute
passive: false
- default_effort_units: newton_meter
default_units: radian
joint_identifier: joint_2
joint_limits:
effort: 1000
lower: -1.74532925
upper: 2.53072742
velocity: 6.63225116
acceleration: 15
joint_type: revolute
passive: false
- default_effort_units: newton_meter
default_units: radian
joint_identifier: joint_3
joint_limits:
effort: 1000
lower: -3.57792497
upper: 1.22173048
velocity: 9.07571211
acceleration: 15
joint_type: revolute
passive: false
- default_effort_units: newton_meter
default_units: radian
joint_identifier: joint_4
joint_limits:
effort: 1000
lower: -3.31612557
upper: 3.31612557
velocity: 9.59931089
acceleration: 20
joint_type: revolute
passive: false
- default_effort_units: newton_meter
default_units: radian
joint_identifier: joint_5
joint_limits:
effort: 1000
lower: -2.18166156
upper: 2.18166156
velocity: 9.51204442
acceleration: 20
joint_type: revolute
passive: false
- default_effort_units: newton_meter
default_units: radian
joint_identifier: joint_6
joint_limits:
effort: 1000
lower: -6.28318530718
upper: 6.28318530718
velocity: 17.45329252
acceleration: 20
joint_type: revolute
passive: false
supported_commands:
- MoveAbsJ
- MoveJ
- MoveL
- MoveC
- WaitTime
Loading