MAVROS 2 Humble + Jammy Jellyfish Ubuntu 22.04 64bit + Pi4B setup, build warnings, 4 tests fail

from this Prerequisites it states that First, make sure that you have successfully installed ROS 2 Humble. so I can scroll down and get the instructions for the ROS 2 on Raspberry Pi

Does anyone know what it means to change to the directory linked above, then to the directory with your preferred variant in Clone the docker_images git repo onto the Raspberry Pi, change to the directory linked above, then to the directory with your preferred variant.

I am hoping the journey will lead me to MAVROS build / setup successfully on Pi4B eventually.

docker is up and running and cloned the docker_images.git

$ docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:

  1. The Docker client contacted the Docker daemon.
  2. The Docker daemon pulled the ā€œhello-worldā€ image from the Docker Hub.
    (arm32v7)
  3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
  4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
Overview of the get started guide | Docker Docs

$ git clone GitHub - osrf/docker_images: A repository to hold definitions of docker images maintained by OSRF
Cloning into ā€˜docker_imagesā€™ā€¦

[Edit]
SD card 1, Debian version: 11 (bullseye) 32-bit + Pi4B, failed attempt

1 Like

It seems like I need to switch the Pi OS to Ubuntu, Ubuntu 22.04.3 LTS (Jammy Jellyfish) 64-bit for tier 1 binary installation which is the most straightforward approach.

Is it true that MAVROS does not support ROS 2 Humble?
MAVROS is compatible with all recent versions of ROS including Kinetic, Melodic and Noetic.

any comments and experience to share. do you agree?
recently Mavros makes ROS 2 Humble basic requirement.

ROS2 Humble install done
MAVROS2 Humble install done
sudo apt-get install ros-humble-mavros
sudo apt-get install ros-humble-mavros-extras

ROS_VERSION=2
ROS_PYTHON_VERSION=3
ROS_DISTRO=humble

now stuck at Command ā€˜vcsā€™ not found, did you mean:

this is really confusing, should be this one but did not mention in the ardupilot document.

what is the expected completion for colcon build, it just no new message after Finished <<< ardupilot_msgs [41.6s], and I do Ctlr+C after a few minutes.

$colcon test --packages-select ardupilot_dds_tests
Starting >>> ardupilot_dds_tests
[6.708s] ERROR:colcon.colcon_core.task.python.test:Failed to find the following files:

  • /home/pi/ros2_ws/install/ardupilot_sitl/share/ardupilot_sitl/package.sh
  • /home/pi/ros2_ws/install/ardupilot_dds_tests/share/ardupilot_dds_tests/package.sh
    Check that the following packages have been built:
  • ardupilot_sitl
  • ardupilot_dds_tests
    Failed <<< ardupilot_dds_tests [0.20s, exited with code 1]
    Summary: 0 packages finished [4.71s]
    1 package failed: ardupilot_dds_tests

$colcon build --packages-up-to ardupilot_dds_tests
Starting >>> micro_ros_agent
Starting >>> ardupilot_msgs
[Processing: ardupilot_msgs, micro_ros_agent]
Finished <<< ardupilot_msgs [41.6s]

[2nd attempt]

okay it took very very very long to complete after second attempt on colcon build with warnings. 4 tests failed.

Finished <<< ardupilot_dds_tests [7.06s]
Summary: 4 packages finished [44min 54s]

stderr: micro_ros_agent
HEAD is now at c25243c Enable Domain Override on Reference and XML Participant (#351)
CMake Warning (dev) at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to find_package_handle_standard_args (tinyxml2)
does not match the name of the calling package (TinyXML2). This can lead
to problems in calling code that expects find_package result variables
(e.g., _FOUND) to follow a certain pattern.
Call Stack (most recent call first):
cmake/modules/FindTinyXML2.cmake:40 (find_package_handle_standard_args)
/opt/ros/humble/share/fastrtps/cmake/fastrtps-config.cmake:51 (find_package)
CMakeLists.txt:153 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

stderr: ardupilot_dds_tests
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(

Starting >>> ardupilot_dds_tests
[Processing: ardupilot_dds_tests]
[Processing: ardupilot_dds_tests]
Finished <<< ardupilot_dds_tests [1min 14s] [ with test failures ]
Summary: 1 package finished [1min 19s]
1 package had test failures: ardupilot_dds_tests
build/ardupilot_dds_tests/pytest.xml: 7 tests, 0 errors, 4 failures, 0 skipped

  • ardupilot_dds_tests.test.ardupilot_dds_tests.test_navsat_msg_received test_dds_serial_navsat_msg_recv
    failure message
    AssertionError: Did not receive ā€˜ap/navsat/navsat0ā€™ msgs.
    assert False

  • ardupilot_dds_tests.test.ardupilot_dds_tests.test_navsat_msg_received test_dds_udp_navsat_msg_recv
    failure message
    AssertionError: Did not receive ā€˜ap/navsat/navsat0ā€™ msgs.
    assert False

  • ardupilot_dds_tests.test.ardupilot_dds_tests.test_time_msg_received test_dds_serial_time_msg_recv
    failure message
    AssertionError: Did not receive ā€˜ROS_Timeā€™ msgs.
    assert False

  • ardupilot_dds_tests.test.ardupilot_dds_tests.test_time_msg_received test_dds_udp_time_msg_recv
    failure message
    AssertionError: Did not receive ā€˜ROS_Timeā€™ msgs.
    assert False

Summary: 7 tests, 0 errors, 4 failures, 0 skipped

[Edit]
roscore is dead in ROS2. so this statement needs to update.

does anyone know why Command ā€˜roslaunchā€™ not found, but can be installed with:
sudo apt install python3-roslaunch? Is it due to ROS2 base recommendation version I have installed?

source /opt/ros/humble/setup.bash already input into .bashrc

a search, I cannot find roslaunch, but can find ros2launch folder.

/opt/ros/humble/lib/python3.10/site-packages/ros2launch
/opt/ros/humble/share/ament_index/resource_index/packages/ros2launch
/opt/ros/humble/share/ros2launch

[edit]
found the answer. Didnā€™t install python3-roslaunch.
sudo chmod 666 /dev/ttyAMA1
ros2 launch mavros apm.launch fcu_url:=///dev/ttyAMA1:921600

SD card 2, Ubuntu 22.04.3 64-bit + Pi4B, successful attempt

Hi there,

It seems you have mixed together MAVROS, ROS1, roscore, ROS 2, ros2 launch, and roslaunch.

  • If an ArduPilot tutorial does not say ā€œROS 2ā€ in the title, itā€™s for ROS1.
  • ā€œros2 launchā€ is for ROS 2, `roslaunch" is ROS 1
  • Ardupilot works with MavROS in both ROS 1 and ROS 2
  • ArduPilot also has a DDS interface, which only works with ROS 2, since ROS 2 uses DDS as the middleware
  • You need to choose whether you want to use DDS or MavROS (MavLink) to communicate with ArduPilot.
  • If you need vcs, install ros-dev-tools: Ubuntu (Debian packages) ā€” ROS 2 Documentation: Humble documentation
  • If the ardupilot_dds_tests fails tests, I highly suspect you are missing a step or two from the docs. These tests are checked in CI on every merge and must pass on master branch.

I agree, that you should install Ubuntu 22.04 on your Pi. Unless you need docker, I would not add the complexity, unless you already know how to use docker.

Appreciate for reading my lengthy posts.

more than 100% sure I did not mix ROS 1 and 2 into one OS, I am on ROS2 humble all along. ROS development team did not put ROS 1 applications into consideration, migration effort is huge. I have update the posts to make it less confusing.

I got it from here without the ros-dev-tools.

So here is where I can come in and suggest, maybe contribute especially to developer new in this space or with Ardupilot flight stack. since there is huge differences between ROS 1 & 2, I would suggest the following changes to Ardupilot ROS documentation. The arrangement as well. There are specific sub-category for SITL, Gazebo, then it should have for connecting to ArduPilot as well. And I can tell you have to put up a few pointers to explain it.

Ya, for people who just wanted to explore creating new dish would not like to go into setting up a new kitchen in the process. It would be probably for companies in business. Now, minimally I can connect successfully with the real hardware and Arducopter flight stack.

Thank you for the pointers, I think I know which one is missing. Will update here if I can confirm that.

Got it. Yea, Henry and I were working on splitting the ROS/ROS2 category in two for that very reason.

Iā€™m glad you got it working.

If you can, please consider contributing how to get mavros working in ROS 2. Or, and updated Raspberry PI4B setup guide. Either would be super helpful. Itā€™s not explained in the wiki.

Could be because of these, so ā€¦
2023-09-09 version 2.6.0, dropped support for EOLed ROS2 releases. Now it require Humble+ (Humble, Iron, Rollingā€¦).

replace the guide here for ROS1 with the following. I believe that is the only magic I did differently from the guides.

sudo apt-get install ros-humble-mavros
sudo apt-get install ros-humble-mavros-extras

the rest I try to understand and follow the guides here and there between Ardupilot and ROS.org. Obstacles I faced during the journey, I already mentioned in the posts above. Hope it is helpful to the rest.

My guess Setup ROS 2 and micro-ROS is missing that is why the DDS tests failed.

$ colcon build
Starting >>> micro_ros_setup
Finished <<< micro_ros_setup [6.56s]
Summary: 1 package finished [11.3s]

but $source install/local_setup.bash seems like is not working which I do not understand why as there is no printout.

$ ros2 run micro_ros_setup create_agent_ws.sh
Package ā€˜micro_ros_setupā€™ not found

I did do the skip as mentioned in the guide
Skip the docker run command, build it locally instead
Skip ā€œCreating a new firmware workspaceā€
Skip ā€œBuilding the firmwareā€

redo the colcon build this time generate a warning and still yield the colcon test error (colcon test-result --all --verbose) with Package ā€˜micro_ros_setupā€™ still not found.

the build error seems to come from this file
~/ros2_ws/build/ardupilot_dds_tests/ardupilot_dds_tests.egg-info/SOURCES.txt line 3 from the eventlog ~/ros2_ws/log/build_2023-12-26_13-47-26/events.log

$ ros2 run micro_ros_setup create_agent_ws.sh
Package ā€˜micro_ros_setupā€™ not found

$ colcon build --packages-up-to ardupilot_dds_tests
Starting >>> micro_ros_agent
Starting >>> ardupilot_msgs
Finished <<< micro_ros_agent [2.55s]
Finished <<< ardupilot_msgs [4.25s]
Starting >>> ardupilot_sitl
[Processing: ardupilot_sitl]
Finished <<< ardupilot_sitl [54.4s]
Starting >>> ardupilot_dds_tests
stderr: ardupilot_dds_tests
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
Finished <<< ardupilot_dds_tests [4.78s]

Summary: 4 packages finished [1min 10s]
1 package had stderr output: ardupilot_dds_tests

setuptools 59.6.0 ā†’ 69.0.3

stderr by setuptools 69.0.3
Starting >>> ardupilot_dds_tests
stderr: ardupilot_dds_tests
/home/pi/.local/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.

    ********************************************************************************
    Please avoid running ``setup.py`` directly.
    Instead, use pypa/build, pypa/installer or other
    standards-based tools.

    See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
    ********************************************************************************

self.initialize_options()
Finished <<< ardupilot_dds_tests [5.99s]

stdout_stderr_59.6.0.log (1.6 KB)

stdout_stderr_69.0.3.log (2.5 KB)

Hello,

i had the same problem and decided to install setuptools version 58.2.0 with command

pip install setuptools==58.2.0


nowā€¦


andā€¦

Good stress :slight_smile:
Lada

1 Like

downgrade to 58.2.0, no more colcon build warning or error but the single or all test part still having the similar result.

repeating colcon build ā†’ colcon test ā†’ colcon build ā†’ colcon test also does not yield different result.

Name: setuptools
Version: 58.2.0
Summary: Easily download, build, install, upgrade, and uninstall Python packages
Home-page: GitHub - pypa/setuptools: Official project repository for the Setuptools build system
Author: Python Packaging Authority
Author-email: distutils-sig@python.org
License: UNKNOWN
Location: /home/pi/.local/lib/python3.10/site-packages
Requires:
Required-by: ament-black, ament-copyright, ament-cppcheck, ament-cpplint, ament-flake8, ament-index-python, ament-lint, ament-lint-cmake, ament-pep257, ament-uncrustify, ament-xmllint, catkin-pkg, catkin-pkg-modules, colcon-core, domain-coordinator, launch, launch-pytest, launch-ros, launch-testing, launch-testing-ros, launch-xml, launch-yaml, sros2, tf2-ros-py, tf2-tools

Starting >>> ardupilot_msgs
Starting >>> micro_ros_agent
Finished <<< micro_ros_agent [2.59s]
Finished <<< ardupilot_msgs [4.89s]
Starting >>> ardupilot_sitl
[Processing: ardupilot_sitl]
Finished <<< ardupilot_sitl [53.9s]
Starting >>> ardupilot_dds_tests
Finished <<< ardupilot_dds_tests [5.06s]

Summary: 4 packages finished [1min 10s]
Starting >>> ardupilot_dds_tests
[Processing: ardupilot_dds_tests]
[Processing: ardupilot_dds_tests]
Finished <<< ardupilot_dds_tests [1min 12s] [ with test failures ]
Summary: 1 package finished [1min 18s]
1 package had test failures: ardupilot_dds_tests
stdout_stderr.log (18.5 KB)

build/ardupilot_dds_tests/pytest.xml: 7 tests, 0 errors, 4 failures, 0 skipped

  • ardupilot_dds_tests.test.ardupilot_dds_tests.test_navsat_msg_received test_dds_serial_navsat_msg_recv
    failure message
    AssertionError: Did not receive ā€˜ap/navsat/navsat0ā€™ msgs.
    assert False

  • ardupilot_dds_tests.test.ardupilot_dds_tests.test_navsat_msg_received test_dds_udp_navsat_msg_recv
    failure message
    AssertionError: Did not receive ā€˜ap/navsat/navsat0ā€™ msgs.
    assert False

  • ardupilot_dds_tests.test.ardupilot_dds_tests.test_time_msg_received test_dds_serial_time_msg_recv
    failure message
    AssertionError: Did not receive ā€˜ROS_Timeā€™ msgs.
    assert False

  • ardupilot_dds_tests.test.ardupilot_dds_tests.test_time_msg_received test_dds_udp_time_msg_recv
    failure message
    AssertionError: Did not receive ā€˜ROS_Timeā€™ msgs.
    assert False

Summary: 7 tests, 0 errors, 4 failures, 0 skipped
events.log (58.4 KB)

ā€¦that sounds nice, weā€™ll fix it :slight_smile: , now it should be enough to just delete this build and make a new build ā€¦
Please delete all subdirectories /ros2_ws/ and reassemble according to the procedureā€¦

cd ~/ros2_ws/src
wget https://raw.githubusercontent.com/ArduPilot/ardupilot/master/Tools/ros2/ros2.repos
vcs import --recursive < ros2.repos
cd ā€¦
source /opt/ros/humble/setup.bash
sudo apt update
rosdep update
rosdep install --rosdistro ${ROS_DISTRO} --from-paths src -r
colcon build --cmake-args -DBUILD_TESTING=ON
source ./install/setup.bash
colcon test --packages-select ardupilot_dds_tests
colcon test-result --all --verbose

ā€¦one more useful link for test and other use AP_DDSā€¦

ā€¦I apologize for my bad English, itā€™s been many years since I finished my studies, so google translator works for me :smiley:

Good stress
Lada

Hi @lalal2017

Do you think is due to this, missing ros-humble-launch-pytest or version different?

mine version is ros-humble-launch-pytest is already the newest version (1.0.4-1jammy.20231117.181940)

I can give it another try next year first week.

your statement is different from the webpage.
rosdep install --from-paths src --ignore-src

:~/ros2_ws$ rosdep install --rosdistro ${ROS_DISTRO} --from-paths src -r
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
ardupilot_dds_tests: Cannot locate rosdep definition for [ardupilot_sitl]
ardupilot_sitl: Cannot locate rosdep definition for [micro_ros_agent]
Reading package listsā€¦
Building dependency treeā€¦
Reading state informationā€¦
The following additional packages will be installed:
python3-geographiclib
The following NEW packages will be installed:
python3-geographiclib python3-geopy
0 upgraded, 2 newly installed, 0 to remove and 5 not upgraded.
Need to get 95.5 kB of archives.
After this operation, 601 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 Index of /ubuntu-ports jammy/universe arm64 python3-geographiclib arm64 1.52-1 [33.8 kB]
Get:2 Index of /ubuntu-ports jammy/universe arm64 python3-geopy all 2.2.0-1 [61.7 kB]
Fetched 95.5 kB in 2s (46.7 kB/s)
Selecting previously unselected package python3-geographiclib.
(Reading database ā€¦ 260425 files and directories currently installed.)
Preparing to unpack ā€¦/python3-geographiclib_1.52-1_arm64.deb ā€¦
Unpacking python3-geographiclib (1.52-1) ā€¦
Selecting previously unselected package python3-geopy.
Preparing to unpack ā€¦/python3-geopy_2.2.0-1_all.deb ā€¦
Unpacking python3-geopy (2.2.0-1) ā€¦
Setting up python3-geographiclib (1.52-1) ā€¦
Setting up python3-geopy (2.2.0-1) ā€¦
Continuing to install resolvable dependenciesā€¦
executing command [sudo -H apt-get install python3-geopy]
#All required rosdeps installed successfully

ā€¦after ā€œrosdep install --rosdistro ${ROS_DISTRO} --from-paths src -r -yā€ that is the correct resultā€¦
Unfortunately, I canā€™t even translate the fw for CubeOrange in the latest version 4.5 dev master for ā€œroverā€. The resulting FW works, but DDS_client does not run in it. After checking the translation log, I found a missing declaration in the DDS_client build section. The test build ROS2 of the AP_DDS agent does not turn out without errors.
Because Iā€™m not a good programmer, Iā€™m not able to advise further, let alone remove it.
I have therefore postponed further testing, at least until the release of beta version FW 4.5.
I will hope that there will be some change in the sources.

Hi, are there any news to this topic, because I also get the same failure after running ā€œcolcon test --packages-select ardupilot_dds_testsā€. This is so frustrating and there are no real answers to this topic.

Please do not override system packages. This is a really good to break your system, the only benefit is you now have a clean terminal on something that doesnā€™t have any functional impact.

OSRF will solve the issue by the next ROS release. Our ticket already tracking this warning is here:

This log has the line:

[70.425661] (ardupilot_dds_tests) StdoutLine: {'line': b'[tty1 -4] bind failed on port 5760 - Address already in use\n'}

This means you have multiple terminals open running the same thing. Do NOT run SITL multiple times on the same computer with the same arguments. SITL cannot bind the port twice.

Thanks for posting the logs. Without these, it would not have been possible for me to tell you this was broken.

Please file a bug if there are compilation problems.

Tag me on Github so I can attach the ROS label.

Please include the terminal output for the compilation error, which operating system you are compiling on, which version of gcc you have, and the waf configure command you used so I can replicate it.

That said, the build of ROS 2 is currently passing in CI, so there are no errors on the ROS REP 2000 platform we support. You can see the stability of it here in the ā€œtest ddsā€ workflow history:

Itā€™s build using a docker container that is isolated, so it is a clean environment.