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

Live output from script in Terminal

#1
Hello,

when i work with the real robot, and not the Simulation, i am not able to recieve an output.

My Question now is how can i run my script, and output the "prints" on the screen, while running the program live on the robot? When i simulate the Program it works just fine.



the function that should output is : 

def record_position_callback():

    while callback_running:
        # Get the current position of the robot
        robot = RDK.Item('KUKA KR 16 2')

        # Print the current position
        data = robot.Pose().Pos()
        print("Robot Position:", data)

        data = RDK.LaserTracker_Measure()
        print("Laser Position:", data)

        # Wait for the specified interval
        time.sleep(0.01)  # 10 ms
#2
Do you mean that you are using the Run on robot option with your Python script in RoboDK?

You can provoke the same effect in debug mode by changing the RunMode:
Code:
RDK.setRunMode(RUNMODE_RUN_ROBOT)
You can find a more complete example here:
https://robodk.com/doc/en/PythonAPI/exam...rogramming
  




Users browsing this thread:
1 Guest(s)