Error running ros in docker conatiner
Hi
I am getting the following error when the simulator connects with the ros server. The roslaunch is successful. -
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/engineio/server.py", line 505, 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 44, in control
bridge.publish_controls(data)
File "/capstone/ros/src/styx/bridge.py", line 145, in publish_controls
self.publishers['steering_report'].publish(self.create_steer(steering))
File "/capstone/ros/src/styx/bridge.py", line 102, in create_steer
st.steering_wheel_angle_cmd = val * math.pi/180.
AttributeError: 'SteeringReport' object has no attribute 'steering_wheel_angle_cmd'
I am trying to run this app in a docker container. The are the steps I followed -
git clone https://github.com/udacity/CarND-Capstone
cd CarND-Capstone
docker build . -t capstone
docker run -p 4567:4567 -v $PWD:/capstone -v /tmp/log:/root/.ros/ --rm -it capstone
from inside the container, I run the following commands
cd /capstone/ros
catkin_make
source devel/setup.sh
roslaunch launch/styx.launch
I was able to verify that the dbw_mkz_msgs
package is available on the conatiner at /opt/ros/kinetic/share
path. When the same code is run on VirtiualBox I do not get this error. It could be the way docker sources ENV variables. Any help with this will be greatly appreciated.
Asked by vkajjam on 2019-05-09 22:26:37 UTC
Answers
I was able to fix the error by taking these steps -
- Downloading the
dbw_mkz_msgs
module toros/src
- Running
pip install pillow --upgrade
inside the container
It was an issue with the package path.
Asked by vkajjam on 2019-05-10 08:33:31 UTC
Comments
I also faced the above issue and the proposed solution didn't resolve. After some digging around, it appears that an update to the dbw_mkz_msgs
package has renamed steering_wheel_angle_cmd to steering_wheel_angle. The recommended solution is to downgrade the dbw_mkz_msgs
package to 1.1.1:
sudo apt-get install ros-$ROS_DISTRO-dbw-mkz=1.1.1* ros-$ROS_DISTRO-dbw-mkz-msgs=1.1.1* ros-$ROS_DISTRO-dbw-mkz-can=1.1.1* ros-$ROS_DISTRO-dbw-mkz-description=1.1.1* ros-$ROS_DISTRO-dbw-mkz-joystick-demo=1.1.1*
Update: it appears the issue has been resolved and pushed to a new version on github.
Asked by MoatazElmasry on 2019-08-28 15:35:34 UTC
Comments