Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function for automatic "Get Position" when running a program on robot
This is what my "Get_Position" macro in my RDK station looks like:

The only thing I did was to copy the script from the post by Albert and paste it into the Macro. 
# Type help("robolink") or help("robodk") for more information
# Press F5 to run the script
# Documentation:
# Reference:
# Note: It is not required to keep a copy of this file, your python script is saved with the station
#from robolink import *
RDK = Robolink()
robot = RDK.Item('',ITEM_TYPE_ROBOT)
if robot.Connect() > 0:
  raise Exception("Unable to connect to robot")

Is that what you meant by "Did you "import" Robolink in your python program."? 

I have attached my station.

.rdk   Forum_GetPosition_SimulationFreeze.rdk (Size: 9.92 MB / Downloads: 97)
simply uncomment line 6 and it should work.

Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


Users browsing this thread:
1 Guest(s)