micro_ros_setup icon indicating copy to clipboard operation
micro_ros_setup copied to clipboard

micro_ros_agent installation issue on ROS 2 Humble Ubuntu 22.04

Open TannerGilbert opened this issue 1 year ago • 11 comments

Issue template

  • Hardware description: PC, Ubuntu 22.04
  • RTOS: Ardupilot SITL
  • Installation type: micro_ros_setup
  • Version or commit hash: humble

Steps to reproduce the issue

Follow First micro-ROS Application on Linux. When creating and building the micro-ROS agent

ros2 run micro_ros_setup create_agent_ws.sh
ros2 run micro_ros_setup build_agent.sh

I run into the following error:

stderr: micro_ros_agent
CMake Error at /opt/ros/humble/share/fastrtps/cmake/fastrtps-dynamic-targets.cmake:37 (message):
Some (but not all) targets in this export set were already defined.

Targets Defined: eProsima_atomic

Targets not yet defined: fastrtps

Call Stack (most recent call first):
/opt/ros/humble/share/fastrtps/cmake/fastrtps-config.cmake:60 (include)
CMakeLists.txt:37 (find_package)

Expected behavior

micro-ROS agent installation works as expected and I can use it for working with Ardupilot.

Actual behavior

stderr: micro_ros_agent
CMake Error at /opt/ros/humble/share/fastrtps/cmake/fastrtps-dynamic-targets.cmake:37 (message):
Some (but not all) targets in this export set were already defined.

Targets Defined: eProsima_atomic

Targets not yet defined: fastrtps

Call Stack (most recent call first):
/opt/ros/humble/share/fastrtps/cmake/fastrtps-config.cmake:60 (include)
CMakeLists.txt:37 (find_package)

Additional information

Installing Fast-DDS from source didn't fix the issue for me either

TannerGilbert avatar Jan 13 '25 13:01 TannerGilbert

Hi Tanner, Any solution yet for fixing this? Thanks in advance.

seifseghiri avatar Jan 14 '25 11:01 seifseghiri

Did you figure out this issue? I'm experiencing the same error.

Targets Defined: eProsima_atomic

Targets not yet defined: fastrtps

starrtriaxle82 avatar Jan 27 '25 20:01 starrtriaxle82

No I haven't found a solution to this yet.

TannerGilbert avatar Jan 28 '25 09:01 TannerGilbert

I got the same problem as well ... hope someone can figure it out soon ... Before that, may i suggest you use a docker image instead with the following command

sudo docker run -it --rm --net=host microros/micro-ros-agent:humble udp4 --port 8888 -v6

this works for me at the moment.

but watch out for your ufw status, or else all connection requests will be blocked lol.

Ericc99 avatar Feb 13 '25 11:02 Ericc99

Using net=host and port 8888 is redundant, net=host opens everything. ufw is not installed by default on ubuntu. The errors explained are during configuration, not runtime, so I don't think the networking tips you have are related at all to the problems this ticket was created for.

Ryanf55 avatar Feb 13 '25 13:02 Ryanf55

@TannerGilbert did you resolve the problem ? I ran into the same issue.

p8410077 avatar Mar 19 '25 05:03 p8410077

No unfortunately I didn't solve this yet. The error only occurs on one of my devices though so currently I just run on a different one. The solution proposed by @Ericc99 should probably also solve the issue but I haven't tested it myself yet.

TannerGilbert avatar Mar 19 '25 12:03 TannerGilbert

Specifications: Ubuntu 22.04, Humble, AMD_64 Just ran into this error about 15 minutes ago, I resolved it on my system by removing my workspace, restarting my PC, then altering the install script a bit. Instead of:

mkdir microros_ws
cd microros_ws
git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup

I called:

mkdir -p microros_ws/src && cd microros_ws/src
git clone https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup -b humble

Also, instead of just running the two shell scripts back to back:

ros2 run micro_ros_setup create_agent_ws.sh
# Then
source install/local_setup.bash
# Then
ros2 run micro_ros_setup build_agent.sh
# Then
source install/local_setup.bash

I no clue if it was a string of luck because it doesn't seem to relate, but it might prove useful to someone in the future. That being said, if it resolves the issue for a couple people it will likely be worth closing.

CursedRock17 avatar Jul 18 '25 19:07 CursedRock17

It was a long time ago, but I think I found the issue. Which was that I accidentally installed a wrong version of eProsima and I believe it was installed in /opt/ or snap. Make sure no eProsima version is installed, outside of the one coming from installing ROS.

seifseghiri avatar Jul 18 '25 19:07 seifseghiri

I found the problem of mine is eProsima Micro XRCE-DDS Agent has files in /usr/local/lib

I fixed this by:

sudo rm -f /usr/local/bin/MicroXRCEAgent
sudo rm -rf /usr/local/lib/libuxr*
sudo rm -rf /usr/local/include/uxr
sudo ldconfig

#Then create micro-ros agent again.

pazel68 avatar Jul 19 '25 16:07 pazel68

I'm facing the same problem again today. While it seems to be fixed now, I'm unclear about the exact solution. I performed just two specific actions: reinstalling the ros-jazzy-rmw-fastrtps-* package and rebuilding the 'micro-xrce-dds' software. sudo apt reinstall ros-jazzy-rmw-fastrtps-* git clone https://github.com/eProsima/Micro-XRCE-DDS-Client.git and install it. I hope this could be helpful.

lijin166 avatar Jul 24 '25 15:07 lijin166