Use of PolyScope Script Commands
Script Commands
The VIM-303 camera responds to several XML-RPC commands to control its operation. When a PolyScope program is started, the UR Cap creates a proxy (a software connection) to the camera to allow the sending of XML-RPC commands. This proxy variable is called vim303. This prefix is used to access the VIM-303 commands. Script nodes can be used to send commands to the VIM-303 camera and retrieve results in variables that can be used in the program. Below is a list of some of the XML-RPC commands that can be used in PolyScope programs.
boolean vim303.visual_object_present(object)
detects if objects are within the ROI of the camera
returns True,False based on whether object(s) are visible
usage examples:
vim303.visual_object_present("Brick") Single object
vim303.visual_object_present(["Brick","AnotherObject"]) List of objects
vim303.visual_object_present("anything") Any object (above the surface height)
vim303.visual_object_present("known") Any trained object
vim303.visual_object_present("unknown") Any object that wasn’t trained
string vim303.get_visual_pick_result()
result of the last visual pick
"success" object was detected and picked
"object_out_of_bounds" when picking a moving object that goes beyond the robot’s reach
"timeout" if a timeout is selected and no object is detected within that time
int vim303.get_num_objects_visible()
returns number of objects within ROI of the camera (of all types)
boolean vim303.set_surface_height(height)
set the surface height (in meters), representing the surface objects are sitting on
returns True
boolean vim303.set_setting(module, setting, value)
set a camera setting
module and setting must be in upper case with underscores
setting much match data type (look at setting in installation menu)
usage example:
vim303.set_setting("DEPTH_FINDER","ROI",[0.0, 0.0, 580.0, 399.0])
returns True
pose vim303.get_visual_pose(object)
locates an object and returns the location (pose) of it, to be stored in a waypoint variable
pose will be all zeros, checked by comparing to p[0,0,0,0,0,0] if no object is detected
useful with pose_add to create offsets from the object’s top center for visual placement or
offset picking of static objects or other vision guidance tasks
