micro-ROS / micro_ros_platformio

micro-ROS library for Platform.IO
Apache License 2.0
220 stars 79 forks source link

Running the example code on Ubuntu 20.04 #35

Closed b0hne closed 2 years ago

b0hne commented 2 years ago

Hi, I trying to port my projects from arduino ide to platformio. For this i tried creating a new portenta project in platformio and pasting the main.cpp and platformio.ini from your example code. this leaves me with the following error: Did i miss a step?

username@pc:~/Documents/PlatformIO/Projects/220706-095925-portenta_h7_m7$ pio run
Processing portenta_h7_m7 (platform: ststm32; board: portenta_h7_m7; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/portenta_h7_m7.html
PLATFORM: ST STM32 (15.4.1) > Arduino Portenta H7 (M7 core)
HARDWARE: STM32H747XIH6 480MHz, 511.35KB RAM, 768KB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, jlink, stlink)
PACKAGES: 
 - framework-arduino-mbed @ 3.1.1 
 - tool-dfuutil @ 1.11.0 
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Installing pyyaml with pip at PlatformIO environment
/home/sebastian/.platformio/penv/bin/python -m pip install pyyaml
Requirement already satisfied: pyyaml in /home/sebastian/.platformio/penv/lib/python3.8/site-packages (6.0)
Installing markupsafe==2.0.1 with pip at PlatformIO environment
/home/sebastian/.platformio/penv/bin/python -m pip install markupsafe==2.0.1
Requirement already satisfied: markupsafe==2.0.1 in /home/sebastian/.platformio/penv/lib/python3.8/site-packages (2.0.1)
Configuring portenta_h7_m7 with transport native_ethernet
micro-ROS already built
Found 38 compatible libraries
Scanning dependencies...
Dependency Graph
|-- micro_ros_platformio @ 0.0.1+sha.285dd94
Building in release mode
Compiling .pio/build/portenta_h7_m7/src/main.cpp.o
src/main.cpp:1:10: fatal error: micro_ros_arduino.h: No such file or directory

***************************************************************************
* Looking for micro_ros_arduino.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:micro_ros_arduino.h"
* Web  > https://registry.platformio.org/search?q=header:micro_ros_arduino.h
*
***************************************************************************

 #include <micro_ros_arduino.h>
          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling .pio/build/portenta_h7_m7/lib62b/micro_ros_platformio/platform_code/arduino/native_ethernet/micro_ros_transport.cpp.o
Archiving .pio/build/portenta_h7_m7/libFrameworkArduino.a
*** [.pio/build/portenta_h7_m7/src/main.cpp.o] Error 1
Indexing .pio/build/portenta_h7_m7/libFrameworkArduino.a
In file included from .pio/libdeps/portenta_h7_m7/micro_ros_platformio/platform_code/micro_ros_platformio.h:34:0,
                 from .pio/libdeps/portenta_h7_m7/micro_ros_platformio/platform_code/arduino/native_ethernet/micro_ros_transport.cpp:3:
.pio/libdeps/portenta_h7_m7/micro_ros_platformio/platform_code/arduino/native_ethernet/micro_ros_transport.h:1:10: fatal error: Ethernet.h: No such file or directory

******************************************************************
* Looking for Ethernet.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:Ethernet.h"
* Web  > https://registry.platformio.org/search?q=header:Ethernet.h
*
******************************************************************

 #include <Ethernet.h>
          ^~~~~~~~~~~~
compilation terminated.
*** [.pio/build/portenta_h7_m7/lib62b/micro_ros_platformio/platform_code/arduino/native_ethernet/micro_ros_transport.cpp.o] Error 1
================================================================================================================================================= [FAILED] Took 3.28 seconds
Acuadros95 commented 2 years ago

The examples for the arduino repository cant be used here directly, as for example the micro_ros_arduino.h has changed to micro_ros_platformio.h

Please refer to this repository example and adapt your code, feel free to ask for help if you encounter any problem.

Acuadros95 commented 2 years ago

Closing as problem is not related to micro_ros_platformio, reopen if needed.