ros / ros-overlay

Gentoo Overlay for ROS packages
33 stars 30 forks source link

OSRF car_demo #743

Open allenh1 opened 5 years ago

allenh1 commented 5 years ago

I can't seem to get the OSRF car demo to run.

the first wall: Getting nvidia-docker installed. This I think I did by creating a binary installer for it: sci-libs/nvidia-docker-bin which puts the debian files in the right spot (presumably).

I then start the plugin server.

sudo /opt/nvidia-docker/bin/nvidia-docker-plugin

Next, I tried to run the demo and got the following output.

$ ./run_demo.bash
Password: 
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
xauth:  /tmp/.docker.xauth not writable, changes will be ignored
xauth: (argv):1:  unable to read any entries from file "(stdin)"
chmod: changing permissions of '/tmp/.docker.xauth': Operation not permitted
... logging to /root/.ros/log/a3a5a05e-04d2-11e9-bb3a-0242ac110002/roslaunch-91a561436bea-78.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://91a561436bea:44307/

SUMMARY
========

PARAMETERS
 * /joy_node0/dev: /dev/input/js0
 * /joy_node1/dev: /dev/input/js1
 * /robot_description: <?xml version="1....
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /use_sim_time: True

NODES
  /
    fake_localization (fake_localization/fake_localization)
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    joy_node0 (joy/joy_node)
    joy_node1 (joy/joy_node)
    joystick_translator (car_demo/joystick_translator)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    rviz (rviz/rviz)
    spawn_urdf (gazebo_ros/spawn_model)
    very_inaccurate_odom (tf2_ros/static_transform_publisher)

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

setting /run_id to a3a5a05e-04d2-11e9-bb3a-0242ac110002
process[rosout-1]: started with pid [101]
started core service [/rosout]
process[gazebo-2]: started with pid [111]
Gazebo multi-robot simulator, version 8.6.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[ INFO] [1545363836.233647246]: Finished loading Gazebo ROS API Plugin.
[Msg] Waiting for master.
[ INFO] [1545363836.234703890]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
process[gazebo_gui-3]: started with pid [130]
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 172.17.0.2
No protocol specified
[Err] [RenderEngine.cc:725] Can't open display: :1
[Wrn] [RenderEngine.cc:93] Unable to create X window. Rendering will be disabled
[Wrn] [RenderEngine.cc:293] Cannot initialize render engine since render path type is NONE. Ignore this warning ifrendering has been turned off on purpose.
Gazebo multi-robot simulator, version 8.6.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Wrn] [GuiIface.cc:196] g/gui-plugin is really loading a SystemPlugin. To load a GUI plugin please use --gui-client-plugin 
process[robot_state_publisher-4]: started with pid [203]
[ INFO] [1545363836.591000513]: Finished loading Gazebo ROS API Plugin.
[Msg] Waiting for master.
[ INFO] [1545363836.592531606]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 172.17.0.2
[Wrn] [GuiIface.cc:294] Couldn't locate specified .ini. Creating file at "/root/.gazebo/gui.ini"
No protocol specified
[Err] [RenderEngine.cc:725] Can't open display: :1
[Wrn] [RenderEngine.cc:93] Unable to create X window. Rendering will be disabled
[Wrn] [RenderEngine.cc:293] Cannot initialize render engine since render path type is NONE. Ignore this warning ifrendering has been turned off on purpose.
No protocol specified
[Err] [GuiIface.cc:121] QXcbConnection: Could not connect to display :1
process[fake_localization-5]: started with pid [239]
Aborted (core dumped)
[gazebo_gui-3] process has died [pid 130, exit code 134, cmd /opt/ros/kinetic/lib/gazebo_ros/gzclient --verbose __name:=gazebo_gui __log:=/root/.ros/log/a3a5a05e-04d2-11e9-bb3a-0242ac110002/gazebo_gui-3.log].
log file: /root/.ros/log/a3a5a05e-04d2-11e9-bb3a-0242ac110002/gazebo_gui-3*.log
process[very_inaccurate_odom-6]: started with pid [358]
[ INFO] [1545363837.475722101, 1341.728000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1545363837.523102174, 1341.763000000]: Physics dynamic reconfigure ready.
process[joystick_translator-7]: started with pid [412]
process[joy_node0-8]: started with pid [484]
process[joy_node1-9]: started with pid [503]
[ERROR] [1545363838.303036210]: Couldn't open joystick /dev/input/js1. Will retry every second.
process[spawn_urdf-10]: started with pid [537]
process[rviz-11]: started with pid [570]
No protocol specified
QXcbConnection: Could not connect to display :1
================================================================================REQUIRED process [rviz-11] has died!
process has died [pid 570, exit code -6, cmd /opt/ros/kinetic/lib/rviz/rviz -d /tmp/workspace/src/car_demo/rviz/demo.rviz __name:=rviz __log:=/root/.ros/log/a3a5a05e-04d2-11e9-bb3a-0242ac110002/rviz-11.log].
log file: /root/.ros/log/a3a5a05e-04d2-11e9-bb3a-0242ac110002/rviz-11*.log
Initiating shutdown!
================================================================================
[rviz-11] killing on exit
[spawn_urdf-10] killing on exit
[joy_node1-9] killing on exit
[joy_node0-8] killing on exit
[joystick_translator-7] killing on exit
[very_inaccurate_odom-6] killing on exit
[fake_localization-5] killing on exit
[robot_state_publisher-4] killing on exit
[gazebo-2] killing on exit
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/gazebo_ros/spawn_model", line 32, in <module>
    import tf.transformations as tft
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf/__init__.py", line 28, in <module>
    from tf2_ros import TransformException as Exception, ConnectivityException, LookupException, ExtrapolationException
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 39, in <module>
    from .buffer_interface import *
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_ros/buffer_interface.py", line 32, in <module>
    import roslib; roslib.load_manifest('tf2_ros')
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/launcher.py", line 62, in load_manifest
    sys.path = _generate_python_path(package_name, _rospack) + sys.path
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/launcher.py", line 93, in _generate_python_path
    m = rospack.get_manifest(pkg)
  File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 167, in get_manifest
    return self._load_manifest(name)
  File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 211, in _load_manifest
    retval = self._manifests[name] = parse_manifest_file(self.get_path(name), self._manifest_name, rospack=self)
  File "/usr/lib/python2.7/dist-packages/rospkg/manifest.py", line 408, in parse_manifest_file
    from rosdep2.rospack import init_rospack_interface, is_ros_package, is_system_dependency, is_view_empty
  File "/usr/lib/python2.7/dist-packages/rosdep2/__init__.py", line 45, in <module>
    from .lookup import RosdepDefinition, RosdepView, RosdepLookup, \
  File "/usr/lib/python2.7/dist-packages/rosdep2/lookup.py", line 44, in <module>
    from .sources_list import SourcesListLoader
  File "/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py", line 49, in <module>
    from .gbpdistro_support import get_gbprepo_as_rosdep_data, download_gbpdistro_as_rosdep_data
  File "/usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py", line 21, in <module>
    from .rosdistrohelper import get_targets, get_release_file, PreRep137Warning
  File "/usr/lib/python2.7/dist-packages/rosdep2/rosdistrohelper.py", line 30, in <module>
    import rosdistro
  File "/usr/lib/python2.7/dist-packages/rosdistro/__init__.py", line 52, in <module>
    from .distribution_cache import DistributionCache  # noqa
  File "/usr/lib/python2.7/dist-packages/rosdistro/distribution_cache.py", line 34, in <module>
    from __future__ import print_function
KeyboardInterrupt
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

This looks promising.

xauth:  /tmp/.docker.xauth not writable, changes will be ignored
xauth: (argv):1:  unable to read any entries from file "(stdin)"

@archenroot any ideas?

@tfoote you were involved with this, right? Can you tell me where my output starts to be abnormal?

allenh1 commented 5 years ago

This is the output from the nvidia-docker-plugin side:

./nvidia-docker-plugin | 2018/12/20 22:42:38 Loading NVIDIA unified memory
./nvidia-docker-plugin | 2018/12/20 22:42:38 Loading NVIDIA management library
./nvidia-docker-plugin | 2018/12/20 22:42:38 Discovering GPU devices
./nvidia-docker-plugin | 2018/12/20 22:42:38 Provisioning volumes at /var/lib/nvidia-docker/volumes
./nvidia-docker-plugin | 2018/12/20 22:42:38 Serving plugin API at /run/docker/plugins
./nvidia-docker-plugin | 2018/12/20 22:42:38 Serving remote API at localhost:3476
./nvidia-docker-plugin | 2018/12/20 22:43:53 Received mount request for volume 'nvidia_driver_415.23'
./nvidia-docker-plugin | 2018/12/20 22:44:02 Received unmount request for volume 'nvidia_driver_415.23'
awesomebytes commented 5 years ago

I don't know what is that demo, but related to Nvidia docker running stuff with X I can copy paste what I wrote some time ago (and use for some ROS + Deep learning images):

The major tricks we needed to figure out are in these commands when running a docker container:

xhost +local:root; nvidia-docker run --net host --privileged -v $HOME:/shared -e DISPLAY=$DISPLAY -e LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH -v /tmp/.X11-unix:/tmp/.X11-unix:rw -it ros-object-recognition

What does all this mean? (vague descriptions from the top of my head)

xhost +local:root;

Allows graphical windows to be opened.

--net host

Allows the docker to use the same IP address than your computer. We need to do that to allow the Docker talk to the robots in our network (otherwise ports are blocked).

--privileged

Had something to do with nvidia-docker... or maybe exposing some USB port? I don't remember right now.

-v $HOME:/shared

Allows to have your machine $HOME directory accessible from inside of the docker in /shared. Easy to move things in and out.

-e DISPLAY=$DISPLAY

Necessary to open graphical windows inside of the Docker.

-e LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

nvidia-docker needed it for deep learning purposes.

-v /tmp/.X11-unix:/tmp/.X11-unix:rw

Needed to open graphical windows.

Maybe it helps you! Good luck!

On Fri, Dec 21, 2018, 14:46 Hunter L. Allen <notifications@github.com wrote:

I can't seem to get the OSRF car demo https://github.com/osrf/car_demo to run.

the first wall: Getting nvidia-docker installed. This I think I did by creating a binary installer for it: sci-libs/nvidia-docker-bin which puts the debian files in the right spot (presumably).

I then start the plugin server.

sudo /opt/nvidia-docker/bin/nvidia-docker-plugin

Next, I tried to run the demo and got the following output.

$ ./run_demo.bash Password: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES xauth: /tmp/.docker.xauth not writable, changes will be ignored xauth: (argv):1: unable to read any entries from file "(stdin)" chmod: changing permissions of '/tmp/.docker.xauth': Operation not permitted ... logging to /root/.ros/log/a3a5a05e-04d2-11e9-bb3a-0242ac110002/roslaunch-91a561436bea-78.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://91a561436bea:44307/

SUMMARY

PARAMETERS

  • /joy_node0/dev: /dev/input/js0
  • /joy_node1/dev: /dev/input/js1
  • /robot_description: <?xml version="1....
  • /rosdistro: kinetic
  • /rosversion: 1.12.14
  • /use_sim_time: True

NODES / fake_localization (fake_localization/fake_localization) gazebo (gazebo_ros/gzserver) gazebo_gui (gazebo_ros/gzclient) joy_node0 (joy/joy_node) joy_node1 (joy/joy_node) joystick_translator (car_demo/joystick_translator) robot_state_publisher (robot_state_publisher/robot_state_publisher) rviz (rviz/rviz) spawn_urdf (gazebo_ros/spawn_model) very_inaccurate_odom (tf2_ros/static_transform_publisher)

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

setting /run_id to a3a5a05e-04d2-11e9-bb3a-0242ac110002 process[rosout-1]: started with pid [101] started core service [/rosout] process[gazebo-2]: started with pid [111] Gazebo multi-robot simulator, version 8.6.0 Copyright (C) 2012 Open Source Robotics Foundation. Released under the Apache 2 License.http://gazebosim.org

[ INFO] [1545363836.233647246]: Finished loading Gazebo ROS API Plugin. [Msg] Waiting for master. [ INFO] [1545363836.234703890]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting... process[gazebo_gui-3]: started with pid [130] [Msg] Connected to gazebo master @ http://127.0.0.1:11345 [Msg] Publicized address: 172.17.0.2 No protocol specified [Err] [RenderEngine.cc:725] Can't open display: :1 [Wrn] [RenderEngine.cc:93] Unable to create X window. Rendering will be disabled [Wrn] [RenderEngine.cc:293] Cannot initialize render engine since render path type is NONE. Ignore this warning ifrendering has been turned off on purpose. Gazebo multi-robot simulator, version 8.6.0 Copyright (C) 2012 Open Source Robotics Foundation. Released under the Apache 2 License.http://gazebosim.org

[Wrn] [GuiIface.cc:196] g/gui-plugin is really loading a SystemPlugin. To load a GUI plugin please use --gui-client-plugin process[robot_state_publisher-4]: started with pid [203] [ INFO] [1545363836.591000513]: Finished loading Gazebo ROS API Plugin. [Msg] Waiting for master. [ INFO] [1545363836.592531606]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting... [Msg] Connected to gazebo master @ http://127.0.0.1:11345 [Msg] Publicized address: 172.17.0.2 [Wrn] [GuiIface.cc:294] Couldn't locate specified .ini. Creating file at "/root/.gazebo/gui.ini" No protocol specified [Err] [RenderEngine.cc:725] Can't open display: :1 [Wrn] [RenderEngine.cc:93] Unable to create X window. Rendering will be disabled [Wrn] [RenderEngine.cc:293] Cannot initialize render engine since render path type is NONE. Ignore this warning ifrendering has been turned off on purpose. No protocol specified [Err] [GuiIface.cc:121] QXcbConnection: Could not connect to display :1 process[fake_localization-5]: started with pid [239] Aborted (core dumped) [gazebo_gui-3] process has died [pid 130, exit code 134, cmd /opt/ros/kinetic/lib/gazebo_ros/gzclient --verbose name:=gazebo_gui __log:=/root/.ros/log/a3a5a05e-04d2-11e9-bb3a-0242ac110002/gazebo_gui-3.log]. log file: /root/.ros/log/a3a5a05e-04d2-11e9-bb3a-0242ac110002/gazebo_gui-3*.log process[very_inaccurate_odom-6]: started with pid [358] [ INFO] [1545363837.475722101, 1341.728000000]: waitForService: Service [/gazebo/set_physics_properties] is now available. [ INFO] [1545363837.523102174, 1341.763000000]: Physics dynamic reconfigure ready. process[joystick_translator-7]: started with pid [412] process[joy_node0-8]: started with pid [484] process[joy_node1-9]: started with pid [503] [ERROR] [1545363838.303036210]: Couldn't open joystick /dev/input/js1. Will retry every second. process[spawn_urdf-10]: started with pid [537] process[rviz-11]: started with pid [570] No protocol specified QXcbConnection: Could not connect to display :1 ================================================================================REQUIRED process [rviz-11] has died! process has died [pid 570, exit code -6, cmd /opt/ros/kinetic/lib/rviz/rviz -d /tmp/workspace/src/car_demo/rviz/demo.rviz name:=rviz __log:=/root/.ros/log/a3a5a05e-04d2-11e9-bb3a-0242ac110002/rviz-11.log]. log file: /root/.ros/log/a3a5a05e-04d2-11e9-bb3a-0242ac110002/rviz-11*.log Initiating shutdown!

[rviz-11] killing on exit [spawn_urdf-10] killing on exit [joy_node1-9] killing on exit [joy_node0-8] killing on exit [joystick_translator-7] killing on exit [very_inaccurate_odom-6] killing on exit [fake_localization-5] killing on exit [robot_state_publisher-4] killing on exit [gazebo-2] killing on exit Traceback (most recent call last): File "/opt/ros/kinetic/lib/gazebo_ros/spawn_model", line 32, in import tf.transformations as tft File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf/init.py", line 28, in from tf2_ros import TransformException as Exception, ConnectivityException, LookupException, ExtrapolationException File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_ros/init.py", line 39, in from .buffer_interface import * File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_ros/buffer_interface.py", line 32, in import roslib; roslib.load_manifest('tf2_ros') File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/launcher.py", line 62, in load_manifest sys.path = _generate_python_path(package_name, _rospack) + sys.path File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/launcher.py", line 93, in _generate_python_path m = rospack.get_manifest(pkg) File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 167, in get_manifest return self._load_manifest(name) File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 211, in _load_manifest retval = self._manifests[name] = parse_manifest_file(self.get_path(name), self._manifest_name, rospack=self) File "/usr/lib/python2.7/dist-packages/rospkg/manifest.py", line 408, in parse_manifest_file from rosdep2.rospack import init_rospack_interface, is_ros_package, is_system_dependency, is_view_empty File "/usr/lib/python2.7/dist-packages/rosdep2/init.py", line 45, in from .lookup import RosdepDefinition, RosdepView, RosdepLookup, \ File "/usr/lib/python2.7/dist-packages/rosdep2/lookup.py", line 44, in from .sources_list import SourcesListLoader File "/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py", line 49, in from .gbpdistro_support import get_gbprepo_as_rosdep_data, download_gbpdistro_as_rosdep_data File "/usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py", line 21, in from .rosdistrohelper import get_targets, get_release_file, PreRep137Warning File "/usr/lib/python2.7/dist-packages/rosdep2/rosdistrohelper.py", line 30, in import rosdistro File "/usr/lib/python2.7/dist-packages/rosdistro/init.py", line 52, in from .distribution_cache import DistributionCache # noqa File "/usr/lib/python2.7/dist-packages/rosdistro/distribution_cache.py", line 34, in from future import print_function KeyboardInterrupt [rosout-1] killing on exit [master] killing on exit shutting down processing monitor... ... shutting down processing monitor complete done

This looks promising.

xauth: /tmp/.docker.xauth not writable, changes will be ignored xauth: (argv):1: unable to read any entries from file "(stdin)"

@achenroot any ideas?

@tfoote https://github.com/tfoote you were involved with this, right? Can you tell me where my output starts to be abnormal?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ros/ros-overlay/issues/743, or mute the thread https://github.com/notifications/unsubscribe-auth/ABpFdFCkjKlWADZNvlm_l5HAlDUb_lUgks5u7Fl8gaJpZM4ZdThR .

tfoote commented 5 years ago

The first flag that I see is that it can't open the X display. awesomebytes references a bunch of things that need to be mounted through for X and nvidia. I have just put together a tool for running nvidia docker things at: https://github.com/tfoote/rocker which works under ubuntu so should provide a good jumping off point.

allenh1 commented 5 years ago

I have just put together a tool for running nvidia docker things at: https://github.com/tfoote/rocker which works under ubuntu so should provide a good jumping off point.

@tfoote nice work! This looks super useful! I'll definitely play with this some later.