Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
c813fdf
initial commit
seedship Aug 16, 2021
bc423bd
test commit
Aug 16, 2021
4989127
testing sample code
Aug 16, 2021
b649815
fixed err
Aug 18, 2021
404a18d
working single tag parser
Aug 18, 2021
8a8ac6d
variable length list parsing
Aug 18, 2021
5c1911f
nvmd
Aug 18, 2021
9ff0566
test commit
EliDll Aug 19, 2021
41764af
test commit 2
EliDll Aug 19, 2021
ab74fbf
file structure
EliDll Aug 19, 2021
93492f8
again
EliDll Aug 19, 2021
69d4a6f
added xml endpoint
EliDll Aug 19, 2021
85fb3b8
working socket connection
EliDll Aug 19, 2021
80b5c8a
include xml parser in client
EliDll Aug 19, 2021
2db367b
successful parsing of pipe file xml
EliDll Aug 20, 2021
e3849e9
pseudo request by client
EliDll Aug 20, 2021
04cffd7
server loop
EliDll Aug 20, 2021
62af25e
logging
EliDll Aug 20, 2021
3c3e7da
buffer limit xml
EliDll Aug 24, 2021
e31cc86
debug prints
EliDll Aug 24, 2021
20e035e
file log utils
EliDll Aug 26, 2021
2d744e6
delete karel sample
EliDll Aug 26, 2021
d75d494
fixed syntax
EliDll Aug 26, 2021
d09bb6c
refactor
EliDll Aug 26, 2021
fe740fa
debug
EliDll Aug 26, 2021
62f745e
compile fixes
EliDll Aug 27, 2021
874b191
rtt calculations
EliDll Oct 18, 2021
c56cd06
http host / http client time measurements
EliDll Oct 18, 2021
a516eff
override movement
EliDll Oct 20, 2021
97f3462
REST xml server
EliDll Oct 21, 2021
6cc5e52
stopwatch
EliDll Oct 22, 2021
6e4bba0
Update README.md
EliDll Oct 22, 2021
1400fce
Merge branch 'feature/xml_parsing'
EliDll Oct 22, 2021
47b1f15
repo restructuring
EliDll Oct 22, 2021
fa16981
wrapper for rest calls
EliDll Oct 22, 2021
d1a6979
initial rest format
EliDll Oct 26, 2021
3894cb5
new type conformance
EliDll Oct 27, 2021
5f4642f
new type parsers
EliDll Oct 28, 2021
6776490
endpoint params
EliDll Nov 2, 2021
96e9bcd
snake case refactor
EliDll Nov 2, 2021
9574098
call with url params
EliDll Nov 2, 2021
9a5a9e2
picking points with id
EliDll Nov 4, 2021
16ec25d
basic motion from xml comm
EliDll Nov 4, 2021
8affd8e
incremental movement
EliDll Nov 11, 2021
73800cf
full comms flow
EliDll Nov 12, 2021
f3b8c13
renaming & error handling
EliDll Nov 16, 2021
b007f5f
add position http interface
EliDll Nov 16, 2021
e733a69
refactor python side
EliDll Nov 16, 2021
560c5d3
python changes
EliDll Nov 16, 2021
7a4fb52
file cleanup
EliDll Nov 16, 2021
783d26c
swagger doc
EliDll Nov 16, 2021
d31160a
dynamic endpoint results
EliDll Nov 17, 2021
55dff66
margin check
EliDll Nov 18, 2021
7eda47e
reverse api for ai gym
EliDll Nov 25, 2021
7f26a1b
http response fixes
EliDll Nov 25, 2021
310fe5e
integration changes
EliDll Nov 25, 2021
6fc3736
http dpm
EliDll Dec 2, 2021
d4664f8
Merge branch 'no_logs'
EliDll Dec 2, 2021
a39a6e1
whatevr
EliDll Dec 3, 2021
28e8b4f
documentation
EliDll Dec 7, 2021
d7a61b6
gripper remote access
EliDll Dec 9, 2021
0e3d969
remote gripping works
EliDll Dec 14, 2021
2b7d3d2
jitter
EliDll Dec 14, 2021
b9aab13
repo cleanup
EliDll Dec 14, 2021
a15b533
renaming
EliDll Dec 14, 2021
8af4f73
dsdfsdfsdf
EliDll Dec 17, 2021
3095ca3
motion & REST refactor
EliDll Jan 18, 2022
26528df
filetree
EliDll Jan 18, 2022
491a778
move core functionality to separate folder
EliDll Jan 19, 2022
6e97635
tuning changes
EliDll Feb 2, 2022
1592021
benchmark support & http refactor
EliDll Feb 24, 2022
799b97c
api client refactor
EliDll Feb 28, 2022
d3e5996
Update README.md
EliDll Oct 28, 2024
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,6 @@ dmypy.json
*.pc
*.tp
.DS_Store

# VSCODE
.vs/*
88 changes: 2 additions & 86 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,3 @@
# cpsFanucInterface
# cps-fanuc-api

## Acknowledgements
* The HTTP interface is adapted based on the [Ellis](https://github.com/afeldman/Ellis) repository by Anton Feldmann.
* We would also like to thank Bernd Klein from FANUC for his guidance and support in development.

## ROBOGUIDE Setup
* Create New Project - Default options are okay except for the following steps:
* Step 2: Workcell Name -- Choose a name
* Step 6: Group 1 Robot Model -- Purchased robot is H753 LR Mate 200iD/7L (R-30iB+ Mate Controller)
* Step 8: Robot Options -- Add the following
* KAREL (R632)
* User Socket Msg (R648)
* Dyn Path Modifier (R739)

## Setting the Teach Pendant to Wide View
When navigating the Teach Pendant (in either ROBOGUIDE or the real robot), it is helpful to set it to wide view mode. It can be done as follows.
* On the Teach Pendant, tap or click in the area highlighted in purple as shown.
![alt text](readme-images/wideview.png)
* Click or tap on `[VIEW]` and select Wide


## Compiling & Installing KAREL programs

Programs can be compiled and loaded onto virtual robot controllers in ROBOGUIDE as follows. Once compiled, they can be copied onto a flash drive and uploaded to real physical robots.

### Compiling and Installing in Roboguide
* Open the target robot project
* Add the source files (.kl for KAREL code, .ls for Teach Pendant code) by right clicking Files -> Add in the cell browser
![alt text](readme-images/add.png)
* For the HTTP interface, add all the KAREL wrapper files in `karel/http` and the motion backend `MOTION.LS` from `karel/motion`.
![alt text](readme-images/files.png)
* Right click Files -> Build -> All. There should be no errors.
* (Optional) Ensure that the programs are installed by looking for them in the Teach Pendant. Press SELECT to bring up the program menu. Ensure KAREL programs are desplayed by selecting `[TYPE]` -> ALL.
![alt text](readme-images/verify.png)
* The HTTP interface should now be working

### In Real Robot
The compiled programs need to be uploaded to the real robots, which can be done as follows. Ensure the programs are built, as described in the `Compiling and Installing in Roboguide` section.
* Copy the compiled `.pc` files (for KAREL) and `.TP` file (For Teach Pendant) onto a FAT32 flash drive. The compiled files can be found next to the source files (in `karel/http` and `karel/motion`).
* Once the transfer is complete, attach the flash drive to the physical Teach Pendant.
* On the Teach Pendant, select MENU -> FILE -> FILE
* Select `[UTIL]` -> Set Device -> USB on TP
* Select LOAD -> (all files)
* Select all the copied `.pc` and `.TP` files to load then.
* (Optional) Ensure that the programs are installed by looking for them in the Teach Pendant. Press SELECT to bring up the program menu. Ensure KAREL programs are desplayed by selecting `[TYPE]` -> ALL.
![alt text](readme-images/verify.png)
* The HTTP interface should now be working on the physical robot


## HTTP Interface
Commands can be sent to the HTTP interface using HTTP requests sent from a browser or Python script specifying the IP address of the robot (127.0.0.1 works if the robot is running in ROBOGUIDE on the same machine and will be used in these examples) as follows.

`127.0.0.1/KAREL/[command]`

where `[command]` can be the following.
* `appreset` - Initiate a fault reset (For example, after an unreachable position was sent to the robot). This is equivalent to clicking the fault reset button in ROBOGUIDE or pressing shift + reset on the Teach Pendant.
* `appmove` - Update position register target, `appmotion` must be called before to start the motion backend, and the Teach Pendant must be switched off. For more details, see the readme of [Ellis](https://github.com/afeldman/Ellis).
* To send joint commands, use the `jja` option, as follows:
`http://127.0.0.1/KAREL/appmove?motion_t=jja&coord1=0.0&coord2=0.0&coord3=0.0&coord4=0.0&coord5=-90.0&coord6=0.0`
![alt text](readme-images/jja.png)
* To send commands in world frame (absolute position offsets in mm from the robot frame origin), use the `lca` option, as follows.
`http://127.0.0.1/KAREL/appmove?motion_t=lca&coord1=730&coord2=-150.0&coord3=800&coord4=-90.0&coord5=-45.0&coord6=30.0`
![alt text](readme-images/lca.png)
* It should be noted that currently, the wrapper will return a successful status even if the motion was unreachable. An unreachable position can be found via the error state returned by `appmonitor` or by looking at the teach Pendant. The robot should be reset (via 'appreset' or the teach Pendant) if the robot reaches a fault state.
* `appmotion` - Starts the motion backend
* `appmonitor` - Retrieves the robot position and error state in JSON format
* A normal state response looks like the following: `{ "joint": [ 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, -9.00000E+01, 0.00000E+00 ], "position": [ 5.40000E+02, -1.50000E+02, 5.50000E+02, -1.80000E+02, 2.50448E-06, 0.00000E+00 ], "error": [ 0,"R E S E T " ] }`
* An error state response looks like the following: `{ "joint": [ 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, -9.00000E+01, 0.00000E+00 ], "position": [ 5.40000E+02, -1.50000E+02, 5.50000E+02, -1.80000E+02, 2.50448E-06, 0.00000E+00 ], "error": [ 15018,"MOTN-018 Position not reachable (G:1) " ] }`
* `appabort` - Stops any running robot tasks, such as the motion backend. This is equivalent to pressing FCTN -> ABORT(ALL) on the Teach Pendant.


If you are prompted to login when invoking HTTP requests, it is required to set the HTTP authentication to unlocked, which can be done as follows.
* Open Teach Pendant
* Menu -> Setup -> Host Comm (Should be under window 2 number 9 if no additional options were chosen in Setup Step 8)
* Select HTTP
* Set Karel to UNLOCK

## Setup DPM
* Follow the DPM and Host Comm sections under [Configuration guide](https://github.com/gavanderhoorn/fanuc_dpm_mouse_demo) from the FANUC DPM Mouse Demo
* Set U Frame
* Menu -> 6. Setup -> 4. Frames
* Choose [Other] -> 3. User Frames
* Select SETIND and select 1

## Requesting Commands via Socket Messaging
WIP
WIP Repository for CPS API in Fanuc KAREL
45 changes: 0 additions & 45 deletions displacementloctest.py

This file was deleted.

Empty file removed driver/__init__.py
Empty file.
21 changes: 0 additions & 21 deletions driver/djangofrontend.py

This file was deleted.

52 changes: 0 additions & 52 deletions driver/fanucfrontend.py

This file was deleted.

30 changes: 0 additions & 30 deletions driver/httpfrontend.py

This file was deleted.

104 changes: 0 additions & 104 deletions fdpm_mdemo.py

This file was deleted.

36 changes: 0 additions & 36 deletions karel/console/print_utils.kl

This file was deleted.

Loading