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

How to connect to SICK TIM LiDAR through docker?

asked 2020-12-14 08:01:41 -0600

Py gravatar image

I am able to connect to my SICK TIM LiDAR fine when running it from my machine. Here's the basic launch file:

<launch>

    <node name="sick_tim310_1" pkg="sick_tim" type="sick_tim310" respawn="false" output="screen">
    </node>

</launch>

However, when I try to containerise this with Docker it does not connect to the LiDAR via USB and I get the message:

process[sick_tim310_1-2]: started with pid [64]
/opt/ros/noetic/lib/sick_tim/sick_tim310: error while loading shared libraries: libdiagnostic_updater.so: cannot open shared object file: No such file or directory
[sick_tim310_1-2] process has died [pid 64, exit code 127, cmd /opt/ros/noetic/lib/sick_tim/sick_tim310 __name:=sick_tim310_1 __log:=/root/.ros/log/bc9ceac0-3e11-11eb-a6cb-50eb712545a4/sick_tim310_1-2.log].
log file: /root/.ros/log/bc9ceac0-3e11-11eb-a6cb-50eb712545a4/sick_tim310_1-2*.log

Here's the minimal Docker file:

FROM osrf/ros:noetic-desktop-full

RUN apt-get update && apt-get install -q -y nano && \
    apt-get update && apt-get install -q -y sudo git && \
    apt-get update && apt-get install -q -y usbutils && \
    apt-get update && apt-get install -q -y python3-wstool python3-rosdep ninja-build stow && \
    apt-get update && apt-get install -q -y ros-noetic-position-controllers && \
    apt-get update && apt-get install -q -y ros-noetic-effort-controllers && \
    apt-get update && apt-get install -q -y ros-noetic-joint-state-controller && \
    apt-get update && apt-get install -q -y ros-noetic-rosbridge-server && \
    apt-get update && apt-get install -q -y ros-noetic-sick-tim && \
    apt-get update && apt-get install -q -y python3-pip

RUN bash -c "source /opt/ros/noetic/setup.bash && \
             cd ~ && \
             mkdir -p /catkin_ws/src && \
             cd /catkin_ws/src && \
             catkin_init_workspace && \
             mkdir my_package"

COPY . /catkin_ws/src/my_package
WORKDIR ~

RUN bash -c "source /opt/ros/noetic/setup.bash && \
             cd /catkin_ws/ && \
             catkin_make"

RUN bash -c "chmod +x /catkin_ws/src/my_package/container_entrypoint.sh"

RUN bash -c "source /opt/ros/noetic/setup.bash && \
                       source /catkin_ws/devel/setup.bash && \
                       cd && \
                       sudo rm /etc/ros/rosdep/sources.list.d/20-default.list && \
                       cd /catkin_ws && \
                       rosdep init && \
                       rosdep update && \
                       rosdep install --from-paths src --ignore-src --rosdistro=noetic -y"

ENTRYPOINT ["/catkin_ws/src/my_package/container_entrypoint.sh"]

CMD ["bash"]

The container_entrypoint.sh script referenced is:

#!/bin/bash

set -e

source /opt/ros/noetic/setup.bash
source /catkin_ws/devel/setup.bash

exec "$@"

The container is run with this script:

#!/bin/bash

docker run -it \
    --rm \
    --privileged \
    --net=host \
    my_package:latest \
    /bin/bash -c \
    "
     roslaunch my_package my_package.launch
    "
export containerId=$(docker ps -l -q)

Could anyone point out what I might be doing wrong please?

edit retag flag offensive close merge delete

Comments

2

Is this library installed?

/opt/ros/noetic/lib/sick_tim/sick_tim310: error while loading shared libraries: libdiagnostic_updater.so: cannot open shared object file: No such file or directory

http://wiki.ros.org/diagnostic_updater

ruffsl gravatar image ruffsl  ( 2020-12-15 00:04:20 -0600 )edit

I thought this was but it turned out it was missing! This solved the problem. Thank you so much!!!!

Py gravatar image Py  ( 2020-12-15 00:51:25 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-12-15 03:56:31 -0600

Py gravatar image

As suggested in the first comment, diagnostic_updater was missing so installing this fixed the problem.

edit flag offensive delete link more

Comments

You'll want to mark this as the answer to note that the question was resolved.

ruffsl gravatar image ruffsl  ( 2020-12-15 09:25:32 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2020-12-14 08:01:41 -0600

Seen: 509 times

Last updated: Dec 15 '20