ROS - How to cross compile ROS for DRIVE AGX Developer Kit with DRIVE Software 10.0

I may have been trying to do something that wasn’t required.

But this command (run in chroot):

apt-get install libboost-all-dev libtinyxml-dev libtinyxml2-dev liblz4-dev libbz2-dev libapr1 libaprutil1 libconsole-bridge-dev libpoco-dev libgpgme-dev python-defusedxml python-rospkg python-catkin-pkg python-netifaces liblog4cxx-dev

also fails. apt-get can’t find these packages.

How should I proceed?

Thanks!

The file isn’t empty on my side. Could you help to check?

~/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/etc/apt/sources.list

These are the contents of that file now – I was just finishing a fresh install of the DriveWorks target tools after previous failures, which must be why it’s no longer empty:

# deb cdrom:[Ubuntu 18.04.4 LTS _Bionic Beaver_ - Release amd64 (20200203.1)]/ bionic main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner

deb [arch=amd64,i386] http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb [arch=amd64,i386] http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb [arch=amd64,i386] http://security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable

Does this look correct? Thanks for your help!

If anyone encounters the apt issue of DRIVE Software 10.0, please follow below post to work around it. Thanks!

@VickNV

On my fresh SDK Drive AGX install. I notice I dont have the DRIVE_Software_10.0_Linux_OS_E3550 but I do have the DRIVE_Software_10.0_Linux_OS_DDPX folder which matches the same contents.

Going further down on the procedure. I am getting the following messages:

root@obelisk:/usr/lib/aarch64-linux-gnu# sudo mkdir /lib/aarch64-linux-gnu
Unknown host QEMU_IFLA type: 50
Unknown host QEMU_IFLA type: 51
Unknown host QEMU_IFLA type: 47
Unknown host QEMU_IFLA type: 48
Unknown host QEMU_IFLA type: 43
Unknown host QEMU_IFLA type: 50
Unknown host QEMU_IFLA type: 51
Unknown host QEMU_IFLA type: 47
Unknown host QEMU_IFLA type: 48
Unknown host QEMU_IFLA type: 43
Unknown host QEMU_IFLA type: 50
Unknown host QEMU_IFLA type: 51
Unknown host QEMU_IFLA type: 47
Unknown host QEMU_IFLA type: 48
Unknown host QEMU_IFLA type: 43
Unknown host QEMU_IFLA type: 50
Unknown host QEMU_IFLA type: 51
Unknown host QEMU_IFLA type: 47
Unknown host QEMU_IFLA type: 48
Unknown host QEMU_IFLA type: 43
Unknown host QEMU_IFLA type: 50
Unknown host QEMU_IFLA type: 51
Unknown host QEMU_IFLA type: 47
Unknown host QEMU_IFLA type: 48
Unknown host QEMU_IFLA type: 43
Unknown QEMU_IFLA_BR type 46
Unknown QEMU_IFLA_BR type 41
Unknown QEMU_IFLA_BR type 45
Unknown QEMU_IFLA_BR type 42
Unknown QEMU_IFLA_BR type 43
Unknown QEMU_IFLA_BR type 44
/bin/mkdir: cannot create directory ‘/lib/aarch64-linux-gnu’: File exists
root@obelisk:/usr/lib/aarch64-linux-gnu# sudo mkdir /tmp/ros-cc-overlayfs
Unknown host QEMU_IFLA type: 50
Unknown host QEMU_IFLA type: 51
Unknown host QEMU_IFLA type: 47
Unknown host QEMU_IFLA type: 48
Unknown host QEMU_IFLA type: 43
Unknown host QEMU_IFLA type: 50
Unknown host QEMU_IFLA type: 51
Unknown host QEMU_IFLA type: 47
Unknown host QEMU_IFLA type: 48
Unknown host QEMU_IFLA type: 43
Unknown host QEMU_IFLA type: 50
Unknown host QEMU_IFLA type: 51
Unknown host QEMU_IFLA type: 47
Unknown host QEMU_IFLA type: 48
Unknown host QEMU_IFLA type: 43
Unknown host QEMU_IFLA type: 50
Unknown host QEMU_IFLA type: 51
Unknown host QEMU_IFLA type: 47
Unknown host QEMU_IFLA type: 48
Unknown host QEMU_IFLA type: 43
Unknown host QEMU_IFLA type: 50
Unknown host QEMU_IFLA type: 51
Unknown host QEMU_IFLA type: 47
Unknown host QEMU_IFLA type: 48
Unknown host QEMU_IFLA type: 43
Unknown QEMU_IFLA_BR type 46
Unknown QEMU_IFLA_BR type 41
Unknown QEMU_IFLA_BR type 45
Unknown QEMU_IFLA_BR type 42
Unknown QEMU_IFLA_BR type 43
Unknown QEMU_IFLA_BR type 44

so for fixing the symlinks: I get the following error:

root@obelisk:/tmp/ros-cc-overlayfs# sudo mount -t overlay -o lowerdir=$SYSROOT/lib/aarch64-linux-gnu,upperdir=/lib/aarch64-linux-gnu,workdir=/tmp/ros-cc-overlayfs overlay /lib/aarch64-linux-gnu
Unknown host QEMU_IFLA type: 50
Unknown host QEMU_IFLA type: 51
Unknown host QEMU_IFLA type: 47
Unknown host QEMU_IFLA type: 48
Unknown host QEMU_IFLA type: 43
Unknown host QEMU_IFLA type: 50
Unknown host QEMU_IFLA type: 51
Unknown host QEMU_IFLA type: 47
Unknown host QEMU_IFLA type: 48
Unknown host QEMU_IFLA type: 43
Unknown host QEMU_IFLA type: 50
Unknown host QEMU_IFLA type: 51
Unknown host QEMU_IFLA type: 47
Unknown host QEMU_IFLA type: 48
Unknown host QEMU_IFLA type: 43
Unknown host QEMU_IFLA type: 50
Unknown host QEMU_IFLA type: 51
Unknown host QEMU_IFLA type: 47
Unknown host QEMU_IFLA type: 48
Unknown host QEMU_IFLA type: 43
Unknown host QEMU_IFLA type: 50
Unknown host QEMU_IFLA type: 51
Unknown host QEMU_IFLA type: 47
Unknown host QEMU_IFLA type: 48
Unknown host QEMU_IFLA type: 43
Unknown QEMU_IFLA_BR type 46
Unknown QEMU_IFLA_BR type 41
Unknown QEMU_IFLA_BR type 45
Unknown QEMU_IFLA_BR type 42
Unknown QEMU_IFLA_BR type 43
Unknown QEMU_IFLA_BR type 44
mount: /lib/aarch64-linux-gnu: mount(2) system call failed: Too many levels of symbolic links.

Can you advise if the folder is correct and what could be causing the error on QEMU?

I haven’t seen the messages before. Is it due to “root” running with “sudo”?

@VickNV

I tried without sudo and got same output:

root@obelisk:/# mkdir /lib/aarch64-linux-gnu
/bin/mkdir: cannot create directory ‘/lib/aarch64-linux-gnu’: File exists
root@obelisk:/# mkdir /tmp/ros-cc-overlayfs
/bin/mkdir: cannot create directory ‘/tmp/ros-cc-overlayfs’: File exists
root@obelisk:/# mount -t overlay -o lowerdir=$SYSROOT/lib/aarch64-linux-gnu,upperdir=/lib/aarch64-linux-gnu,workdir=/tmp/ros-cc-overlayfs overlay /lib/aarch64-linux-gnu
mount: /lib/aarch64-linux-gnu: mount(2) system call failed: Too many levels of symbolic links.

Following with ROS steps: got also another error:

root@obelisk:/# apt --fix-broken install
Reading package lists… Done
Building dependency tree
Reading state information… Done
Correcting dependencies… Done
The following packages were automatically installed and are no longer required:
cuda-command-line-tools-10-2 cuda-compiler-10-2 cuda-cudart-dev-10-2
cuda-cuobjdump-10-2 cuda-cupti-10-2 cuda-driver-dev-10-2 cuda-gdb-10-2
cuda-gpu-library-advisor-10-2 cuda-memcheck-10-2 cuda-misc-headers-10-2
cuda-nvcc-10-2 cuda-nvdisasm-10-2 cuda-nvprof-10-2 cuda-nvprune-10-2
cuda-nvrtc-dev-10-2 cuda-nvtx-10-2 libcublas-dev libcublas10
Use ‘sudo apt autoremove’ to remove them.
The following additional packages will be installed:
python-catkin-pkg-modules python-rospkg-modules
The following NEW packages will be installed:
python-catkin-pkg-modules python-rospkg-modules
0 upgraded, 2 newly installed, 0 to remove and 302 not upgraded.
44 not fully installed or removed.
Need to get 0 B/65.9 kB of archives.
After this operation, 390 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
debconf: delaying package configuration, since apt-utils is not installed
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
(Reading database … 93408 files and directories currently installed.)
Preparing to unpack …/python-catkin-pkg-modules_0.4.22-1_all.deb …
Unpacking python-catkin-pkg-modules (0.4.22-1) …
dpkg: error processing archive /var/cache/apt/archives/python-catkin-pkg-modules_0.4.22-1_all.deb (–unpack):
trying to overwrite ‘/usr/lib/python2.7/dist-packages/catkin_pkg/init.py’, which is also in package python-catkin-pkg 0.3.9-1
Preparing to unpack …/python-rospkg-modules_1.2.8-1_all.deb …
Unpacking python-rospkg-modules (1.2.8-1) …
dpkg: error processing archive /var/cache/apt/archives/python-rospkg-modules_1.2.8-1_all.deb (–unpack):
trying to overwrite ‘/usr/lib/python2.7/dist-packages/rospkg/init.py’, which is also in package python-rospkg 1.1.4-1
Errors were encountered while processing:
/var/cache/apt/archives/python-catkin-pkg-modules_0.4.22-1_all.deb
/var/cache/apt/archives/python-rospkg-modules_1.2.8-1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Not sure if it is related to QEMU or mounting procedure. Can you advise?

Without “sudo”, you don’t see messages like “Unknown host QEMU_IFLA type: 50” anymore, right?

I haven’t seen the issue before. Please try with run all the steps in my initial post with non root user (using sudo as my command lines) and “export SYSROOT=~/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_DDPX/DRIVEOS/drive-t186ref-linux/targetfs_a” (matching your path after DRIVE Software 10.0 installation).

Correct. Without sudo I don’t see the QEMU_XXX messages anymore. I am going to try again the steps in couple systems where the SDK is installed and provide feedback.

@VickNV

I tried in a different system and got the same results. Can you advise?

Attaching log file with the stepsnvidia_ros.log (99.6 KB)

Thanks for sharing more complete log.

Only the three command lines need to be run in chroot. It seems you missed “exit”.

@VickNV

That’s correct. I missed the exit command. I also modified the cross compiler CMAKE file to get the correct path to the toolchain.

@VickNV

I tried to start another cross-compilation attempt on a third system but I am getting an error related " cannot find -lpthreads". I grep the source and I couldn’t find anything that points to directly use -lpthreads.so .

Attaching CMAKE error log but wondering what could change since my previous attempt which worked fine.

CMakeError.log (5.9 KB)

From the above steps, the last one throws this:

jvilela@soads-gpu-4:/opt/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_DDPX/DRIVEOS/drive-t186ref-linux/targetfs_a$ sudo mount -t overlay -o lowerdir=$SYSROOT/lib/aarch64-linux-gnu,upperdir=/lib/aarch64-linux-gnu,workdir=/tmp/ros-cc-overlayfs overlay /lib/aarch64-linux-gnu
mount: /lib/aarch64-linux-gnu: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error.

Hi @jpvans,

Could you refer to your previous setup system to figure out this? I believe it will be more efficient to solve the problem.

1 Like

@VickNV

The issue was related how the folders/partitions are mounted on my system. the upperdir and workdir should reside on the same mount location.

After fixing that, it is all good.

1 Like

Hi guys

When generating the “installed_isolated” tar file. Some scripts has the path /home/user/ros_catkin_ws.

My plan is to install on Pegasus at /opt/ros/melodic folder but running into issues due to the incorrect PATHs which I tried to correct but getting the following:

vidia@tegra-ubuntu:/opt/ros/melodic$ roscore
… logging to /home/nvidia/.ros/log/314dc206-1d18-11eb-8c31-00044bf65e6d/roslaunch-tegra-ubuntu-23045.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://tegra-ubuntu:38963/
ros_comm version 1.14.9

SUMMARY

PARAMETERS

  • /rosdistro: melodic
  • /rosversion: 1.14.9

NODES

RLException: roscore cannot run as another roscore/master is already running.
Please kill other roscore/master processes before relaunching.
The ROS_MASTER_URI is http://tegra-ubuntu:11311/
The traceback for the exception was written to the log file

Hi @jpvans,

Please help to create a new topic for this. Thanks!

Will do;

You may want to fix the conflicts with below commands first.

sudo dpkg -P python-catkin-pkg
sudo dpkg -P python-rospkg