06-16-2022, 11:50 AM
Hello,
WINDOWFIXED and SNAPSHOT=640x480 parameters did not resolve the issue.
I noticed the issue was not present when adding a breakpoint on Cam2D_Add. Adding a pause after the clear_station call fixes it. The issue is not present when adding a camera to a station without deleting it first. The code below works for me.
WINDOWFIXED and SNAPSHOT=640x480 parameters did not resolve the issue.
I noticed the issue was not present when adding a breakpoint on Cam2D_Add. Adding a pause after the clear_station call fixes it. The issue is not present when adding a camera to a station without deleting it first. The code below works for me.
Code:
#!/usr/bin/python3
from robolink import * # API to communicate with RoboDK
from robodk import * # robodk robotics toolbox
RDK = Robolink()
def clear_station(rdk):
station_name = "Camera bug"
# If there was already a station for this script, delete it
station = rdk.Item(station_name)
try:
station.Delete()
except robolink.InputError as e:
pass
station = rdk.AddStation(station_name)
return station
station = clear_station(RDK)
pause(0.3)
virtual_camera = RDK.Cam2D_Add(item_object=station, cam_params="FOCAL_LENGTH=1.93 FOV=65.5 SIZE=640x480")
filename = "/tmp/bug.png"
RDK.Cam2D_Snapshot(file_save_img=filename)
Please read the论坛Guidelinesbefore posting!
Find useful information about RoboDK by visiting ourOnline Documentation.
Find useful information about RoboDK by visiting ourOnline Documentation.