Ask Your Question

Can't import <rclcpp/rclcpp.hpp> in micro-ros-arduino

asked 2022-05-02 16:21:32 -0500

Isn't rclcpp supposed to be supported in micro-ROS for arduino?

In my platformio project, #include <rcl/rcl.h> resolves fine, but #include <rclcpp/rclcpp.hpp> does not, giving me a No such file or directory error. This contradicts two other sources of information that suggest that rclcpp is supported:

  • This micro-ros example, and
  • Another post that states that rclcpp is supported in Micro-ROS (just not advertised).

Here are the relevant lines in my code:

#include <micro_ros_arduino.h>
#include <micro_ros_utilities/type_utilities.h>
#include <micro_ros_utilities/string_utilities.h>

#include <rcl/error_handling.h>
#include <rcl/rcl.h>
#include <rclc/executor.h>
#include <rclc/rclc.h>

#include <rclcpp/rclcpp.h>                <============= HERE


Here's my platformio configuration:

platform =
board = esp32dev
framework = arduino
lib_deps =
build_flags =
    -L $PROJECT_DIR/.pio/libdeps/$PIOENV/micro_ros_arduino/src/esp32/
    -l microros
    -D ESP32
platform_packages =
  toolchain-xtensa32 @ ~2.80400.0

And, the compilation error I get is:

Building in release mode
Compiling .pio/build/esp32_node/src/node.cpp.o
Archiving .pio/build/esp32_node/lib7fa/libSPI.a
Indexing .pio/build/esp32_node/lib7fa/libSPI.a
src/node.cpp:10:10: fatal error: rclcpp/rclcpp.h: No such file or directory
 #include <rclcpp/rclcpp.h>
compilation terminated.

So, all the rcl-related includes were found, but not the rclcpp one.

Please advise how to resolve this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-05-09 02:39:03 -0500

Pablogs gravatar image

RCLCPP is not supported in micro-ROS. Take a look at the documentation:

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2022-05-02 16:21:32 -0500

Seen: 68 times

Last updated: May 09