udacity / CarND-Capstone

MIT License
190 stars 1.53k forks source link

Camera checkbox error in styx/bridge #317

Closed Horki closed 3 years ago

Horki commented 4 years ago

Related to issue #314 in styx/bridge.py 'publish_camera' https://github.com/udacity/CarND-Capstone/blob/master/ros/src/styx/bridge.py#L177-L183 when I turn on camera checkbox in a simulator I have error

message handler error
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/engineio/server.py", line 544, in _trigger_event
    return self.handlers[event](*args)
  File "/usr/local/lib/python2.7/dist-packages/socketio/server.py", line 509, in _handle_eio_message
    self._handle_event(sid, pkt.namespace, pkt.id, pkt.data)
  File "/usr/local/lib/python2.7/dist-packages/socketio/server.py", line 448, in _handle_event
    self._handle_event_internal(self, sid, data, namespace, id)
  File "/usr/local/lib/python2.7/dist-packages/socketio/server.py", line 451, in _handle_event_internal
    r = server._trigger_event(data[0], namespace, sid, *data[1:])
  File "/usr/local/lib/python2.7/dist-packages/socketio/server.py", line 480, in _trigger_event
    return self.handlers[namespace][event](*args)
  File "/capstone/ros/src/styx/server.py", line 60, in image
    bridge.publish_camera(data)
  File "/capstone/ros/src/styx/bridge.py", line 183, in publish_camera
    image_message = self.bridge.cv2_to_imgmsg(image_array, encoding="rgb8")
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/cv_bridge/core.py", line 248, in cv2_to_imgmsg
    img_msg.height = cvim.shape[0]
IndexError: tuple index out of range
Horki commented 4 years ago

I fix this problem by upgrading pillow to version 6.2.1 pip install pillow==6.2.1

Yuiry-IV commented 3 years ago

I have a same error, and didn't find anything helpful in udacity knowledge database =(

Thanks @Horki for hit, this solution is also work for me

UAnjali commented 3 years ago

Hi @Horki, We are closing out the issue because it has already been addressed in another issue recently.

Horki commented 3 years ago

Hi @Horki,

We are closing out the issue because it has already been addressed in another issue recently.

Thank you for quick reaponse 😅😅😅😀😁