Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

UR5, CB2: custom progrobodk.script as station setting?

#1
tl;dr: is there a way to make the urapi driver use a custom version of its progrobodk.script without having to put that file in %ROBODK_INSTALL_DIR%\Bin?

And ideally, could that be a station / RoboDK configuration setting?

(just like post-processors are a station setting)

---

I'm helping someone getting RoboDK to work with their CB2 UR5.

The controller runs Polyscope 1.8, which isn't supported properly by RoboDK by default. I've read several threads on this forum about this issue (such as UR CB2 connection to RoboDK, Connect to UR5, and Getting Inputs from UR10 to RoboDK), and believe I have a good idea of why the apiur driver doesn't work without changes.

In summary, I've got most things to work after:
  • updating the progrobodk.script that apiur sends to the CB2 upon connection, and
  • patching the Universal_Robots.py post-processor (and others) to work with Polyscope 1.8
  • setting CONTROLLER_VERSION=1 in %AppData%\RoboDK-Drivers\apiur.exe.ini (not sure this is still needed though)

(thank you Alex Silva for the post-processor sources)

I've so far only been able to make urapi use my patched progrobodk.script by placing a copy in %ROBODK_INSTALL_DIR%\Bin.

While this works, it makes urapi always use the patched version, even with CB3 and e-Series controllers. This is not needed and actually breaks compatibility with those newer controllers.

Is there a way to configure urapi to use a specific, custom version of progrobodk.script as a station setting, or perhaps even a configuration setting in RoboDK? That way no modifications to the RoboDK installation would be necessary when switching between robots.

I've tried looking for information in the available documentation and online, but haven't been able to find any information about custom progrobodk.scripts, hence my post here. If there is a documentation on this subject, please point me to it.

Using RoboDK 5.9.0 on Windows, educational license.

---

Edit: I'd be willing to share my changes to the post-processors and progrobodk.scripts, but I'm not sure what the best way to do that would be. Post-processor files are licensed Apache-2.0, but seeing as they are not shipped with RoboDK by default, putting them on GitHub is probably not the best way to go about it.

---

Edit 2: to avoid duplication of effort: this same question was sent to RoboDK support by email, but perhaps this forum is a better venue to discuss this issue.
#2
Is this not possible / supported?
#3
We don't have an official way to customize the progrobodk.script file other than placing it in the bin folder. I'm sorry for the late reply.

However, setting the CONTROLLER_VERSION to 1 can be done by changin the file INI file in your appdata folder. For example, you should be able to find it here:
C:/Users/username/AppData/Roaming/RoboDK-Drivers/apiur.exe.ini
It should make the script compatible with the controller version 1.8.

One option to have support for different controllers on the same install of RoboDK is to create a copy of your driver binary. For example, you could copy the apiur.exe file in C:/RoboDK/api/robot/ and call it apiur18.exe. When you run this driver it will use an ini file that matches the name of the executable so you can customize different settings for this driver.

For your information, we published a new update this week that includes the DriverUR driver which is an improvement over the previous driver. However, I don't think it will work well with UR controller version 1.8.

We would love to have the improvement edits. You can attach them here or send them to us by email and we'll add them to RoboDK's default installer.
#4
Quote:We don't have an official way to customize the progrobodk.script file other than placing it in the bin folder.
that's unfortunate.

Would that be something you'd consider adding?

Being able to use different progrobodk.script and apiur.exe.ini per station (or even for different robots in the same station) would greatly increase UX with RoboDK.

---

In the meantime though I figured out that apiur essentially only checks the current working directory, so I wrote a Python wrapper that changes the CWD to where I have the custom progrobodk.script and then starts apiur.exe, forwarding stdin, stdout and stderr and returning its exit code (although in practice it never really exits).

The wrapper is then selected as a robot driver as part of the station configuration.

This seems to work, and technically I could place the customised progrobodk.script anywhere I'd like.

The only drawback of this approach is that RoboDK appears to only consider files in %ROBODK_INSTALL_DIR%\api\Robot when showing the robot driver selection dialog, so I have to put the wrapper script in that directory (either an actual copy or a symlink).


Quote:However, setting the CONTROLLER_VERSION to 1 can be done by changin the file INI file in your appdata folder. For example, you should be able to find it here:
C:/Users/username/AppData/Roaming/RoboDK-Drivers/apiur.exe.ini
It should make the script compatible with the controller version 1.8.
Setting CONTROLLER_VERSION to 1 was the first thing I tried, but that doesn't appear to be sufficient. RoboDK still attempts to use URScript statements that aren't supported by Polyscope 1.8 with that setting, and the progrobodk.script it generates is also incomplete and causes popups on the teach pendant ("Unexpected instruction restarting communications").

From testing, it seems as if CONTROLLER_VERSION only affects the contents of the DriverRoboDK program, which I'm already using a custom version of.

Keeping CONTROLLER_VERSION at its default 3 also seems to work now -- which is a good thing as it means less customisation of base RoboDK is needed keeping things compatible with newer Polyscope versions.


Quote:One option to have support for different controllers on the same install of RoboDK is to create a copy of your driver binary. For example, you could copy the apiur.exe file in C:/RoboDK/api/robot/ and call it apiur18.exe. When you run this driver it will use an ini file that matches the name of the executable so you can customize different settings for this driver.
As I described above I've done something similar, but with a Python wrapper file masquerading as a driver.

Not for the .ini though -- as that appears to not be needed anymore.


Quote:For your information, we published a new update this week that includes the DriverUR driver which is an improvement over the previous driver. However, I don't think it will work well with UR controller version 1.8.
I'll take a look, but if it has diverged even more from what DriverRoboDK and apiur.exe were/are doing, I don't expect it to help.


Quote:We would love to have the improvement edits. You can attach them here or send them to us by email and we'll add them to RoboDK's default installer.
Ok. It'll take a little while, but I'll reach out to you and get you the files.

Changes to the post-processor were minimal really.

progrobodk.script needed more changes/additions.


Quote:I'm sorry for the late reply.
no problem. Thank you for your reply.
#5
We just integrated the option to customize the path of the script file into the driver for UR robots. You should now see the variable PATH_SCRIPT which you can customize to point to the script file of your choice. This should be an absolute path of the script file or relative to the RoboDK binary.

You can use the new binary attached for Windows and replace it for the one in C:/RoboDK/api/robot/apiur.exe. It will be available by default with the next update of RoboDK.

Thank you for your valuable feedback! It helps us improve RoboDK.


Attached Files
.zip   apiur.zip (Size: 36.07 KB / Downloads: 46)
#6
Thank you for the updated driver.

I've just tried it, but I'm not sure something isn't working as it should or I'm doing something wrong.

I've overwritten the old version of apiur.exe with the version you attached to your post.

I then updated %AppData%\RoboDK-Drivers\apiur.exe.ini  to set PATH_SCRIPT to the absolute path of my custom progrobodk.script.

After updating my station to use the new driver (no longer my wrapper) and clicking Connect, the log shows:

...
Loading settings: C:/Users/user/AppData/Roaming/RoboDK-Drivers/apiur.exe.ini
MoveJ with Joints: Yes
MoveL with Joints: Yes
MoveL as: movel(...)
Controller Version: 3
Communication Timeout (ms): 1000
Path to UR script program: C:/progrobodk18.script
...

But Connection status stays on "Waiting..." and there is no indication on the CB2 side the script was successfully loaded and/or started.

A Wireshark capture seems to suggest apiur.exe attempted to upload the regular script, instead of my custom one. Backslashes or forward slashes in the path did not change the result.

Connection only succeeded with CONTROLLER_VERSION=1, but then apiur.exe still sent the built-in script, not my custom version, and prints the normal warning about limited/no IO support.

Finally: thanks again for updating the driver, but if I understand correctly, there is only a single apiur.exe.ini per driver binary. I assume your recommendation would be to make a copy of apiur.exe, rename it and use the corresponding .ini to load per-controller-version appropriate scripts?
#7
Good point, we didn't properly test but I believe we have a hint of the bug. We should be able to give you a new update this week. I'm sorry for the trouble. We'll test properly next time.

This is correct:
There is only a single apiur.exe.ini per driver binary. I assume your recommendation would be to make a copy of apiur.exe, rename it and use the corresponding .ini to load per-controller-version appropriate scripts.
#8
I attached the updated version which should properly account for the path to the custom UR script.

Let me know if you still have issues.


Attached Files
.zip   apiur.zip (Size: 36.68 KB / Downloads: 48)
#9
Thanks for the updated binary.

Some quick testing shows:
  • an absolute path works
  • a relative path works (but effectively requires placing script in sub dir of C:\RoboDK\bin)
  • backslashes in paths don't appear to work (could be user error: I've not checked documentation whether this is documented)

But also:
  • a relative path (in apiur.exe.ini) with embedded '..' seems to crash apiur.exe
  • if driver.exe and driver.py exist, and driver.exe is selected, driver.py seems to get started instead of driver.exe
  • pressing 'stop' in RoboDK doesn't actually stop the driver on the CB, at least not on CB2
  • pressing 'stop' in RoboDK also doesn't stop apiur.exe on Windows

the last bullet is probably not a really serious issue, however it is surprising when trying to change a setting in apiur.exe.ini, as those changes don't seem to get picked up, unless apiur.exe is actually killed before pressing Connect again.

Finally (but unrelated): you might consider updating the error message that gets printed when the driver can't connect to the controller due to an actual Connection refused error. I spent quite some time trying to figure out what was going wrong, only to end up realising I had forgotten to start Polyscope in my test VM.
  




Users browsing this thread:
1 Guest(s)