Livox-SDK / livox_ros_driver2

Livox device driver under Ros(Compatible with ros and ros2), support Lidar HAP and Mid-360.
Other
275 stars 232 forks source link

ROS1 node on crashes on Rasbpian Bulleye 32 (Docker) #130

Closed RomanStadlhuber closed 4 months ago

RomanStadlhuber commented 5 months ago

This issue is created in reference to #33 on Livox-SDK2.

I am using a Raspberry Pi 4 with Raspberry Pi OS Bullseye 32-bit, on which I am running a docker container based on the image arm32v7/ros:noetic-perception-focal.

Specifically,

FROM arm32v7/ros:noetic-perception-focal as base
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install apt-utils wget locales -y -q
WORKDIR /catkin_ws
# install Livox-SDK2 which is a dependency for the ROS driver
WORKDIR /install
RUN git clone https://github.com/Livox-SDK/Livox-SDK2.git && cd ./Livox-SDK2 && \
    mkdir build && cd build && cmake .. && make -j && make install
# make VTK (https://docs.vtk.org/en/latest/index.html) symlink to version-less folder
RUN ln -s /usr/bin/vtk7 /usr/bin/vtk
# install mid360 driver
WORKDIR /catkin_ws/src
# clone the driver repo
RUN git clone https://github.com/Livox-SDK/livox_ros_driver2.git
RUN /bin/bash -c "source /opt/ros/noetic/setup.bash && /catkin_ws/src/livox_ros_driver2/build.sh ROS1"
# ...

which, when launching the driver node, immediately causes it to crash without any further messages/logs. I have found the issue linked above in the Livox-SDK2 repository, which mentions to modify some of the #pragma pack(..) statements. However, when modifying the few statements of this, all of which are contained in src/comm/comm.h, it does not change anything.

Unfortunately I don't yet know what the issue is here and I am still in the process of trying to find it out. I am writing this here in the hope that somebody else might have a clue.

Kind regards

RomanStadlhuber commented 4 months ago

I managed to fix it by modifying Line 148 of src/comm/comm.h from #pragma pack(1) to

#pragma pack(4)

which, in conjunction with the fix to the Livox-SDK2 (issue mentioned in the original question), got the ROS node working without any issues.

Many thanks go to the author of the fix!