RoboDK#Using 2D Camera Simulation Interface

Hello and I will explain how to use the 2D Camera Simulation interface in RoboDK and show you how to control it in Python.Let’s Start!

This is my RoboDK Version:

Import Camera

Let’s create a new station to import a robot.

In this example I chose UR5.

.

Click the earth icon.

Default browser is started and redirected to the RoboDK Library.

In the Left hand side – open the Type tab and choose Camera , Download the camera object that you liked.

Import that object to your station.

And then adjust the position.

Connect to Camera Simulation Interface

Go to Connect>Simulate 2D Camera.

Popup is shown.

Select the Camera object that you imported in the previous step.

Good! Camera interface is imported.

And Then Drop the Camera Inside the Camera Object.

You can just Double Click the Camera interface to activate it.

Camera Settings

Thanks to RoboDK, you can also set the camera parameter.

Right Click> Camera Settings.

There are so many basic parameters for Camera, And please try by yourself:)

I will not explain too much here.

You can activate your Camera interface first, then adjust the parameters to monitor their effect in real time.

Control By Python

Finally, I will show you how to control this interface in Python.

Click the python icon to insert a python script.

Prog1 is added.

Right Click>Edit Python Script.

You can make your own control program in here.

Code

Here is sample code to get the Camera object and Snapshot a photo.

from robodk import robolink    # RoboDK API
from robodk import robomath    # Robot toolbox
RDK = robolink.Robolink()


cam_item = RDK.Item(“Camera1”)
if not cam_item.Valid():
    print(‘No camera..’)
    quit()

snapshot_file=’C:\FTPFiles\p1.jpg’
ret=RDK.Cam2D_Snapshot(snapshot_file,cam_item)

Result

You can double click the script to run it.

And here is the result.

Source Code

https://github.com/soup01Threes/RoboDK/blob/main/Example_Camera.rdk

Footer_Basic

Please Support some devices for my blog

Amazon Gift List

Find ME

Twitter:@3threes2
Email:soup01threes*gmail.com (* to @)
YoutubeChannel:https://www.youtube.com/channel/UCQ3CHGAIXZAbeOC_9mjQiWQ

シェアする

  • このエントリーをはてなブックマークに追加

フォローする