ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

SROS Docker and Ubuntu install fails due to missing dependencies etc.

asked 2018-07-24 05:59:57 -0500

Nitro24 gravatar image

Hello, i already stated this as a github issue Link, but got kindly redirected to ROS Answers with my issues.

Hello,

While trying to follow the official SROS Tutorials (http://wiki.ros.org/SROS/Tutorials), I had some issues when trying to start the sroskeyserver. The same errors also occur when running the prebuilt Docker container, so i suppose, that the problem is due to some inconsistencies in the SROS repository or its dependencies.

At first i've pulled the docker and tried to run the command from the install page:

docker run --rm -it \
osrf/sros \
bash -c "source /ros_entrypoint.sh && \
    sroskeyserver & \
    sleep 3 && \
    sroslaunch rospy_tutorials talker_listener.launch"

Somehow this runs into the following problem:

Traceback (most recent call last):
  File "/root/sros_catkin_ws/install/bin/sroskeyserver", line 2, in <module>
    import sros
  File "/root/sros_catkin_ws/install/lib/python2.7/dist-packages/sros/__init__.py", line 7, in <module>
    import rosgraph.sros_consts as sros_consts
  ImportError: No module named rosgraph.sros_consts
  Traceback (most recent call last):
  File "/root/sros_catkin_ws/install/bin/sroslaunch", line 2, in <module>
    import sros
  File "/root/sros_catkin_ws/install/lib/python2.7/dist-packages/sros/__init__.py", line 7, in <module>
    import rosgraph.sros_consts as sros_consts
  ImportError: No module named rosgraph.sros_consts

Therefore I checked the ros_comm package, which is not available in the Docker container as it is ignored by using an AMENT_IGNORE file.

./src/ros_comm/ros_comm/AMENT_IGNORE
./src/ros_comm/clients/AMENT_IGNORE
./src/ros_comm/tools/rostopic/AMENT_IGNORE
./src/ros_comm/tools/rosmsg/AMENT_IGNORE
./src/ros_comm/tools/roslaunch/AMENT_IGNORE
./src/ros_comm/tools/rosbag/AMENT_IGNORE
./src/ros_comm/tools/rosparam/AMENT_IGNORE
./src/ros_comm/tools/topic_tools/AMENT_IGNORE
./src/ros_comm/tools/rosnode/AMENT_IGNORE
./src/ros_comm/tools/rosbag_storage/AMENT_IGNORE
./src/ros_comm/tools/rosservice/AMENT_IGNORE
./src/ros_comm/tools/rosout/AMENT_IGNORE
./src/ros_comm/tools/rosconsole/AMENT_IGNORE
./src/ros_comm/tools/rosgraph/AMENT_IGNORE
./src/ros_comm/tools/rosmaster/AMENT_IGNORE
./src/ros_comm/test/AMENT_IGNORE
./src/ros_comm/utilities/AMENT_IGNORE

So I tried to remove the AMENT_IGNORE files, which (after building again) resulted at least in a usable ros_comm installation (i.e. import in python was working), however also resulted in "abandoned packages".

Furthermore i tried again to start the sroskeyserver, but there were some packages missing (cryptography, pyopenssl, apparmor).

After finally installing all of the missing dependencies, i ran into the following error trying to start the keyserver again:

root@5c14d417a2ec:~/sros_catkin_ws# sroskeyserver 
Starting an XML-RPC server to bootstrap SSL key distribution...
Traceback (most recent call last):
  File "/root/sros_catkin_ws/install/bin/sroskeyserver", line 3, in <module>
    sros.sroskeyserver_main()
  File "/root/sros_catkin_ws/install/lib/python2.7/dist-packages/sros/__init__.py", line 179, in sroskeyserver_main
    keyserver.start_keyserver(keyserver_config, keystore_path, keyserver_mode, port)
  File "/root/sros_catkin_ws/install/lib/python2.7/dist-packages/rosgraph/keyserver.py", line 143, in start_keyserver
    keyserver.stop()
UnboundLocalError: local variable 'keyserver' referenced before assignment

So this looks like an more in-depth error for me and since i used the official Docker image, I was wondering if there is already a known solution for this. Is SROS still maintained or should I check out SROS2? Even if SROS is not maintained anymore, I am ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-07-24 16:14:01 -0500

ruffsl gravatar image

Looks like catkin now ignores AMENT_IGNORE, and the holdover AMENT_IGNORE s from codebot are now effecting the build. This PR fixes the issue, as when I run the command from the install page using the new branch when rebuilding the dockerfile, the sample command from the readme continues to works: https://github.com/ros/ros_comm/pull/...

Alternately, you could remove them while building the dockerfile like so, by adding the last line.

# download sourcecode for sros
RUN rosinstall_generator \
      ros_comm \
      rospy_tutorials \
      --rosdistro ${ROS_DISTRO} \
      --deps \
      --tar > ${ROS_DISTRO}-ros_comm-wet.rosinstall && \
    wstool init -j8 . ${ROS_DISTRO}-ros_comm-wet.rosinstall && \
    rm -rf ros_comm && \
    git clone -b sros https://github.com/ros/ros_comm && \
    git clone -b sros https://github.com/ros-infrastructure/rospkg ../rospkg && \
    find ./ros_comm -name "AMENT_IGNORE" -print0 | xargs -0 rm -rf

As the original dev for SROS1, I haven't worked on this for some time. No surprise evolving dependencies and time would have broken things. Perhaps when I get some more time I'll refactor my original changes to ROS1 Melodic, and try and take a more modular approach to plugins using entry points. There has been some work from Bernhard Dieber et. al. in porting TLS support for roscpp that would be nice to incorporate as well to gain both rospy and roscpp support.

If your still currently evaluating different security concepts for ROS1, I might suggest looking through the book chapter SROS1: Using and Developing Secure ROS1 Systems from Robot Operating System (ROS) The Complete Reference (Volume 3), including the other cited works therein.

SROS2 however is the future, and thus receiving a lot more current development. There will be a SROS2 tutorial at IROS 2018 that I might also suggest for those interested. Complete tutorial materials should be posted on the events web site soon: https://ruffsl.github.io/IROS2018_SRO...

edit flag offensive delete link more

Comments

Thank you for your kind and fast answer. I was able to build a working image with your changes integrated into the dockerfile.

I've also taken a look into the Chapter and will check out SROS 2 soon, so thank you as well for these suggestions and information about the futurre of SROS(2).

Nitro24 gravatar image Nitro24  ( 2018-08-02 06:25:03 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-07-24 05:53:14 -0500

Seen: 366 times

Last updated: Jul 24 '18