0
$\begingroup$

I was just starting learning ROS2 and MicroROS; ROS2 seems to run fine, but when I tried following the tutorial ( https://micro.ros.org/docs/tutorials/core/first_application_linux/ ) to get started with MicroROS I get a strange error while building the Agent; I'm not really skilled with the software but I don't think I've done anything weird and found no clue on the internet, any suggestion?

ros2 run micro_ros_setup build_agent.sh
Building micro-ROS Agent
[1.185s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
    'builtin_interfaces' is in: /home/zayven/microros_ws/install/builtin_interfaces, /opt/ros/iron
    'micro_ros_msgs' is in: /home/zayven/microros_ws/install/micro_ros_msgs
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.

If you understand the risks and want to override a package anyways, add the following to the command line:
    --allow-overriding builtin_interfaces micro_ros_msgs

This may be promoted to an error in a future release of colcon-override-check.
Starting >>> builtin_interfaces
Starting >>> micro_ros_msgs
Finished <<< builtin_interfaces [2.53s]                                     
Finished <<< micro_ros_msgs [2.59s]                  
Starting >>> micro_ros_agent
--- stderr: micro_ros_agent                             
In file included from /home/zayven/microros_ws/src/uros/micro-ROS-Agent/micro_ros_agent/src/agent/Agent.cpp:18:
/home/zayven/microros_ws/src/uros/micro-ROS-Agent/micro_ros_agent/include/agent/Agent.hpp:18:10: fatal error: uxr/agent/AgentInstance.hpp: No such file or directory
   18 | #include <uxr/agent/AgentInstance.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zayven/microros_ws/src/uros/micro-ROS-Agent/micro_ros_agent/src/main.cpp:15:
/home/zayven/microros_ws/src/uros/micro-ROS-Agent/micro_ros_agent/include/agent/Agent.hpp:18:10: fatal error: uxr/agent/AgentInstance.hpp: No such file or directory
   18 | #include <uxr/agent/AgentInstance.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
compilation terminated.
gmake[2]: *** [CMakeFiles/micro_ros_agent.dir/build.make:76: CMakeFiles/micro_ros_agent.dir/src/main.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: *** [CMakeFiles/micro_ros_agent.dir/build.make:90: CMakeFiles/micro_ros_agent.dir/src/agent/Agent.cpp.o] Error 1
In file included from /home/zayven/microros_ws/src/uros/micro-ROS-Agent/micro_ros_agent/src/agent/graph_manager/graph_typesupport.cpp:18:
/home/zayven/microros_ws/src/uros/micro-ROS-Agent/micro_ros_agent/include/agent/graph_manager/graph_typesupport.hpp:28:10: fatal error: fastdds/dds/domain/DomainParticipant.hpp: No such file or directory
   28 | #include <fastdds/dds/domain/DomainParticipant.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zayven/microros_ws/src/uros/micro-ROS-Agent/micro_ros_agent/src/agent/graph_manager/graph_manager.cpp:18:
/home/zayven/microros_ws/src/uros/micro-ROS-Agent/micro_ros_agent/include/agent/graph_manager/graph_manager.hpp:28:10: fatal error: fastdds/dds/domain/DomainParticipant.hpp: No such file or directory
   28 | #include <fastdds/dds/domain/DomainParticipant.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
compilation terminated.
gmake[2]: *** [CMakeFiles/micro_ros_agent.dir/build.make:104: CMakeFiles/micro_ros_agent.dir/src/agent/graph_manager/graph_manager.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/micro_ros_agent.dir/build.make:118: CMakeFiles/micro_ros_agent.dir/src/agent/graph_manager/graph_typesupport.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/micro_ros_agent.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< micro_ros_agent [0.81s, exited with code 2]

Summary: 2 packages finished [4.33s]
  1 package failed: micro_ros_agent
  1 package had stderr output: micro_ros_agent
[ros2run]: Process exited with failure 2
$\endgroup$

3 Answers 3

0
$\begingroup$

I ran this tutorial a couple of weeks ago without any issue (for Humble though, not Iron).

However did you source the setup bash file before creating the agent? (i.e. source install/local_setup.bash)

$\endgroup$
0
$\begingroup$

In order to build microROS follow this instructions.

When building firmware, DO NOT source /opt/ros/$ROS_DISTRO/setup.bash, DO source dev_ws/install/setup.bash

When building agent(with agent_ws), DO source /opt/ros/$ROS_DISTRO/setup.bash, DO NOT source dev_ws/install/setup.bash

You'd better remove any setup like source /opt/ros/$ROS_DISTRO/setup.bash in your ~/.bashrc.

$\endgroup$
0
$\begingroup$

you need to rosdep update. look at the tutorials from robofuntastic on youtube. he has a playlist to control a simple 2 wheeled robpt with microros and he goes through the installation very well

$\endgroup$
1
  • $\begingroup$ Do you have a link? Could you be more specific as to which video? This seems more like a comment, rather than a solution. $\endgroup$ Commented Jun 24 at 1:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.