ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

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:

[env:esp32_node]
platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
board = esp32dev
framework = arduino
lib_deps =
    https://github.com/micro-ROS/micro_ros_arduino.git
build_flags =
    -L $PROJECT_DIR/.pio/libdeps/$PIOENV/micro_ros_arduino/src/esp32/
    -l microros
    -D ESP32
platform_packages =
  toolchain-xtensa32 @ ~2.80400.0
  framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git#2.0.2

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
0

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

Pablogs gravatar image

RCLCPP is not supported in micro-ROS. Take a look at the documentation: https://micro.ros.org/docs/concepts/c...

edit flag offensive delete link more

Question Tools

3 followers

Stats

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

Seen: 700 times

Last updated: May 09 '22