Hey @Hytac,
sorry for the long delay in answering. Regarding your issue:
the URSim log displays nothing because according to your pic only errors are enabled
the cause of the issue could be related to the way you are publishing your script on the topic. Can you share the exact command? In this way we can properly reproduce it.
Using the Humble branch in Ubuntu 22.04, I am connected to a real UR (5.11.11.1010533) and a URSim (5.13.1).
Executing the ur_robot_driver:
ros2 launch ur_robot_driver ur10e.launch.py robot_ip:=xxxxx
After publishing the script to the topic, this is what the interface displays in the terminal:
[urscript_interface-4] [INFO 1693300316.661508772] [urscript_interface]: def root(): [urscript_interface-4] textmsg("Configure") [urscript_interface-4] write_output_boolean_register(80, False) [urscript_interface-4] write_output_boolean_register(70, False) [urscript_interface-4] write_output_boolean_register(71, True) [urscript_interface-4] write_output_boolean_register(72, False) [urscript_interface-4] write_output_boolean_register(73, False) [urscript_interface-4] write_output_boolean_register(74, True) [urscript_interface-4] sleep(1) [urscript_interface-4] textmsg("While") [urscript_interface-4] #while (read_input_boolean_register(70) == False): [urscript_interface-4] # sleep(0.01) [urscript_interface-4] #end [urscript_interface-4] [urscript_interface-4] textmsg("Run") [urscript_interface-4] write_output_boolean_register(70, True) [urscript_interface-4] sleep(1) [urscript_interface-4] [urscript_interface-4] textmsg("end") [urscript_interface-4] write_output_boolean_register(80, True) [urscript_interface-4] end [urscript_interface-4] root() [urscript_interface-4] [urscript_interface-4] [urscript_interface-4] (operator()() at /home/USER/ros/base/src/Universal_Robots_ROS2_Driver/ur_robot_driver/src/urscript_interface.cpp:55)
The URSim Log displays nothing,
However, the real system displays everything as expected:
Also, the boolean registers are set properly.
Things change when I uncomment the while loop:
[urscript_interface-4] [INFO 1693300857.186712038] [urscript_interface]: def root(): [urscript_interface-4] textmsg("Configure") [urscript_interface-4] write_output_boolean_register(80, False) [urscript_interface-4] write_output_boolean_register(70, False) [urscript_interface-4] write_output_boolean_register(71, True) [urscript_interface-4] write_output_boolean_register(72, False) [urscript_interface-4] write_output_boolean_register(73, False) [urscript_interface-4] write_output_boolean_register(74, True) [urscript_interface-4] sleep(1) [urscript_interface-4] textmsg("While") [urscript_interface-4] while (read_input_boolean_register(70) == False): [urscript_interface-4] sleep(0.01) [urscript_interface-4] end [urscript_interface-4] [urscript_interface-4] textmsg("Run") [urscript_interface-4] write_output_boolean_register(70, True) [urscript_interface-4] sleep(1) [urscript_interface-4] [urscript_interface-4] textmsg("end") [urscript_interface-4] write_output_boolean_register(80, True) [urscript_interface-4] end [urscript_interface-4] root() [urscript_interface-4] [urscript_interface-4] [urscript_interface-4] (operator()() at /home/USER/ros/base/src/Universal_Robots_ROS2_Driver/ur_robot_driver/src/urscript_interface.cpp:55)
Executing this in URSim displays nothing—no errors, no log traces. Executing this in the real UR system displays:
Also, the output boolean registers are not set.
This behavior doesn't make sense to me; similar behavior occurs when I define other functions.
This is what the script looks like, showing all the symbols
Using Polyscope, I'm able to load and run this script and many others with no problem.