Python vision sensor

Typically: "How do I... ", "How can I... " questions
Post Reply
polender
Posts: 5
Joined: 01 Feb 2022, 03:38

Python vision sensor

Post by polender »

Hello,
I'm having issues saving the image from the vision sensor on the dr20 robot.

I'm currently using python 3.9 and plan on implementing object recognition using a pre-trained machine learning model,
however, I am unable to save the image from the vision sensor.

I have the following code inside of a class that was created to control the robot:
image = self.sim.getVisionSensorCharImage(self.visionSensor)
print(image)
self.sim.saveImage(image, self.visionSensorResolution, 0, "test.jpg", 100)

The error that I am receiving is that one of the function's arguments is of an invalid type. However, everything as far as I can tell is correct based on the documentation in the regularAPI. Any help would be appreciated

coppelia
Site Admin
Posts: 10504
Joined: 14 Dec 2012, 00:25

Re: Python vision sensor

Post by coppelia »

Hello,

this appears to be working fine here. Did you check your arguments?
e.g. print(type(arg))

Cheers

Post Reply