Skip to content

Segmentation fault after connecting ROS 2 node to GNSS system #27

@behretv

Description

@behretv

Hardware Information

GNSS system: ADMA-Micro
Target computer: NVIDIA Jetson Orin AGX Devkit (aarch64 architecture)

Detailed Description

The ROS node was initialized inside a Docker container and the connection to the GNSS system could be established, but immediately terminates with exit code -11.

The docker image can be built by using the following Dockerfile:

FROM ros:iron

SHELL ["/bin/bash", "-c", "-o", "pipefail"]

ENV DEBIAN_FRONTEND=noninteractive \ 
  force_color_prompt=yes \
  PIP_DISABLE_PIP_VERSION_CHECK=true \
  RMW_IMPLEMENTATION="rmw_cyclonedds_cpp" \
  ROS_PACKAGE_PATH="/opt/ros/${ROS_DISTRO}" \
  ROS_ROOT="/opt/ros/${ROS_DISTRO}"

RUN apt-get update -y && \
  apt-get upgrade -y && \
  apt-get install -y --no-install-recommends \
  python3-pip \
  vim-tiny \
  ros-"${ROS_DISTRO}"-ament-cmake-clang-format \
  ros-"${ROS_DISTRO}"-rmw-cyclonedds-cpp \
  && rm -rf /var/lib/apt/lists/* \
  && apt-get clean

# Install ZED ROS wrapper
WORKDIR /tmp/colcon
RUN git config --global advice.detachedHead false \
  && source "${ROS_PACKAGE_PATH}/setup.bash" \
  && mkdir -p src/ \
  && git clone --depth 1 --branch ros2_v2.2.0 \
  --recursive https://github.com/GeneSysElektronik/adma_ros_driver.git \
  "src/adma_ros_driver" \
  && rosdep update \
  --include-eol-distros \
  --rosdistro="${ROS_DISTRO}" \
  && rosdep install \
  --from-paths src/ \
  --rosdistro "${ROS_DISTRO}" \
  --ignore-src -r -y  \
  && colcon build \
  --cmake-clean-first \
  --install-base "${ROS_ROOT}/install" \
  --merge-install \
  --ament-cmake-args " -Wno-dev" \
  && rm -rf \
  "build/" \
  "log/" \
  "src/" \
  "*.rosinstall" \
  /var/lib/apt/lists/* \
  && apt-get clean

RUN python3 -m pip install --no-cache-dir \
  pytest~=7.0

# Entry point source ROS
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint
ENTRYPOINT ["entrypoint"]
WORKDIR /app

where the scripts/entrypoint.sh used inside the Dockerfile contains:

#!/bin/bash
source_if_exists() {
  # shellcheck disable=SC1090
  if [[ -f $1 ]]; then echo "Sourcing: $1" && source "$1"; fi
}
source_if_exists "${ROS_PACKAGE_PATH}/setup.bash"
source_if_exists "${ROS_ROOT}/install/setup.bash"
exec "$@"

the build process was executed with the following command:

docker buildx create --use --name=multiarch
docker buildx build \
      -t <image-name> \
      --provenance=false \
      --platform linux/amd64,linux/arm64/v8 \
      --file Dockerfile \
       .
docker buildx rm --force multiarch

The ROS node was launched using the following command:

local_root="$(git rev-parse --show-toplevel)"

docker run \
  -t \
  --rm \
  --workdir=/app \
  --network=host \
  -v "${local_root}/config/gensys.yml":"/opt/ros/iron/install/share/adma_ros2_driver/config/driver_config.yaml" \
  -v "${local_root}":/app \
  <image-name> \
  bash -c "ros2 launch adma_ros2_driver adma_driver.launch.py"

with the config/gensys.yml file:

/**:
  adma_ros2_driver:
    ros__parameters:
      destination_ip: '<ip-address>'
      destination_port: 11021
      use_performance_check: False
      protocol_version: 'v3.3.5'
      frame_ids:
        navsatfix: 'gnss_link'
        imu: 'imu_link'
        adma: 'adma'
        adma_status: 'adma_status'
        raw_data: 'data_raw'
        odometry_pose_id: 'adma' # header.frame_id (basicly could be a "name" of desired POI)
        odometry_twist_id: 'odometry' # odometry.child_frame_id
      odometry_yaw_offset: 0.0 # in degrees
      topic_pois: # those values can be mixed individually
        navsatfix: 1 # either 1-8 for desired POI or 0 if MRP(Measurement Reference Point) is required
        imu: 1
        velocity: 1
        odometry: 1
      mode: 0 # 0 = live (default) / 1 = rosbag replay of raw data
      time_mode: 0 # 0 = ADMA INS time / 1 = ROS system time 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions