You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I followed the example as shown for the visual_tracker.py example for another project I am working on, and my python ROS2 node always crashes when I call camera.getImageArray()
Instead, I was able to get the following code to work:
def get_image_from_camera( self ):
'''
Get an image from the camera. Per webots documentation, the method
getImage returns a byte string and it needs to be converted.
'''
img = self.camera.getImage()
imageRGBA = np.fromstring( img, dtype='uint8').reshape((self.camera.getHeight(), self.camera.getWidth(), 4))
return imageRGBA
Not sure if this is due to any recent webots changes as I am running the latest 2021b, but I wanted to let you know.
--Scott
The text was updated successfully, but these errors were encountered:
Hi,
I followed the example as shown for the visual_tracker.py example for another project I am working on, and my python ROS2 node always crashes when I call camera.getImageArray()
Instead, I was able to get the following code to work:
Not sure if this is due to any recent webots changes as I am running the latest 2021b, but I wanted to let you know.
--Scott
The text was updated successfully, but these errors were encountered: