DoF - a Robotiq Community
Warning sign
The Dof Community was shut down in June 2023. This is a read-only archive.
If you have questions about Robotiq products please reach our support team.
matthewd92

The only real way that I know of to keep the program totally hidden from the users eyes is to serve the script to the robot over one of the ports 30001, 30002 or I believe 30003.  There may be a way to load a program from another directory other than the programs directory that is then hidden from the user as they can only see the programs directory and its children from the touch pendant, unless they go into terminal mode then they have full access to the entire OS.

There is a specific format that it has to be sent in regarding indentation of the program lines.  You would need to define the entire program in script...or you could write the program in Polyscope, and take the compiled script and then serve that to the robot over one of those ports.  Doing that does not even require a program to be on the robot. 

We have done something similar in the past but we actually ran the program on the server and only sent the robot physical commands that it needed to execute such as move commands.  We kept the entire state of the robot on the server, using RTDE, as well as all logic and only sent the required commands to the robot.  You have to then keep track of positioning and distance on the robot from target position as there is no feedback about execution of the line and you can only send one line at a time as the next line sent would halt current execution and then start executing the new line.

Are you using E-Series or CB series?  The E-Series robots have some limitations around external programs executing in that they have to be in remote control mode to accept external commands and then certain things such as the move screen and free-drive button do not work as you have to be in local mode for that to work.  Also in remote control mode the play/pause/stop buttons on the teach pendant do not work so you have to provide an external system for that control which could just be hard wired buttons and set the inputs to be those actions.   CB series robots do not have these limitations.

Golden

The only real way that I know of to keep the program totally hidden from the users eyes is to serve the script to the robot over one of the ports 30001, 30002 or I believe 30003.  There may be a way to load a program from another directory other than the programs directory that is then hidden from the user as they can only see the programs directory and its children from the touch pendant, unless they go into terminal mode then they have full access to the entire OS.

There is a specific format that it has to be sent in regarding indentation of the program lines.  You would need to define the entire program in script...or you could write the program in Polyscope, and take the compiled script and then serve that to the robot over one of those ports.  Doing that does not even require a program to be on the robot. 

We have done something similar in the past but we actually ran the program on the server and only sent the robot physical commands that it needed to execute such as move commands.  We kept the entire state of the robot on the server, using RTDE, as well as all logic and only sent the required commands to the robot.  You have to then keep track of positioning and distance on the robot from target position as there is no feedback about execution of the line and you can only send one line at a time as the next line sent would halt current execution and then start executing the new line.

Are you using E-Series or CB series?  The E-Series robots have some limitations around external programs executing in that they have to be in remote control mode to accept external commands and then certain things such as the move screen and free-drive button do not work as you have to be in local mode for that to work.  Also in remote control mode the play/pause/stop buttons on the teach pendant do not work so you have to provide an external system for that control which could just be hard wired buttons and set the inputs to be those actions.   CB series robots do not have these limitations.

Thank you Matthew,
I'm having trouble sending the whole script through my C++ program.
Are .script the compiled files? if not, how to I obtain them? I'm currently running PolyScope sim on a desktop.
How should it be done? line by line to the same port?

Golden

Yes, the *.script file on the robot is the compiled script file of the program you wrote in polyscope, it will have the same name.  You would need to send this file line by line to the port, we use 30002 to send files to.  Also after each line we send the line break, `\n` command so that the server knows where to break lines up.  If you write your own script to send, indentation is important.  The body of the program has to be indented two spaces from the `def` and `end` statements that wrap the script like this.

def main():
  set_tcp(p[-4.4E-4, -0.00419, 0.42121, -0.78, 0.0, 0.0])
  freedrive_mode()
  sleep(5)
  end_freedrive_mode()
end

Other indentations inside the code can be made to make it easier to read as well, but the critical one is that the body of the code is indented at least 2 spaces from the opening and closing lines.
Amazing! It now works!!
I do have a small problem though:
Sending the last '\n' after the last "end", results in a java.lang.NullPointerException popup screen in Polyscope.
Any idea why? looked around, didn't find anything.
Trace file attached.
Program still runs and works.


Golden

Yes, the *.script file on the robot is the compiled script file of the program you wrote in polyscope, it will have the same name.  You would need to send this file line by line to the port, we use 30002 to send files to.  Also after each line we send the line break, `\n` command so that the server knows where to break lines up.  If you write your own script to send, indentation is important.  The body of the program has to be indented two spaces from the `def` and `end` statements that wrap the script like this.

def main():
  set_tcp(p[-4.4E-4, -0.00419, 0.42121, -0.78, 0.0, 0.0])
  freedrive_mode()
  sleep(5)
  end_freedrive_mode()
end

Other indentations inside the code can be made to make it easier to read as well, but the critical one is that the body of the code is indented at least 2 spaces from the opening and closing lines.
This works great! Thank you!
I do have a small problem though:
After I send the last '\n' (after the closing end of my program) and only then, I get a java.lang.NullPointerException popup. It does not effect the program, it needs to be taken care of. If I don't send the last '\n', the program doesn't start, ofcourse.

Any idea where this is coming from?

log file included.

Golden

Not sure, I checked our code and we send a new line character after every line we send. Have you tried not sending it on the last line?  
Yes, I have... sadly, program won't run if I do that :(

I think this might have something to do with the name of my program or the fact that there's no "main" in it. Is that a thing?

Update:
Right after the program starts, in the log tab, I get a Polyscope alert saying C0A0 as the code. nothing else is stated.

Golden

What's the name of your program? I know that one of the ones that we send over is not called main and we don't have issues with this.  According to the user manual a C0 code means no error.

Does the program play and then after playing you are getting the Java error or immediately before it starts playing?

Also, once you send the all of the program are you closing that socket connection or leaving it open?  Not sure if it matters but we close the socket and destroy it on the server side once the program is sent in its entirety.  Maybe the socket is remaining open and causing that Java error.
1) Prog3, Might not be the issue.
2) It plays and somewhere in the middle, I get the alert (which does not happen if I use Dashboard Server to load the program).
3) I close the socket on our end.

The track log(stack calls) states that it comes from a java function related to the GUI (com.ur.view.program.ProgramTrackingInformation.getMainProgram)



I really thank you for helping out! :)