How to build ROS1 source on NX

I didn’t get steps from ROS1 web site noetic/Installation - ROS Wiki . It’s binary packages installation instructions.

But for ROS2 you can get steps for building ROS 2 on Linux. <no title>

Thanks for your help!

ROS1 build
http://wiki.ros.org/melodic/Installation/Source

1 Like

Thank you fpsychosis! I got it!
Have a nice weekend!
Best Regards,
Kevin

1 Like

ubuntu 18.0 use ROS melodic, you cannot use Noetic, ROS and Ubuntu distros are paired, you cannot mixt them.

I would also be interested in building noetic from source on the jetson. Python3 would be really helpful… I tried it, but haven’t been too succesful.

I am building ROS1 fro mthe dockerfile below;
the default example has librealsense catkin workspace; other github repositories could be cloned to the src folder;
Dockerfile:

FROM nvcr.io/nvidia/l4t-base:r32.4.3
RUN apt-get update -y
RUN apt install -y wget software-properties-common apt-utils  curl git
RUN /bin/bash  -c 'echo "deb http://packages.ros.org/ros/ubuntu bionic main" > /etc/apt/sources.list.d/ros-latest.list'
RUN  apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
RUN apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE ||  apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key
RUN apt-key adv --keyserver keys.gnupg.net --recv-key C8B3A55A6F3EFCDE ||  apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C8B3A55A6F3EFCDE
RUN add-apt-repository "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic main" -u
RUN apt-get update -y
ENV TZ America/Los_Angeles
RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y tzdata git curl cmake wget mc mlocate 
RUN DEBIAN_FRONTEND="noninteractive" apt install -y ros-melodic-desktop clang-format ros-melodic-desktop-full python-pip python3-pip  python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential 
RUN apt update -y
#RUN rm -rf /var/lib/apt/lists
RUN  apt-get install -y librealsense2-dev librealsense2-utils
RUN apt install -y ros-melodic-ddynamic-reconfigure ros-melodic-rtabmap-ros
RUN dpkg-reconfigure --frontend noninteractive tzdata
RUN rm -rf /var/lib/apt/lists
WORKDIR /home/nvidia/ws
RUN wget https://github.com/IntelRealSense/librealsense/archive/v2.36.0.tar.gz && tar -xvf v2.36.0.tar.gz
RUN cd librealsense-2.36.0 && ls && mkdir build && cd build && cmake ../ -DFORCE_RSUSB_BACKEND=true -DBUILD_PYTHON_BINDINGS=true -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true && make -j8 && make install
RUN mkdir src && cd src &&  git clone https://github.com/intel-ros/realsense.git -b development 
#  && git clone https://github.com/slamtec/rplidar_ros
#COPY realsense-ros/occupancy src/occupancy
RUN rosdep init && rosdep update


RUN /bin/bash -c '. /opt/ros/melodic/setup.bash;  cd /home/nvidia/ws; rosdep install --from-paths src --ignore-src; catkin_make'

then docker image can be build e.g. with

docker build . -t ros1_nx

Then the whole thing [ example below is realsense example ] can be executed with e.g.:

 docker run -it --rm --net=host -e DISPLAY=$DISPLAY --ipc=host --privileged -v /tmp/.X11-unix/:/tmp/.X11-unix/ -v /tmp/argus_socket:/tmp/argus_socket --cap-add SYS_PTRACE ros1_nx:latest /bin/bash -c '. /opt/ros/melodic/setup.bash; source devel/setup.bash; roslaunch realsense2_camera rs_rtabmap.launch`

for graphical outputs xhost + will be required.
reference ROS2 Dockerfile container can be found here Intel realsense d435i on NX devkit - #11 by _av

FYI, here is a Dockerfile for building ROS2 Foxy on L4T R32.4 (Ubuntu 18.04):

Thank you for sharing!

./scripts/docker_build_all.sh 
building PyTorch torch-1.6.0-cp36-cp36m-linux_aarch64.whl, torchvision v0.7.0 (pillow), torchaudio v0.6.0
Building l4t-pytorch:r32.4.3-pth1.6-py3 container...
Sending build context to Docker daemon  156.2kB
Step 1/22 : ARG BASE_IMAGE
Step 2/22 : FROM ${BASE_IMAGE}
unauthorized: authentication required
probably it needs ngc nvidia cloud  authentication?

However, I aded explicitly FROM nvcr.io/nvidia/l4t-base:r32.4.3 instead of FROM ${BASE_IMAGE} to the foxy file and it seems to build with docker build .

Ah, thanks Andrei - normally I use this docker_build_ros.sh script, which specifies the BASE_IMAGE argument. However I just updated the repo to explicitly specify nvcr.io/nvidia/l4t-base:r32.4.3 in the Dockerfiles themselves for those who may be building them directly.

I’m roughly following this with but am basing it off an x86 image, but am running into an issue that rti-connext-dds is trying to get me to agree to a license agreement which sort of breaks the Docker build. I have the ENV DEBIAN_FRONTEND=noninteractive but that doesn’t seem to help in this case. I’ll ask over on the ROS2 side as well, but wondering if you had any ideas how to prevent the prompt so the Docker build can continue?

If this is an apt-get install command, you can run it with -y --no-install-recommends. And rosdep you can run with -y. If this is a rogue package, you may need to patch it or pipe in the desired character(s)

you may try

ARG RTI_NC_LICENSE_ACCEPTED=yes

from installation - How to accept the license agreement when building rti-connext-dds-5.3.1 with docker build? - Stack Overflow