Page 1 of 1

Python vision sensor

Posted: 25 Apr 2022, 01:08
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

Re: Python vision sensor

Posted: 25 Apr 2022, 09:21
by coppelia
Hello,

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

Cheers