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

Package 'ros1_bridge' not found

asked 2022-10-05 05:52:07 -0500

siam gravatar image

updated 2022-10-06 02:01:31 -0500

gvdhoorn gravatar image

Hello , I am trying to build the ros1_bridge between ros 2 humble and ros 1 from Ubuntu packages. I am using docker (ubuntu 22 image) and I follow the instructions mentioned here https://docs.ros.org/en/humble/How-To... .

After building the bridge inside the docker container successfully (using the command : colcon build --symlink-install --cmake-force-configure) and sourcing the bridge workspace , I run the command : ros2 run ros1_bridge dynamic_bridge and I end up with error : Package 'ros1_bridge' not found. The package ros1_bridge is located in the src folder of the bridge workspace and also available in the install folder. Does anyone have a solution ? Thanks in advance.

Here is my dockerfile :

FROM ubuntu:jammy

CMD ["bash"]

RUN apt update && apt install locales
RUN locale-gen en_US en_US.UTF-8
RUN update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
RUN export LANG=en_US.UTF-8

RUN apt -y install software-properties-common
RUN add-apt-repository universe

RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1

RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        curl \
        wget \
        gnupg2 \
        lsb-release \
        ca-certificates \
    && rm -rf /var/lib/apt/lists/* \
    && apt-get clean

RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null

RUN apt-get update && \
    apt-get install -yq tzdata && \
    ln -fs /usr/share/zoneinfo/Europe/Germany /etc/localtime && \
    dpkg-reconfigure -f noninteractive tzdata

RUN apt update && apt install -y \
  build-essential \
  cmake \
  git \
  python3-colcon-common-extensions \
  python3-flake8 \
  python3-flake8-blind-except \
  python3-flake8-builtins \
  python3-flake8-class-newline \
  python3-flake8-comprehensions \
  python3-flake8-deprecated \
  python3-flake8-docstrings \
  python3-flake8-import-order \
  python3-flake8-quotes \
  python3-pip \
  python3-pytest \
  python3-pytest-cov \
  python3-pytest-repeat \
  python3-pytest-rerunfailures \
  python3-rosdep \
  python3-setuptools \
  python3-vcstool \
  wget

RUN mkdir -p ~/ros2_humble/src
WORKDIR /root/ros2_humble
RUN vcs import --input https://raw.githubusercontent.com/ros2/ros2/humble/ros2.repos src

RUN apt -y upgrade \
    && rosdep init \
    && rosdep update \
    && rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-6.0.1 urdfdom_headers"

WORKDIR /root/ros2_humble

RUN colcon build --symlink-install
#--------------------------------------------------------------------------------
RUN mkdir -p ~/bridging

RUN mkdir -p /root/bridging/ros2ws/src

WORKDIR /root/bridging/ros2ws

RUN . ~/ros2_humble/install/local_setup.sh \
    && colcon build 
#--------------------------------------------------------------------------------
RUN rm -r /etc/apt/sources.list.d/ros2.list
#--------------------------------------------------------------------------------
WORKDIR /root

RUN apt-get update \
    && apt remove -y python3-catkin-pkg-modules \
    && apt-get install -q -y --no-install-recommends ros-core-dev \
    && rm -rf /var/lib/apt/lists/*
#--------------------------------------------------------------------------------
RUN mkdir -p /root/bridging/ros1ws/src

WORKDIR /root/bridging/ros1ws

RUN export ROS_VERSION=1 \
    && catkin_make
#--------------------------------------------------------------------------------
RUN mkdir -p /root/bridging/bridgews/src

WORKDIR /root/bridging/bridgews/src

RUN git clone https://github.com/ros2/ros1_bridge.git
edit retag flag offensive close merge delete

Comments

2
  1. Did you source local_setup.sh before running ros1_bridge?
  2. Can you please verify the output of printenv | grep PYTHONPATH?
ravijoshi gravatar image ravijoshi  ( 2022-10-05 22:59:00 -0500 )edit
1
  1. yes I sourced local_setup.sh before running the ros1_bridge
  2. The PYTHONPATH is set.
siam gravatar image siam  ( 2022-10-06 05:27:36 -0500 )edit

I tried to reproduce your error. But the Dockerfile provided by you is not leading to a succesfull build...

nils_iseke gravatar image nils_iseke  ( 2022-10-06 23:20:26 -0500 )edit
1

Where are you compiling ros1_bridge? This dockerfile does not seem to be following the src build procedure documented in the Readme at https://github.com/ros2/ros1_bridge.git

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-10-08 08:39:57 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-10-08 13:30:16 -0500

marguedas gravatar image

If it helps, a similar question was answered at https://github.com/osrf/docker_images...

Suggesting to build the osrf/ros2:source(from https://github.com/osrf/docker_images/) and use it as a base image. Then build the ros1_bridge with a Dockerfile like the following:

FROM osrf/ros2:source

RUN rm /etc/apt/sources.list.d/ros2-latest.list

RUN apt-get update \
    && apt remove -y python3-catkin-pkg-modules \
    && apt-get install -q -y --no-install-recommends ros-core-dev \
    && rm -rf /var/lib/apt/lists/*

RUN mkdir -p $HOME/ros1_bridge/src
WORKDIR $HOME/ros1_bridge/src
RUN git clone https://github.com/ros2/ros1_bridge
RUN . /opt/ros2_ws/install/local_setup.sh \
  && MAKEFLAGS=-j2 colcon build
edit flag offensive delete link more

Question Tools

Stats

Asked: 2022-10-05 05:52:07 -0500

Seen: 687 times

Last updated: Oct 08 '22