udacity / CarND-Capstone

MIT License
189 stars 1.54k forks source link

using docker and sim #107

Closed AloshkaD closed 6 years ago

AloshkaD commented 6 years ago

When Using the provided docker container and the sim running nativaly, I get the following error when I execute "roslaunch launch/styx.launch"

message handler error Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/engineio/server.py", line 398, in _trigger_event return self.handlersevent 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 58, in image bridge.publish_camera(data) File "/capstone/ros/src/styx/bridge.py", line 180, 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

AloshkaD commented 6 years ago

Here is more information. Apparently all information are exchanged between the sim and docker except the images

Hi, I wonder if anyone has faced this problem The error is shown below for running the simulator on my local machine and the code execution on the docker image provided by udacity. I simply followed the steps in the capstone repo. It seems as if there is an issue with getting the images from the sim for traffic lights.

root@ca4804a2d52c:/capstone/trials/2/CarND-Capstone/ros# roslaunch launch/styx.launch … logging to /root/.ros/log/f94694be-b78f-11e7-8a2e-0242ac110002/roslaunch-ca4804a2d52c-4142.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ca4804a2d52c:33710/

SUMMARY PARAMETERS

/dbw_node/accel_limit: 1.0 /dbw_node/brake_deadband: 0.2 /dbw_node/decel_limit: -5.0 /dbw_node/fuel_capacity: 0.0 /dbw_node/max_lat_accel: 3.0 /dbw_node/max_steer_angle: 8.0 /dbw_node/steer_ratio: 14.8 /dbw_node/vehicle_mass: 1080.0 /dbw_node/wheel_base: 3 /dbw_node/wheel_radius: 0.335 /pure_pursuit/linear_interpolate_mode: True /rosdistro: kinetic /rosversion: 1.12.7 /traffic_light_config: <…> /waypoint_loader/path: /capstone/trials/… /waypoint_loader/velocity: 40 NODES / dbw_node (twist_controller/dbw_node.py) pure_pursuit (waypoint_follower/pure_pursuit) styx_server (styx/server.py) tl_detector (tl_detector/tl_detector.py) unity_simulator (styx/unity_simulator_launcher.sh) waypoint_loader (waypoint_loader/waypoint_loader.py) waypoint_updater (waypoint_updater/waypoint_updater.py)

auto-starting new master process[master]: started with pid [4153] ROS_MASTER_URI=http://localhost:11311

setting /run_id to f94694be-b78f-11e7-8a2e-0242ac110002 process[rosout-1]: started with pid [4166] started core service [/rosout] process[styx_server-2]: started with pid [4177] process[unity_simulator-3]: started with pid [4184] What is the full path to your Unity simulator? process[dbw_node-4]: started with pid [4190] process[waypoint_loader-5]: started with pid [4193] process[pure_pursuit-6]: started with pid [4205] (4177) wsgi starting up on http://0.0.0.0:4567 process[waypoint_updater-7]: started with pid [4235] process[tl_detector-8]: started with pid [4318] [INFO] [1508721467.700954]: Loading Tensorflow model into memory W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’t compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’t compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’t compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’t compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’t compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’t compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. (4177) accepted (‘172.17.0.1’, 51010) message handler error Traceback (most recent call last): File “/usr/local/lib/python2.7/dist-packages/engineio/server.py”, line 398, in _trigger_event return self.handlersevent 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 File “/capstone/trials/2/CarND-Capstone/ros/src/styx/server.py”, line 58, in image bridge.publish_camera(data) File “/capstone/trials/2/CarND-Capstone/ros/src/styx/bridge.py”, line 181, 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

Pleas help!

jokla commented 6 years ago

Hi @AloshkaD ! I have the same error. Have you solved it?

jokla commented 6 years ago

I solved with pip install pillow --upgrade inside the docker.

mvirgo commented 6 years ago

Looks like this was solved above; the project is now in a classroom workspace, so shouldn't have any further docker issues.

gokhanbarisaker commented 4 years ago

The recommended solution by @jokla works like a charm with a single adjustment. I am guessing latest pillow version (7.0.0 as of writing this command) is not compatible with python 2.7

To fix it, I had to fallback into 6.2.2

i.e., Pillow==6.2.2

iPhoring commented 4 years ago

yes Pillow=6.2.2 works. Thank you for sharing.