micro-ros / micro_ros_platformio Goto Github PK
View Code? Open in Web Editor NEWmicro-ROS library for Platform.IO
License: Apache License 2.0
micro-ROS library for Platform.IO
License: Apache License 2.0
OR
microros_transport = serial
microros_distro = galactic
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio
code compiles with microros library
Warning! Ignore unknown configuration option `microros_transport` in section [env:esp32dev]
Warning! Ignore unknown configuration option `microros_distro` in section [env:esp32dev]
Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.5.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 3.10006.210326 (1.0.6)
- tool-esptoolpy 1.30100.210531 (3.1.0)
- toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
All required Python pip packages are installed
Configuring esp32dev with transport serial
micro-ROS dev already downloaded
Building micro-ROS dev dependencies
The system cannot find the path specified.
micro-ROS already downloaded
Building micro-ROS library
'.' is not recognized as an internal or external command,
operable program or batch file.
NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\Users\\Zinc\\HomeProjects\\micro_ros_platformio\\examples\\ESP32\\.pio\\libdeps\\esp32dev\\micro_ros_platformio/build/aux':
File "C:\Users\Zinc\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 181:
env.SConscript("$BUILD_SCRIPT")
File "C:\Users\Zinc\.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Script\SConscript.py", line 597:
return _SConscript(self.fs, *files, **subst_kw)
File "C:\Users\Zinc\.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Script\SConscript.py", line 285:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "C:\Users\Zinc\.platformio\platforms\espressif32\builder\main.py", line 233:
target_elf = env.BuildProgram()
File "C:\Users\Zinc\.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Util.py", line 742:
return self.method(*nargs, **kwargs)
File "C:\Users\Zinc\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 62:
env.ProcessProjectDeps()
File "C:\Users\Zinc\.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Util.py", line 742:
return self.method(*nargs, **kwargs)
File "C:\Users\Zinc\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 141:
project_lib_builder = env.ConfigureProjectLibBuilder()
File "C:\Users\Zinc\.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Util.py", line 742:
return self.method(*nargs, **kwargs)
File "C:\Users\Zinc\.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 1104:
project.install_dependencies()
File "C:\Users\Zinc\.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 922:
if _is_builtin(spec):
File "C:\Users\Zinc\.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 914:
for lb in self.env.GetLibBuilders():
File "C:\Users\Zinc\.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Util.py", line 742:
return self.method(*nargs, **kwargs)
File "C:\Users\Zinc\.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 1035:
lb = LibBuilderFactory.new(env, lib_dir)
File "C:\Users\Zinc\.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 61:
obj = getattr(sys.modules[__name__], clsname)(env, path, verbose=verbose)
File "C:\Users\Zinc\.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 149:
self.process_extra_options()
File "C:\Users\Zinc\.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 292:
self.env.SConscript(
File "C:\Users\Zinc\.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Script\SConscript.py", line 597:
return _SConscript(self.fs, *files, **subst_kw)
File "C:\Users\Zinc\.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Script\SConscript.py", line 285:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "C:\Users\Zinc\HomeProjects\micro_ros_platformio\examples\ESP32\.pio\libdeps\esp32dev\micro_ros_platformio\extra_script.py", line 74:
builder.run('{}/metas/{}'.format(main_path, selected_board_meta), cmake_toolchain.path, microros_user_meta)
File "C:\Users\Zinc\HomeProjects\micro_ros_platformio\examples\ESP32\.pio\libdeps\esp32dev\micro_ros_platformio\microros_utils\library_builder.py", line 153:
self.package_mcu_library()
File "C:\Users\Zinc\HomeProjects\micro_ros_platformio\examples\ESP32\.pio\libdeps\esp32dev\micro_ros_platformio\microros_utils\library_builder.py", line 220:
os.makedirs(self.build_folder + "/aux", exist_ok=True)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3312.0_x64__qbz5n2kfra8p0\lib\os.py", line 225:
mkdir(name, mode)
Compile without error
fails at step 7 c) with compiler error, see below for details
Folder to copy into "extra_packages"
/Arduino/libraries/micro_ros_arduino-2.0.5-humble/src/example_interfaces
Compiler error
undefined reference to
rosidl_typesupport_c__get_service_type_support_handle__example_interfaces__srv__AddTwoInts'`
platfomio.ini
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
board_microros_transport = serial
monitor_port = /dev/ttyUSB0
board_microros_distro = humble
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio
Include section
#include <Arduino.h>
#include <Wire.h>
#include <micro_ros_platformio.h>
#include <example_interfaces/srv/add_two_ints.h>
#include <stdio.h>
#include <rcl/error_handling.h>
#include <rclc/rclc.h>
#include <rclc/executor.h>
#include <std_msgs/msg/int64.h>
Source code
#include <Arduino.h>
#include <micro_ros_platformio.h>
#include <example_interfaces/srv/add_two_ints.h>
#include <stdio.h>
#include <rcl/error_handling.h>
#include <rclc/rclc.h>
#include <rclc/executor.h>
#include <std_msgs/msg/int64.h>
rcl_node_t node;
rclc_support_t support;
rcl_allocator_t allocator;
rclc_executor_t executor;
rcl_service_t service;
rcl_wait_set_t wait_set;
example_interfaces__srv__AddTwoInts_Response res;
example_interfaces__srv__AddTwoInts_Request req;
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){while(1){};}}
#define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}}
void service_callback(const void * req, void * res){
example_interfaces__srv__AddTwoInts_Request * req_in = (example_interfaces__srv__AddTwoInts_Request *) req;
example_interfaces__srv__AddTwoInts_Response * res_in = (example_interfaces__srv__AddTwoInts_Response *) res;
//printf("Service request value: %d + %d.\n", (int) req_in->a, (int) req_in->b);
res_in->sum = req_in->a + req_in->b;
}
void setup() {
set_microros_serial_transports(Serial);
Serial.begin(115200);
delay(1000);
allocator = rcl_get_default_allocator();
// create init_options
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
// create node
RCCHECK(rclc_node_init_default(&node, "add_twoints_client_rclc", "", &support));
// create service
RCCHECK(rclc_service_init_default(&service, &node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, AddTwoInts), "/addtwoints"));
// create executor
RCCHECK(rclc_executor_init(&executor, &support.context, 1, &allocator));
RCCHECK(rclc_executor_add_service(&executor, &service, &req, &res, service_callback));
}
void loop() {
delay(100);
RCSOFTCHECK(rclc_executor_spin_some(&executor, RCL_MS_TO_NS(100)));
}
Directory structure
extra_packages$ tree -L 3
.
└── example_interfaces
├── action
│ ├── detail
│ └── fibonacci.h
├── msg
│ ├── bool.h
│ ├── byte.h
│ ├── byte_multi_array.h
│ ├── char.h
│ ├── detail
│ ├── empty.h
│ ├── float32.h
│ ├── float32_multi_array.h
│ ├── float64.h
│ ├── float64_multi_array.h
│ ├── int16.h
│ ├── int16_multi_array.h
│ ├── int32.h
│ ├── int32_multi_array.h
│ ├── int64.h
│ ├── int64_multi_array.h
│ ├── int8.h
│ ├── int8_multi_array.h
│ ├── multi_array_dimension.h
│ ├── multi_array_layout.h
│ ├── rosidl_generator_c__visibility_control.h
│ ├── rosidl_typesupport_introspection_c__visibility_control.h
│ ├── rosidl_typesupport_microxrcedds_c__visibility_control.h
│ ├── string.h
│ ├── u_int16.h
│ ├── u_int16_multi_array.h
│ ├── u_int32.h
│ ├── u_int32_multi_array.h
│ ├── u_int64.h
│ ├── u_int64_multi_array.h
│ ├── u_int8.h
│ ├── u_int8_multi_array.h
│ └── w_string.h
└── srv
├── add_two_ints.h
├── detail
├── set_bool.h
└── trigger.h
7 directories, 36 files
building works under linux, but build on windows fails during build of micro-ROS dev environment (gtest_vendor)
Error message:
--- stderr: gtest_vendor
Traceback (most recent call last):
File "C:\Users\isk5wi\.platformio\penv\lib\site-packages\colcon_core\executor\__init__.py", line 91, in __call__
rc = await self.task(*args, **kwargs)
File "C:\Users\isk5wi\.platformio\penv\lib\site-packages\colcon_core\task\__init__.py", line 93, in __call__
return await task_method(*args, **kwargs)
File "C:\Users\isk5wi\.platformio\penv\lib\site-packages\colcon_ros\task\cmake\build.py", line 35, in build
rc = await extension.build(
File "C:\Users\isk5wi\.platformio\penv\lib\site-packages\colcon_cmake\task\cmake\build.py", line 87, in build
rc = await self._reconfigure(args, env)
File "C:\Users\isk5wi\.platformio\penv\lib\site-packages\colcon_cmake\task\cmake\build.py", line 153, in _reconfigure
raise RuntimeError(
RuntimeError: VisualStudioVersion is not set, please run within a Visual Studio Command Prompt.
---
Failed <<< gtest_vendor [2.80s, exited with code 1]
VisualStudioVersion is not set, please run within a Visual Studio Command Prompt.
Issue with the implementation of a publisher and subscriber in same program:
I have both parts working individually. Meaning if I delete everything related to the subscriber, I can run the publisher and if I delete everything related to the publisher, then I can run the subscriber.
This is achieved, following the "Teensy with Arduino" tutorial on micro.ros.org
Ubuntu 22.04.1 with ROS2 Humble install (desktop)
Visual Studio Code Version: 1.71.2
PlatformIO Core 6.1.4·Home 3.4.3
Platform Teensy 4.1 and micro_ROS
In the program below is an attempt to get both a subscriber and publisher working in the same program.
Expected behavior:
publish a number counting up continuously
Actual behavior:
After loading the program into the teensy, it immediately goes into the error routine and flashes the LED.
I'm not sure what I am missing.
#include <Arduino.h>
#include <Wire.h>
#include <micro_ros_platformio.h>
#include <rcl/rcl.h>
#include <rclc/rclc.h>
#include <rclc/executor.h>
#include <std_msgs/msg/int32.h>
#if !defined(MICRO_ROS_TRANSPORT_ARDUINO_SERIAL)
#error This example is only avaliable for Arduino framework with serial transport.
#endif
// debug
#ifndef DebugMonitor
#define DebugMonitor Serial6
#endif
#define debug(x) DebugMonitor.print(x)
#define debugln(x) DebugMonitor.println(x)
rcl_publisher_t publisher;
rcl_subscription_t subscriber;
std_msgs__msg__Int32 msg;
// publisher and subscriber common
rclc_support_t support;
rcl_allocator_t allocator;
//publisher
rclc_executor_t executor_pub;
rcl_node_t pub_node;
// subscriber
rclc_executor_t executor_sub;
rcl_node_t sub_node;
rcl_timer_t timer;
#define LED_PIN 13
#define RCCHECK(fn){rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){debugln("error: ");debugln(temp_rc);debugln(RCL_RET_OK);error_loop();}}
#define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}}
// Error handle loop
void error_loop() {
while(1) {
digitalWrite(LED_PIN, !digitalRead(LED_PIN));
delay(100);
}
}
void timer_callback(rcl_timer_t * timer, int64_t last_call_time) {
RCLC_UNUSED(last_call_time);
if (timer != NULL) {
RCSOFTCHECK(rcl_publish(&publisher, &msg, NULL));
msg.data++;
}
}
void subscription_callback(const void * msgin)
{
const std_msgs__msg__Int32 * msg = (const std_msgs__msg__Int32 *)msgin;
digitalWrite(LED_PIN, (msg->data == 0) ? LOW : HIGH);
}
void setup() {
// Configure serial transport
Serial.begin(115200);
set_microros_serial_transports(Serial);
// Debug
DebugMonitor.begin(115200);
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, HIGH);
delay(2000);
allocator = rcl_get_default_allocator();
//create init_options
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
// create node
RCCHECK(rclc_node_init_default(&pub_node, "uros_platformio_pub_node", "", &support));
RCCHECK(rclc_node_init_default(&sub_node, "uros_platformio_sub_node", "", &support));
// create publisher
RCCHECK(rclc_publisher_init_default(
&publisher,
&pub_node,
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32),
"micro_ros_platformio_node_publisher"));
// create subscriber
RCCHECK(rclc_subscription_init_default(
&subscriber,
&sub_node,
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32),
"micro_ros_arduino_subscriber"));
// create timer,
const unsigned int timer_timeout = 1000;
RCCHECK(rclc_timer_init_default(
&timer,
&support,
RCL_MS_TO_NS(timer_timeout),
timer_callback));
// create executor_pub
RCCHECK(rclc_executor_init(&executor_pub, &support.context, 1, &allocator));
RCCHECK(rclc_executor_add_timer(&executor_pub, &timer));
// create executor_sub
RCCHECK(rclc_executor_init(&executor_sub, &support.context, 1, &allocator));
RCCHECK(rclc_executor_add_subscription(&executor_sub, &subscriber, &msg, &subscription_callback, ON_NEW_DATA));
msg.data = 0;
}
void loop() {
delay(100);
RCSOFTCHECK(rclc_executor_spin_some(&executor_pub, RCL_MS_TO_NS(100)));
RCSOFTCHECK(rclc_executor_spin_some(&executor_sub, RCL_MS_TO_NS(100)));
debugln("Scan");
}
I'm trying to get the publisher example working over wifi, with the following platformio.ini file contents:
[env]
monitor_speed = 115200
upload_speed = 921600
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
board_microros_transport = wifi
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio
The code in Main.cpp is mostly unchanged, except for the wifi setup steps as instructed in the micro_ros_platformio
documentation:
const char* ssid = "My-Wifi-Network";
const char* password = "My-Wifi-Password";
const size_t agent_port = 8888;
IPAddress agent_ip(192, 168, 1, 219);
...
void setup() {
Serial.begin(115200);
Serial.print("Initializing...");
set_microros_wifi_transports((char*)ssid, (char*)password, agent_ip, agent_port);
Serial.print("Done!");
}
...
I'm also running the agent on the host using docker, as follows:
> docker run -it --rm --net=host microros/micro-ros-agent:galactic udp4 -p 8888 -v 6
...with output:
[1653609707.462781] info | UDPv4AgentLinux.cpp | init | running... | port: 8888
[1653609707.463000] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 6
I then ran the following steps to build and upload the uros client:
> pio lib install
<Succeeded>
> pio run
<Succeeded>
> pio run -t upload
<Succeeded>
> pio device monitor
I should start seeing messages being published to a ROS2 topic.
set_microros_wifi_transports()
hangs, and there is nothing printed to the serial monitor after that point:
--- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Miniterm on /dev/ttyUSB0 115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
Initializing...
Done!
should be printed after the transport initialization. However, it never gets to that point.> docker run -it --rm --net=host microros/micro-ros-agent:galactic udp4 -p 8888 -v 6
[1653609707.462781] info | UDPv4AgentLinux.cpp | init | running... | port: 8888
[1653609707.463000] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 6
What am I missing?
The host computer (on which the agent is running) has the following ifconfig output (which I have reflected in the wifi connection params in Main.cpp):
wlp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.219 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::65cb:1978:7797:6d81 prefixlen 64 scopeid 0x20<link>
ether f8:63:3f:df:fe:ad txqueuelen 1000 (Ethernet)
RX packets 1865460 bytes 1437880778 (1.4 GB)
RX errors 0 dropped 6 overruns 0 frame 0
TX packets 530456 bytes 108092270 (108.0 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
I've separately verified that the ESP32 board's wifi IS working (using the Wifi.h library):
Connecting to wifi........
WiFi connected!
Assigned IP Address: 192.168.1.44
My environment settings on the agent/host are:
RMW_IMPLEMENTATION=rmw_fastrtps_cpp
ROS_VERSION=2
ROS_PYTHON_VERSION=3
ROS_LOCALHOST_ONLY=0
ROS_DISTRO=galactic
void setup() {
// ----------- Configure serial transport
Serial.begin(115200);
set_microros_serial_transports(Serial);
}
Runs in serial
A yellow message suggesting me to run it as WiFi
I find it weird as the compilation to the board seems to be "lagging behind"?
When I set to utilize serial, the compilation gives a yellow suggestion saying something like alternative suggestion: try using WiFi.
And when I switched to utilize WiFi, the yellow message gives the alternative suggestion saying to try using Serial...?
Code works about a month ago and I never touched it until now.
I get an "undefined reference to" error when attempting to compile the source code below.
undefined reference to `rosidl_typesupport_c__get_service_type_support_handle__example_interfaces__srv__AddTwoInts'
Ubuntu 22.04.1 with ROS2 Humble install (desktop)
Visual Studio Code Version: 1.71.2
PlatformIO Core 6.1.4·Home 3.4.3
Platform Teensy 4.1 and micro_ROS
To the source code. This is my attempt of porting the micro-ros_addtwoints_service
example from micro_ros_arduino
repo.
As far as I can tell, I have all libraries properly installed and my include paths defined.
The problem seems to come from the library difference. In the example #include <micro_ros_arduino.h>
was used and due to porting it to the teensy and platformio it has been changed to #include <micro_ros_platformio.h>
.
However, digging deeper into the library I can't see where the problem is.
Source code:
//#include <micro_ros_arduino.h>
#include <Arduino.h>
#include <micro_ros_platformio.h>
#include <example_interfaces/srv/add_two_ints.h>
#include <stdio.h>
#include <rcl/error_handling.h>
#include <rclc/rclc.h>
#include <rclc/executor.h>
#include <std_msgs/msg/int64.h>
rcl_node_t node;
rclc_support_t support;
rcl_allocator_t allocator;
rclc_executor_t executor;
rcl_service_t service;
rcl_wait_set_t wait_set;
example_interfaces__srv__AddTwoInts_Response res;
example_interfaces__srv__AddTwoInts_Request req;
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){while(1){};}}
#define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}}
void service_callback(const void * req, void * res){
example_interfaces__srv__AddTwoInts_Request * req_in = (example_interfaces__srv__AddTwoInts_Request *) req;
example_interfaces__srv__AddTwoInts_Response * res_in = (example_interfaces__srv__AddTwoInts_Response *) res;
//printf("Service request value: %d + %d.\n", (int) req_in->a, (int) req_in->b);
res_in->sum = req_in->a + req_in->b;
}
void setup() {
//set_microros_transports();
Serial.begin(115200);
set_microros_serial_transports(Serial);
delay(1000);
allocator = rcl_get_default_allocator();
// create init_options
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
// create node
RCCHECK(rclc_node_init_default(&node, "add_twoints_client_rclc", "", &support));
// create service
RCCHECK(rclc_service_init_default(&service, &node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, AddTwoInts), "/addtwoints"));
// create executor
RCCHECK(rclc_executor_init(&executor, &support.context, 1, &allocator));
RCCHECK(rclc_executor_add_service(&executor, &service, &req, &res, service_callback));
}
void loop() {
delay(100);
RCSOFTCHECK(rclc_executor_spin_some(&executor, RCL_MS_TO_NS(100)));
}
Below is the entire compiler output I'm getting. The transports is properly selected to be Serial and configuration is matching the intended platformio.ini, which can also be found further below.
~/Documents/gitclones/AutoBot_uros$ pio run
Processing teensy41 (platform: teensy; board: teensy41; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy41.html
PLATFORM: Teensy (4.17.0) > Teensy 4.1
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 7.75MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
- framework-arduinoteensy @ 1.157.220801 (1.57)
- tool-teensy @ 1.157.0 (1.57)
- toolchain-gccarmnoneeabi @ 1.50401.190816 (5.4.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Installing pyyaml with pip at PlatformIO environment
/usr/bin/python3 -m pip install pyyaml
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (5.4.1)
Installing markupsafe==2.0.1 with pip at PlatformIO environment
/usr/bin/python3 -m pip install markupsafe==2.0.1
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: markupsafe==2.0.1 in /usr/lib/python3/dist-packages (2.0.1)
Configuring teensy41 with transport serial
micro-ROS already built
Found 93 compatible libraries
Scanning dependencies...
Dependency Graph
|-- micro_ros_platformio @ 0.0.1+sha.22cf9b6
Building in release mode
Linking .pio/build/teensy41/firmware.elf
.pio/build/teensy41/src/main.cpp.o: In function `setup':
main.cpp:(.text.setup+0x9a): undefined reference to `rosidl_typesupport_c__get_service_type_support_handle__example_interfaces__srv__AddTwoInts'
collect2: error: ld returned 1 exit status
*** [.pio/build/teensy41/firmware.elf] Error 1
========================================================== [FAILED] Took 3.82 seconds ==========================================================
And here now the platformio.ini
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
board_microros_transport = serial
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio
I understand that the use of rclcpp
(i.e, c++) should be done carefully, because of the higher resource requirements it will impose on the MCU. But I'm using an ESP32, and only plan to run 1 rclcpp::Node
instance on it, with 1-2 services, and perhaps 1 diagnostic messages publisher. I presume that should be manageable on an ESP32.
However, after adding a few of the package dependencies to the extra_packages.repos file, I'm getting a few compilation errors. Could you suggest what changes I should make to get this to build correctly? A functional version of both platformio.ini
and extra_packages.repos
would be greatly appreciated!
I added the following to extra_packages.repos:
repositories:
rclcpp: <======== Ultimately, rclcpp is all I want (The items below were some of its dependencies)
type: git
url: https://github.com/ros2/rclcpp.git
version: galactic
libstatistics_collector:
type: git
url: https://github.com/ros-tooling/libstatistics_collector.git
version: galactic
rcpputils:
type: git
url: https://github.com/ros2/rcpputils.git
version: galactic
But I get several errors, as so:
In file included from /home/safdar/.platformio/packages/[email protected]/xtensa-esp32-elf/include/dirent.h:6:0,
from /home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:58:
/home/safdar/.platformio/packages/[email protected]/xtensa-esp32-elf/include/sys/dirent.h:10:2: error: #error "<dirent.h> not supported"
#error "<dirent.h> not supported"
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp: In function 'rcpputils::fs::path rcpputils::fs::current_path()':
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:352:12: error: 'PATH_MAX' was not declared in this scope
char cwd[PATH_MAX];
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:353:25: error: 'cwd' was not declared in this scope
if (nullptr == getcwd(cwd, PATH_MAX)) {
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:360:15: error: 'cwd' was not declared in this scope
return path(cwd);
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp: In function 'bool rcpputils::fs::remove(const rcpputils::fs::path&)':
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:399:10: error: '::remove' has not been declared
return ::remove(p.string().c_str()) == 0;
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:399:10: note: suggested alternatives:
In file included from /home/safdar/.platformio/packages/[email protected]/xtensa-esp32-elf/include/c++/5.2.0/algorithm:62:0,
from /home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:43:
/home/safdar/.platformio/packages/[email protected]/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algo.h:893:5: note: 'std::remove'
remove(_ForwardIterator __first, _ForwardIterator __last,
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:385:6: note: 'rcpputils::fs::remove'
bool remove(const path & p)
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp: In function 'bool rcpputils::fs::remove_all(const rcpputils::fs::path&)':
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:432:3: error: 'DIR' was not declared in this scope
DIR * dir = opendir(p.string().c_str());
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:432:9: error: 'dir' was not declared in this scope
DIR * dir = opendir(p.string().c_str());
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:432:41: error: 'opendir' was not declared in this scope
DIR * dir = opendir(p.string().c_str());
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:434:40: error: 'readdir' was not declared in this scope
while ((directory_entry = readdir(dir)) != nullptr) {
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:436:31: error: invalid use of incomplete type 'struct rcpputils::fs::remove_all(const rcpputils::fs::path&)::dirent'
if (strcmp(directory_entry->d_name, ".") != 0 && strcmp(directory_entry->d_name, "..") != 0) {
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:433:10: note: forward declaration of 'struct rcpputils::fs::remove_all(const rcpputils::fs::path&)::dirent'
struct dirent * directory_entry;
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:436:76: error: invalid use of incomplete type 'struct rcpputils::fs::remove_all(const rcpputils::fs::path&)::dirent'
if (strcmp(directory_entry->d_name, ".") != 0 && strcmp(directory_entry->d_name, "..") != 0) {
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:433:10: note: forward declaration of 'struct rcpputils::fs::remove_all(const rcpputils::fs::path&)::dirent'
struct dirent * directory_entry;
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:437:63: error: invalid use of incomplete type 'struct rcpputils::fs::remove_all(const rcpputils::fs::path&)::dirent'
auto sub_path = rcpputils::fs::path(p) / directory_entry->d_name;
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:433:10: note: forward declaration of 'struct rcpputils::fs::remove_all(const rcpputils::fs::path&)::dirent'
struct dirent * directory_entry;
^
/home/safdar/code/repositories/esp32/.pio/libdeps/pio_arduino_microros_esp32dev_wifi/micro_ros_platformio/build/mcu/src/rcpputils/src/filesystem_helper.cpp:447:15: error: 'closedir' was not declared in this scope
closedir(dir);
^
make[2]: *** [CMakeFiles/rcpputils.dir/build.make:76: CMakeFiles/rcpputils.dir/src/filesystem_helper.cpp.obj] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/rcpputils.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed <<< rcpputils [1.88s, exited with code 2]
I presume this has something to do with the compiler being used, or perhaps the wrong compiler flags.
Here's my platformio.ini:
[env]
monitor_speed = 115200
upload_speed = 921600
[env:pio_arduino_microros_esp32dev_wifi]
platform = espressif32
framework = arduino
board = esp32dev
board_microros_distro = galactic
board_microros_transport = wifi
board_microros_user_meta = colcon.meta
src_filter = +<arduino.cpp>
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio#fix/ros_source
What should I add to platformio.ini
and extra_packages.repos
in order to get rclcpp
compiled and linked into libmicro_ros_platformio.a?
Many thanks in advance.
I am trying to build micro_ros_platformio for a Teensy4.1 but I get a lot of warnings from "ar" at the end of the build but no fatal error. Here is a picture of those warning.
Further in the build of the code itself (the code that depends on micro_ros), it fails due to a bunch of undefined references that correspond with the file that are mentionned by the "ar" command.
Build without errors (it compiles without all the aforementioned warnings on another machine running Ubuntu)
Throws some warnings and complains later in the build that there are undefined references
If it compiles without the warning, there will be an error at the end relating to the random library but this is due to other unrelated stuff.
Hello, I am new to micro ros.
I recently ran into a problem creating a node that provides multiple services.
One service works fine, but when I try to create 2 or more services I get an error.
Precisely the second "rclc_service_init_default" function returns "RMW_RET_ERROR".
I would be grateful if you could point out if there is something I am using incorrectly.
#include <Arduino.h>
#include <micro_ros_platformio.h>
#include <rcl/rcl.h>
#include <rclc/executor.h>
#include <rclc/rclc.h>
#include <rmw_microros/rmw_microros.h>
// service message
#include <std_srvs/srv/trigger.h>
#define RCCHECK(fn) \
{ \
rcl_ret_t temp_rc = fn; \
if ((temp_rc != RCL_RET_OK)) { \
error_loop(temp_rc, __FILE__, __FUNCTION__, __LINE__); \
} \
}
#define RCSOFTCHECK(fn) \
{ \
rcl_ret_t temp_rc = fn; \
if ((temp_rc != RCL_RET_OK)) { \
} \
}
#define ERRCHECK(fn) \
{ \
bool temp_rc = fn; \
if ((temp_rc != true)) { \
error_loop(temp_rc, __FILE__, __FUNCTION__, __LINE__); \
} \
}
static rcl_allocator_t s_allocator;
static rclc_support_t s_support;
static rclc_executor_t s_executor;
static rcl_node_t s_node;
static rcl_service_t test_h;
static std_srvs__srv__Trigger_Request test_req;
static std_srvs__srv__Trigger_Response test_res;
static rcl_service_t test2_h;
static std_srvs__srv__Trigger_Request test2_req;
static std_srvs__srv__Trigger_Response test2_res;
static void error_loop(rcl_ret_t error, const char *file_name_, const char *function_name_, int line_cnt_) {
pinMode(4, OUTPUT);
char *buff;
asprintf(&buff, "ERRORTYPE: %d, FILENAME: %s, FUNCTION: %s, LINENO: %d", error, file_name_, function_name_, line_cnt_);
while (1) {
Serial.println(buff);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(4, LOW);
delay(100);
}
}
static void service_callback(const void *req, void *res) {
std_srvs__srv__Trigger_Request *req_ = (std_srvs__srv__Trigger_Request *)req;
std_srvs__srv__Trigger_Response *res_ = (std_srvs__srv__Trigger_Response *)res;
digitalWrite(4, LOW);
delay(100);
digitalWrite(4, HIGH);
res_->success = true;
}
typedef enum {
WAITING_AGENT,
AGENT_AVAILABLE,
AGENT_CONNECTED,
AGENT_DISCONNECTED
} state_t;
static state_t s_state;
void setup() {
Serial.begin(115200);
set_microros_serial_transports(Serial);
delay(2000);
pinMode(4, OUTPUT);
s_allocator = rcl_get_default_allocator();
RCCHECK(rclc_support_init(&s_support, 0, NULL, &s_allocator));
RCCHECK(rclc_node_init_default(&s_node, "mechaship_mcu_driver", "", &s_support));
RCCHECK(rclc_service_init_default(&test_h, &s_node, ROSIDL_GET_SRV_TYPE_SUPPORT(std_srvs, srv, Trigger), "/test1"));
RCCHECK(rclc_service_init_default(&test2_h, &s_node, ROSIDL_GET_SRV_TYPE_SUPPORT(std_srvs, srv, Trigger), "/test2"));
// excutor
RCCHECK(rclc_executor_init(&s_executor, &s_support.context, 2, &s_allocator));
RCCHECK(rclc_executor_add_service(&s_executor, &test_h,
&test_req, &test_res,
service_callback));
RCCHECK(rclc_executor_add_service(&s_executor, &test2_h,
&test2_req, &test2_res,
service_callback));
}
void loop() {
delay(100);
RCSOFTCHECK(rclc_executor_spin_some(&s_executor, RCL_MS_TO_NS(100)));
}
I want to see two services "/test" and "/test2" in rqt service caller.
The error occurs on line 95.
line 95:
RCCHECK(rclc_service_init_default(&test2_h, &s_node, ROSIDL_GET_SRV_TYPE_SUPPORT(std_srvs, srv, Trigger), "/test2"));
error log:
ERRORTYPE: 1, FILENAME: src/main.cpp, FUNCTION: setup, LINENO: 95
Steps from the main github page: https://github.com/micro-ROS/micro_ros_platformio
pio lib install
pio run
pio run --target upload
platformio.ini:
[env:esp32doit-devkit-v1]
; [env: heltec_wifi_lora_32_V2]
platform = espressif32
board = esp32doit-devkit-v1 ;heltec_wifi_lora_32_V2
board_microros_transport = wifi_nina ;serial ;wifi ;wifi_nina
board_microros_distro = foxy
framework = arduino
monitor_speed = 115200
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio # for microROS
arduino-libraries/WiFiNINA@^1.8.13 # for wifi_nina
main.cpp:
#include <Arduino.h>
#include <micro_ros_platformio.h>
#include <rcl/rcl.h>
#include <rclc/rclc.h>
#include <rclc/executor.h>
#include <std_msgs/msg/int32.h>
// #if !defined(MICRO_ROS_TRANSPORT_ARDUINO_SERIAL)
// #error This example is only avaliable for Arduino framework with serial transport.
// #endif
rcl_publisher_t publisher;
std_msgs__msg__Int32 msg;
rclc_executor_t executor;
rclc_support_t support;
rcl_allocator_t allocator;
rcl_node_t node;
rcl_timer_t timer;
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}}
#define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}}
// Error handle loop
void error_loop() {
while(1) {
delay(100);
}
}
void timer_callback(rcl_timer_t * timer, int64_t last_call_time) {
RCLC_UNUSED(last_call_time);
if (timer != NULL) {
RCSOFTCHECK(rcl_publish(&publisher, &msg, NULL));
msg.data+=2;
}
}
void setup() {
// ----------- Configure serial transport
Serial.begin(115200);
// set_microros_serial_transports(Serial);
IPAddress agent_ip(111, 111, 1, 11);
size_t agent_port = 8888;
char ssid[] = "123456789";
char psk[]= "123456789";
set_microros_wifi_transports(ssid, psk, agent_ip, agent_port);
delay(2000);
Serial.println("Initialized...");
allocator = rcl_get_default_allocator();
//create init_options
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
// create node
RCCHECK(rclc_node_init_default(&node, "micro_ros_platformio_node", "", &support));
// create publisher
RCCHECK(rclc_publisher_init_default(
&publisher,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32),
"micro_ros_platformio_node_publisher"));
// create timer,
const unsigned int timer_timeout = 1000;
RCCHECK(rclc_timer_init_default(
&timer,
&support,
RCL_MS_TO_NS(timer_timeout),
timer_callback));
// create executor
RCCHECK(rclc_executor_init(&executor, &support.context, 1, &allocator));
RCCHECK(rclc_executor_add_timer(&executor, &timer));
msg.data = 0;
}
void loop() {
delay(100);
RCSOFTCHECK(rclc_executor_spin_some(&executor, RCL_MS_TO_NS(100)));
}
Builds and runs...
genozen@genozen:~/Desktop/platformIO_projects/microROS_ESP32_test$ pio run
Processing esp32doit-devkit-v1 (platform: espressif32; board: esp32doit-devkit-v1; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 (5.0.0) > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 3.20003.220626 (2.0.3)
- tool-esptoolpy @ 1.30300.0 (3.3.0)
- toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Installing pyyaml with pip at PlatformIO environment
/home/genozen/.platformio/penv/bin/python -m pip install pyyaml
Requirement already satisfied: pyyaml in /home/genozen/.platformio/penv/lib/python3.8/site-packages (6.0)
Installing markupsafe==2.0.1 with pip at PlatformIO environment
/home/genozen/.platformio/penv/bin/python -m pip install markupsafe==2.0.1
Requirement already satisfied: markupsafe==2.0.1 in /home/genozen/.platformio/penv/lib/python3.8/site-packages (2.0.1)
Configuring esp32doit-devkit-v1 with transport wifi_nina
micro-ROS already built
Found 35 compatible libraries
Scanning dependencies...
Dependency Graph
|-- micro_ros_platformio @ 0.0.1+sha.2ebb324
| |-- WiFiNINA @ 1.8.13
| | |-- SPI @ 2.0.0
| |-- SPI @ 2.0.0
|-- WiFiNINA @ 1.8.13
| |-- SPI @ 2.0.0
Building in release mode
Compiling .pio/build/esp32doit-devkit-v1/src/main.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0b8/WiFiNINA/WiFi.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0b8/WiFiNINA/WiFiClient.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0b8/WiFiNINA/WiFiServer.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0b8/WiFiNINA/WiFiStorage.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0b8/WiFiNINA/WiFiUdp.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0b8/WiFiNINA/utility/nano_rp2040_support.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0b8/WiFiNINA/utility/server_drv.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0b8/WiFiNINA/utility/spi_drv.cpp.o
In file included from .pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/WiFiStorage.h:23,
from .pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/WiFi.h:38,
from .pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/WiFiNINA.h:23,
from .pio/libdeps/esp32doit-devkit-v1/micro_ros_platformio/platform_code/arduino/wifi_nina/micro_ros_transport.h:2,
from .pio/libdeps/esp32doit-devkit-v1/micro_ros_platformio/platform_code/micro_ros_platformio.h:34,
from src/main.cpp:3:
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/wifi_drv.h:293:12: error: 'PinStatus' does not name a type
static PinStatus digitalRead(uint8_t pin);
^~~~~~~~~
*** [.pio/build/esp32doit-devkit-v1/src/main.cpp.o] Error 1
In file included from .pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/WiFi.cpp:21:
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/wifi_drv.h:293:12: error: 'PinStatus' does not name a type
static PinStatus digitalRead(uint8_t pin);
^~~~~~~~~
*** [.pio/build/esp32doit-devkit-v1/lib0b8/WiFiNINA/WiFi.cpp.o] Error 1
In file included from .pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/WiFiClient.cpp:30:
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/wifi_drv.h:293:12: error: 'PinStatus' does not name a type
static PinStatus digitalRead(uint8_t pin);
^~~~~~~~~
In file included from .pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/WiFiStorage.h:23,
from .pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/WiFiStorage.cpp:20:
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/wifi_drv.h:293:12: error: 'PinStatus' does not name a type
static PinStatus digitalRead(uint8_t pin);
^~~~~~~~~
In file included from .pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/WiFiStorage.h:23,
from .pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/WiFi.h:38,
from .pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/WiFiServer.cpp:28:
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/wifi_drv.h:293:12: error: 'PinStatus' does not name a type
static PinStatus digitalRead(uint8_t pin);
^~~~~~~~~
*** [.pio/build/esp32doit-devkit-v1/lib0b8/WiFiNINA/WiFiStorage.cpp.o] Error 1
*** [.pio/build/esp32doit-devkit-v1/lib0b8/WiFiNINA/WiFiClient.cpp.o] Error 1
*** [.pio/build/esp32doit-devkit-v1/lib0b8/WiFiNINA/WiFiServer.cpp.o] Error 1
In file included from .pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/WiFiUdp.cpp:29:
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/wifi_drv.h:293:12: error: 'PinStatus' does not name a type
static PinStatus digitalRead(uint8_t pin);
^~~~~~~~~
*** [.pio/build/esp32doit-devkit-v1/lib0b8/WiFiNINA/WiFiUdp.cpp.o] Error 1
In file included from .pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/WiFiStorage.h:23,
from .pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/WiFi.h:38,
from .pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/spi_drv.cpp:25:
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/wifi_drv.h:293:12: error: 'PinStatus' does not name a type
static PinStatus digitalRead(uint8_t pin);
^~~~~~~~~
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/spi_drv.cpp: In static member function 'static void SpiDrv::begin()':
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/spi_drv.cpp:94:24: error: 'PINS_COUNT' was not declared in this scope
if (SLAVERESET > PINS_COUNT) {
^~~~~~~~~~
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/spi_drv.cpp:94:24: note: suggested alternative: 'ICOUNT'
if (SLAVERESET > PINS_COUNT) {
^~~~~~~~~~
ICOUNT
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/spi_drv.cpp:103:15: error: 'NINA_GPIO0' was not declared in this scope
pinMode(NINA_GPIO0, OUTPUT);
^~~~~~~~~~
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/spi_drv.cpp:103:15: note: suggested alternative: 'NINA_GPIOIRQ'
pinMode(NINA_GPIO0, OUTPUT);
^~~~~~~~~~
NINA_GPIOIRQ
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/spi_drv.cpp: In static member function 'static int SpiDrv::available()':
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/spi_drv.cpp:66:25: error: 'NINA_GPIO0' was not declared in this scope
#define NINA_GPIOIRQ NINA_GPIO0
^~~~~~~~~~
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/spi_drv.cpp:597:25: note: in expansion of macro 'NINA_GPIOIRQ'
return (digitalRead(NINA_GPIOIRQ) != LOW);
^~~~~~~~~~~~
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/spi_drv.cpp:66:25: note: suggested alternative: 'NINA_GPIOIRQ'
#define NINA_GPIOIRQ NINA_GPIO0
^~~~~~~~~~
.pio/libdeps/esp32doit-devkit-v1/WiFiNINA/src/utility/spi_drv.cpp:597:25: note: in expansion of macro 'NINA_GPIOIRQ'
return (digitalRead(NINA_GPIOIRQ) != LOW);
^~~~~~~~~~~~
*** [.pio/build/esp32doit-devkit-v1/lib0b8/WiFiNINA/utility/spi_drv.cpp.o] Error 1
Sometimes there's Colcon build: error as well...
Also, USB permission sometimes denies and requires using the sudo chown
command
Using https://github.com/Agroecology-Lab/linorobot2_hardware/blob/galactic/firmware/platformio.ini
Follow https://github.com/linorobot/linorobot2_hardware#3-install-platformio
pio builds firmware
--- stderr: ament_cmake_core
Traceback (most recent call last):
File "/home/ubuntu/linorobot2_hardware/calibration/.pio/libdeps/pico/micro_ros_platformio/build/dev/src/ament_cmake/ament_cmake_core/cmake/package_templates/templates_2_cmake.py", line 21, in
from ament_package.templates import get_environment_hook_template_path
ModuleNotFoundError: No module named 'ament_package'
CMake Error at ament_cmake_package_templates-extras.cmake:41 (message):
https://github.com/micro-ROS/micro_ros_raspberrypi_pico_sdk
https://gist.github.com/Redstone-RM/0ca459c32ec5ead8700284ff56a136f7
Config file :
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
board_microros_transport = serial
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio
Processing teensy41 (platform: teensy; board: teensy41; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy41.html
PLATFORM: Teensy (4.17.0) > Teensy 4.1
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 7.75MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
- framework-arduinoteensy @ 1.157.220801 (1.57)
- tool-teensy @ 1.157.0 (1.57)
- toolchain-gccarmnoneeabi @ 1.50401.190816 (5.4.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/matt/.platformio/penv/bin/python -m pip install pyyaml
Requirement already satisfied: pyyaml in /home/matt/.platformio/penv/lib/python3.10/site-packages (6.0)
Installing markupsafe==2.0.1 with pip at PlatformIO environment
/home/matt/.platformio/penv/bin/python -m pip install markupsafe==2.0.1
Requirement already satisfied: markupsafe==2.0.1 in /home/matt/.platformio/penv/lib/python3.10/site-packages (2.0.1)
Configuring teensy41 with transport serial
Downloading micro-ROS dev dependencies
- Downloaded ament_cmake
- Downloaded ament_lint
- Downloaded ament_package
- Downloaded googletest
- Downloaded ament_cmake_ros
- Downloaded ament_index
Building micro-ROS dev dependencies
Downloading micro-ROS library
- Downloaded microcdr
- Downloaded microxrcedds_client
- Downloaded rcl_action
- Downloaded rcl_yaml_param_parser (ignored)
- Downloaded rcl_lifecycle
- Downloaded rcl
- Downloaded rclc_parameter
- Downloaded rclc
- Downloaded rclc_lifecycle
- Downloaded rclc_examples (ignored)
- Downloaded micro_ros_utilities
- Downloaded rcutils
- Downloaded micro_ros_msgs
- Downloaded rmw_microxrcedds
- Downloaded rosidl_typesupport_c
- Downloaded rosidl_typesupport_cpp (ignored)
- Downloaded rosidl_typesupport_microxrcedds_cpp (ignored)
- Downloaded rosidl_typesupport_microxrcedds_c
- Downloaded rosidl_typesupport_microxrcedds_c_tests
- Downloaded rosidl_typesupport_microxrcedds_cpp_tests
- Downloaded rosidl_typesupport_microxrcedds_test_msg
- Downloaded rosidl_typesupport_introspection_cpp (ignored)
- Downloaded rosidl_typesupport_interface
- Downloaded rosidl_adapter
- Downloaded rosidl_cmake
- Downloaded rosidl_runtime_cpp (ignored)
- Downloaded rosidl_runtime_c
- Downloaded rosidl_generator_cpp (ignored)
- Downloaded rosidl_typesupport_introspection_c
- Downloaded rosidl_parser
- Downloaded rosidl_cli
- Downloaded rosidl_generator_c
- Downloaded rosidl_typesupport_introspection_tests
- Downloaded rmw_implementation_cmake
- Downloaded rmw
- Downloaded rosgraph_msgs
- Downloaded rcl_interfaces
- Downloaded test_msgs
- Downloaded builtin_interfaces
- Downloaded statistics_msgs
- Downloaded lifecycle_msgs
- Downloaded action_msgs
- Downloaded composition_interfaces
- Downloaded rosidl_default_generators
- Downloaded rosidl_default_runtime
- Downloaded unique_identifier_msgs
- Downloaded diagnostic_msgs
- Downloaded sensor_msgs
- Downloaded stereo_msgs
- Downloaded std_srvs
- Downloaded sensor_msgs_py
- Downloaded nav_msgs
- Downloaded common_interfaces
- Downloaded visualization_msgs
- Downloaded actionlib_msgs
- Downloaded trajectory_msgs
- Downloaded std_msgs
- Downloaded shape_msgs
- Downloaded geometry_msgs
- Downloaded test_interface_files
- Downloaded rmw_implementation
- Downloaded test_rmw_implementation
- Downloaded rcl_logging_spdlog (ignored)
- Downloaded rcl_logging_interface
- Downloaded rcl_logging_noop
- Downloaded test_tracetools
- Downloaded tracetools_read
- Downloaded test_tracetools_launch
- Downloaded tracetools_launch
- Downloaded tracetools_test
- Downloaded tracetools
- Downloaded tracetools_trace
- Downloaded ros2trace
- Extra packages folder not found, skipping...
Building micro-ROS library
Build mcu micro-ROS environment failed:
--- stderr: rcutils
In file included from /home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/error_handling.c:35:0:
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/./error_handling_helpers.h: In function '__rcutils_convert_uint64_t_into_c_str':
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/./error_handling_helpers.h:109:48: warning: unused parameter 'number' [-Wunused-parameter]
__rcutils_convert_uint64_t_into_c_str(uint64_t number, char * buffer, size_t buffer_size)
^
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/./error_handling_helpers.h:109:63: warning: unused parameter 'buffer' [-Wunused-parameter]
__rcutils_convert_uint64_t_into_c_str(uint64_t number, char * buffer, size_t buffer_size)
^
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/./error_handling_helpers.h:109:78: warning: unused parameter 'buffer_size' [-Wunused-parameter]
__rcutils_convert_uint64_t_into_c_str(uint64_t number, char * buffer, size_t buffer_size)
^
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/./error_handling_helpers.h: In function '__rcutils_format_error_string':
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/./error_handling_helpers.h:142:28: warning: unused parameter 'error_string' [-Wunused-parameter]
rcutils_error_string_t * error_string,
^
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/./error_handling_helpers.h:143:33: warning: unused parameter 'error_state' [-Wunused-parameter]
const rcutils_error_state_t * error_state)
^
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/error_handling.c: In function 'rcutils_get_error_string':
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/error_handling.c:240:38: warning: initializer-string for array of chars is too long
return (rcutils_error_string_t) {"error not set"}; // NOLINT(readability/braces)
^
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/error_handling.c:240:38: note: (near initialization for '(anonymous).str')
In file included from /home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/error_handling.c:35:0:
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/error_handling.c: At top level:
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/./error_handling_helpers.h:91:1: warning: '__rcutils_reverse_str' defined but not used [-Wunused-function]
__rcutils_reverse_str(char * string_in, size_t string_len)
^
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/./error_handling_helpers.h:109:1: warning: '__rcutils_convert_uint64_t_into_c_str' defined but not used [-Wunused-function]
__rcutils_convert_uint64_t_into_c_str(uint64_t number, char * buffer, size_t buffer_size)
^
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/logging.c: In function 'rcutils_get_env_var_zero_or_one':
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/logging.c:130:35: warning: unused parameter 'zero_semantic' [-Wunused-parameter]
const char * name, const char * zero_semantic,
^
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/logging.c:131:16: warning: unused parameter 'one_semantic' [-Wunused-parameter]
const char * one_semantic)
^
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/time_unix.c:47:4: warning: #warning is a GCC extension
# warning no monotonic clock function available
^
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/time_unix.c:47:4: warning: #warning no monotonic clock function available [-Wcpp]
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/time_unix.c: In function 'rcutils_system_time_now':
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/rcutils/src/time_unix.c:69:3: warning: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration]
clock_gettime(CLOCK_REALTIME, ×pec_now);
^
---
--- stderr: tracetools_trace
/home/matt/.platformio/penv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
---
--- stderr: tracetools_read
/home/matt/.platformio/penv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
---
--- stderr: rosidl_cli
/home/matt/.platformio/penv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
---
--- stderr: microxrcedds_client
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/Micro-XRCE-DDS-Client/src/c/util/time.c: In function 'uxr_nanos':
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/Micro-XRCE-DDS-Client/src/c/util/time.c:60:5: warning: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration]
clock_gettime(CLOCK_REALTIME, &ts);
^
---
--- stderr: rcl_logging_interface
CMake Warning at /home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcutils/cmake/ament_cmake_export_libraries-extras.cmake:116 (message):
Package 'rcutils' exports library 'dl' which couldn't be found
Call Stack (most recent call first):
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcutils/cmake/rcutilsConfig.cmake:41 (include)
CMakeLists.txt:19 (find_package)
---
--- stderr: rosidl_runtime_c
CMake Warning at /home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcutils/cmake/ament_cmake_export_libraries-extras.cmake:116 (message):
Package 'rcutils' exports library 'dl' which couldn't be found
Call Stack (most recent call first):
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcutils/cmake/rcutilsConfig.cmake:41 (include)
CMakeLists.txt:15 (find_package)
---
--- stderr: tracetools_launch
/home/matt/.platformio/penv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
---
--- stderr: rcl_logging_noop
CMake Warning at /home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcutils/cmake/ament_cmake_export_libraries-extras.cmake:116 (message):
Package 'rcutils' exports library 'dl' which couldn't be found
Call Stack (most recent call first):
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcutils/cmake/rcutilsConfig.cmake:41 (include)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcl_logging_interface/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcl_logging_interface/cmake/rcl_logging_interfaceConfig.cmake:41 (include)
CMakeLists.txt:15 (find_package)
---
--- stderr: ros2trace
/home/matt/.platformio/penv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
---
--- stderr: rmw
CMake Warning at /home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcutils/cmake/ament_cmake_export_libraries-extras.cmake:116 (message):
Package 'rcutils' exports library 'dl' which couldn't be found
Call Stack (most recent call first):
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcutils/cmake/rcutilsConfig.cmake:41 (include)
CMakeLists.txt:21 (find_package)
---
--- stderr: tracetools_test
/home/matt/.platformio/penv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
---
--- stderr: rosidl_typesupport_microxrcedds_c
CMake Warning at /home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcutils/cmake/ament_cmake_export_libraries-extras.cmake:116 (message):
Package 'rcutils' exports library 'dl' which couldn't be found
Call Stack (most recent call first):
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcutils/cmake/rcutilsConfig.cmake:41 (include)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rosidl_runtime_c/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rosidl_runtime_c/cmake/rosidl_runtime_cConfig.cmake:41 (include)
CMakeLists.txt:22 (find_package)
---
--- stderr: micro_ros_utilities
CMake Warning at /home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcutils/cmake/ament_cmake_export_libraries-extras.cmake:116 (message):
Package 'rcutils' exports library 'dl' which couldn't be found
Call Stack (most recent call first):
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcutils/cmake/rcutilsConfig.cmake:41 (include)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rosidl_runtime_c/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rosidl_runtime_c/cmake/rosidl_runtime_cConfig.cmake:41 (include)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rosidl_typesupport_introspection_c/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rosidl_typesupport_introspection_c/cmake/rosidl_typesupport_introspection_cConfig.cmake:41 (include)
CMakeLists.txt:18 (find_package)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/micro_ros_utilities/src/type_utilities.c: In function 'print_type_info':
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/src/micro_ros_utilities/src/type_utilities.c:96:31: warning: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'uint32_t {aka const long unsigned int}' [-Wformat=]
buffer, sizeof(buffer), "%sIntrospection for %s/%s - %u members, %zu B\n",
^
---
--- stderr: rosidl_typesupport_c
CMake Warning at /home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcutils/cmake/ament_cmake_export_libraries-extras.cmake:116 (message):
Package 'rcutils' exports library 'dl' which couldn't be found
Call Stack (most recent call first):
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcutils/cmake/rcutilsConfig.cmake:41 (include)
CMakeLists.txt:33 (find_package)
---
--- stderr: unique_identifier_msgs
CMake Warning at /home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcutils/cmake/ament_cmake_export_libraries-extras.cmake:116 (message):
Package 'rcutils' exports library 'dl' which couldn't be found
Call Stack (most recent call first):
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rcutils/cmake/rcutilsConfig.cmake:41 (include)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rosidl_runtime_c/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rosidl_runtime_c/cmake/rosidl_runtime_cConfig.cmake:41 (include)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rosidl_typesupport_introspection_c/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rosidl_typesupport_introspection_c/cmake/rosidl_typesupport_introspection_cConfig.cmake:41 (include)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rosidl_typesupport_c/cmake/rosidl_typesupport_c-extras.cmake:13 (find_package)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rosidl_typesupport_c/cmake/rosidl_typesupport_cConfig.cmake:41 (include)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rosidl_default_generators/cmake/rosidl_default_generators-extras.cmake:21 (find_package)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rosidl_default_generators/cmake/rosidl_default_generatorsConfig.cmake:41 (include)
CMakeLists.txt:15 (find_package)
CMake Error at /home/matt/microros_ws/install/rosidl_typesupport_microxrcedds_cpp/share/rosidl_typesupport_microxrcedds_cpp/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package):
By not providing "Findrosidl_runtime_cpp.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"rosidl_runtime_cpp", but CMake did not find one.
Could not find a package configuration file provided by
"rosidl_runtime_cpp" with any of the following names:
rosidl_runtime_cppConfig.cmake
rosidl_runtime_cpp-config.cmake
Add the installation prefix of "rosidl_runtime_cpp" to CMAKE_PREFIX_PATH or
set "rosidl_runtime_cpp_DIR" to a directory containing one of the above
files. If "rosidl_runtime_cpp" provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
/home/matt/microros_ws/install/rosidl_typesupport_microxrcedds_cpp/share/rosidl_typesupport_microxrcedds_cpp/cmake/rosidl_typesupport_microxrcedds_cppConfig.cmake:41 (include)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rosidl_default_generators/cmake/rosidl_default_generators-extras.cmake:21 (find_package)
/home/matt/projects/Embedded-UAV-Cooperative-Localisation/src/teensy/simple-publisher/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rosidl_default_generators/cmake/rosidl_default_generatorsConfig.cmake:41 (include)
CMakeLists.txt:15 (find_package)
---
Failed <<< unique_identifier_msgs [0.57s, exited with code 1]
======================================================================= [FAILED] Took 67.58 seconds =======================================================================
* The terminal process "platformio 'run'" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
cd my_ws/src
ros2 pkg create --build-type ament_cmake custom_messages
cd custom_messages
mkdir msg
Position2D.msg
and add the following content:float32 x
float32 y
CMakeLists.txt
and package.xml
colcon build
(no errors)platformio run --target clean
Processing wemos_d1_uno32 (platform: espressif32; board: wemos_d1_uno32; framework: arduino)
--------------------------------------------------------------------------------------------------------
Removing .pio/build/wemos_d1_uno32
Done cleaning
===================================== [SUCCESS] Took 0.31 seconds =====================================
* Terminal will be reused by tasks, press any key to close it.
platformio run
Processing wemos_d1_uno32 (platform: espressif32; board: wemos_d1_uno32; framework: arduino)
--------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/wemos_d1_uno32.html
PLATFORM: Espressif 32 (5.2.0) > WEMOS D1 R32
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 3.20005.220925 (2.0.5)
- tool-esptoolpy @ 1.40201.0 (4.2.1)
- toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Installing pyyaml with pip at PlatformIO environment
/home/martijn/.platformio/penv/bin/python -m pip install pyyaml
Requirement already satisfied: pyyaml in /home/martijn/.platformio/penv/lib/python3.10/site-packages (6.0)
Installing markupsafe==2.0.1 with pip at PlatformIO environment
/home/martijn/.platformio/penv/bin/python -m pip install markupsafe==2.0.1
Requirement already satisfied: markupsafe==2.0.1 in /home/martijn/.platformio/penv/lib/python3.10/site-packages (2.0.1)
Configuring wemos_d1_uno32 with transport wifi
micro-ROS already built
Found 37 compatible libraries
Scanning dependencies...
Dependency Graph
|-- micro_ros_platformio @ 0.0.1+sha.22cf9b6
| |-- WiFi @ 2.0.0
|-- MotorDriverD1-R32 @ 1.0.1+sha.724921a
|-- MicrosTimer @ 1.0.1+sha.ccad1d0
|-- MilisTimer @ 1.0.1+sha.f345b4b
|-- PreMo-Virtual Path Following @ 2.1.0+sha.59ee022
|-- Wire @ 2.0.0
Building in release mode
Compiling .pio/build/wemos_d1_uno32/src/ROS.cpp.o
Compiling .pio/build/wemos_d1_uno32/src/functions.cpp.o
Compiling .pio/build/wemos_d1_uno32/src/motors.cpp.o
Compiling .pio/build/wemos_d1_uno32/src/main.cpp.o
Building .pio/build/wemos_d1_uno32/bootloader.bin
Generating partitions .pio/build/wemos_d1_uno32/partitions.bin
esptool.py v4.2.1
Creating esp32 image...
Merged 1 ELF section
Successfully created esp32 image.
Compiling .pio/build/wemos_d1_uno32/libc03/WiFi/WiFi.cpp.o
Compiling .pio/build/wemos_d1_uno32/libc03/WiFi/WiFiAP.cpp.o
Compiling .pio/build/wemos_d1_uno32/libc03/WiFi/WiFiClient.cpp.o
Compiling .pio/build/wemos_d1_uno32/libc03/WiFi/WiFiGeneric.cpp.o
Compiling .pio/build/wemos_d1_uno32/libc03/WiFi/WiFiMulti.cpp.o
Compiling .pio/build/wemos_d1_uno32/libc03/WiFi/WiFiSTA.cpp.o
Compiling .pio/build/wemos_d1_uno32/libc03/WiFi/WiFiScan.cpp.o
Compiling .pio/build/wemos_d1_uno32/libc03/WiFi/WiFiServer.cpp.o
Compiling .pio/build/wemos_d1_uno32/libc03/WiFi/WiFiUdp.cpp.o
Compiling .pio/build/wemos_d1_uno32/lib984/micro_ros_platformio/platform_code/arduino/clock_gettime.cpp.o
Compiling .pio/build/wemos_d1_uno32/lib984/micro_ros_platformio/platform_code/arduino/wifi/micro_ros_transport.cpp.o
Compiling .pio/build/wemos_d1_uno32/lib7b1/MotorDriverD1-R32/MotorDriver.cpp.o
Compiling .pio/build/wemos_d1_uno32/libfe5/MicrosTimer/MicrosTimer.cpp.o
Compiling .pio/build/wemos_d1_uno32/libebc/MilisTimer/MillisTimer.cpp.o
Archiving .pio/build/wemos_d1_uno32/libc03/libWiFi.a
Indexing .pio/build/wemos_d1_uno32/libc03/libWiFi.a
Compiling .pio/build/wemos_d1_uno32/libb30/PreMo-Virtual Path Following/CatmullRom.cpp.o
Compiling .pio/build/wemos_d1_uno32/libb30/PreMo-Virtual Path Following/DeadReckoner.cpp.o
Archiving .pio/build/wemos_d1_uno32/lib7b1/libMotorDriverD1-R32.a
Archiving .pio/build/wemos_d1_uno32/lib984/libmicro_ros_platformio.a
Indexing .pio/build/wemos_d1_uno32/lib7b1/libMotorDriverD1-R32.a
Compiling .pio/build/wemos_d1_uno32/libb30/PreMo-Virtual Path Following/EncoderManager.cpp.o
Archiving .pio/build/wemos_d1_uno32/libfe5/libMicrosTimer.a
Indexing .pio/build/wemos_d1_uno32/lib984/libmicro_ros_platformio.a
Indexing .pio/build/wemos_d1_uno32/libfe5/libMicrosTimer.a
Compiling .pio/build/wemos_d1_uno32/libb30/PreMo-Virtual Path Following/MotorManager.cpp.o
Compiling .pio/build/wemos_d1_uno32/libb30/PreMo-Virtual Path Following/PID_v1.cpp.o
Compiling .pio/build/wemos_d1_uno32/libb30/PreMo-Virtual Path Following/PreMo.cpp.o
Archiving .pio/build/wemos_d1_uno32/libebc/libMilisTimer.a
Indexing .pio/build/wemos_d1_uno32/libebc/libMilisTimer.a
Compiling .pio/build/wemos_d1_uno32/libb30/PreMo-Virtual Path Following/PurePursuit.cpp.o
Compiling .pio/build/wemos_d1_uno32/lib0a1/Wire/Wire.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/Esp.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/FirmwareMSC.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/FunctionalInterrupt.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/HWCDC.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/HardwareSerial.cpp.o
Archiving .pio/build/wemos_d1_uno32/libb30/libPreMo-Virtual Path Following.a
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/IPAddress.cpp.o
Indexing .pio/build/wemos_d1_uno32/libb30/libPreMo-Virtual Path Following.a
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/IPv6Address.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/MD5Builder.cpp.o
Archiving .pio/build/wemos_d1_uno32/lib0a1/libWire.a
Indexing .pio/build/wemos_d1_uno32/lib0a1/libWire.a
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/Print.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/Stream.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/StreamString.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/Tone.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/USB.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/USBCDC.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/USBMSC.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/WMath.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/WString.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/base64.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/cbuf.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-adc.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-bt.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-cpu.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-dac.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-gpio.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-i2c-slave.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-i2c.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-ledc.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-matrix.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-misc.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-psram.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-rgb-led.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-rmt.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-sigmadelta.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-spi.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-time.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-timer.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-tinyusb.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-touch.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/esp32-hal-uart.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/firmware_msc_fat.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/libb64/cdecode.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/libb64/cencode.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/main.cpp.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/stdlib_noniso.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/wiring_pulse.c.o
Compiling .pio/build/wemos_d1_uno32/FrameworkArduino/wiring_shift.c.o
Archiving .pio/build/wemos_d1_uno32/libFrameworkArduino.a
Indexing .pio/build/wemos_d1_uno32/libFrameworkArduino.a
Linking .pio/build/wemos_d1_uno32/firmware.elf
Retrieving maximum program size .pio/build/wemos_d1_uno32/firmware.elf
Checking size .pio/build/wemos_d1_uno32/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [== ] 18.0% (used 58864 bytes from 327680 bytes)
Flash: [====== ] 59.1% (used 774165 bytes from 1310720 bytes)
Building .pio/build/wemos_d1_uno32/firmware.bin
esptool.py v4.2.1
Creating esp32 image...
Merged 25 ELF sections
Successfully created esp32 image.
===================================== [SUCCESS] Took 18.02 seconds =====================================
#include <custom_messages/msg/Position2D.h>
did a platformio run
and it fails:fatal error: custom_messages/msg/Position.h: No such file or directory
#include <custom_messages/msg/Position2D.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
like described [here](@Acuadros95 in #42 (comment)_) by @Acuadros95
fatal error: custom_messages/msg/Position2D.h: No such file or directory
#include <custom_messages/msg/Position2D.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Also tried renaming the Position2D.msg to Position.msg and rebuild/recompile everything without luck.
I got back to working on my project after a couple of months. When I tried to build it, it no longer compiled because the library builder pulled newer version of micro-ROS packages that contained API changes that were not compatible with my code.
I think this library should either be tied to specific versions of the packages and have a library auto-update workflow (similar to the on micro_ros_arduino) or allow the user to specify the versions.
Hardware description: Teensy 4.1
RTOS: micro-ROS arduino
Version or commit hash: main
platform.ini file:
[env:teensy41]
platform = teensy
board = teensy41
board_microros_distro = galactic
board_microros_transport = serial
framework = arduino
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio
compile
Error
Requirement already satisfied: markupsafe==2.0.1 in c:\users\v-mifass\.platformio\penv\lib\site-packages (2.0.1)
Configuring teensy41 with transport serial
Downloading micro-ROS dev dependencies
ament_cmake clone failed:
fatal: Too many arguments.
#include <Arduino.h>
#include <micro_ros_platformio.h>
#include <rcl/rcl.h>
#include <rclc/rclc.h>
#include <rclc/executor.h>
#include <std_msgs/msg/int32.h>
#if !defined(MICRO_ROS_TRANSPORT_ARDUINO_SERIAL)
#error This example is only avaliable for Arduino framework with serial transport.
#endif
#if defined(MICRO_ROS_TRANSPORT_ARDUINO_WIFI)
#include <WiFi.h>
#endif
rcl_publisher_t publisher;
std_msgs__msg__Int32 msg;
rclc_executor_t executor;
rclc_support_t support;
rcl_allocator_t allocator;
rcl_node_t node;
rcl_timer_t timer;
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}}
#define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}}
// Error handle loop
void error_loop() {
while(1) {
delay(100);
}
}
void timer_callback(rcl_timer_t * timer, int64_t last_call_time) {
RCLC_UNUSED(last_call_time);
if (timer != NULL) {
RCSOFTCHECK(rcl_publish(&publisher, &msg, NULL));
msg.data++;
}
}
void setup() {
set_microros_wifi_transports("WiFI", "PASSWD", "AgentSERVER", 8888);
// Configure serial transport
Serial.begin(115200);
set_microros_serial_transports(Serial);
delay(2000);
allocator = rcl_get_default_allocator();
//create init_options
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
// create node
RCCHECK(rclc_node_init_default(&node, "micro_ros_platformio_node", "", &support));
// create publisher
RCCHECK(rclc_publisher_init_default(
&publisher,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32),
"micro_ros_platformio_node_publisher"));
// create timer,
const unsigned int timer_timeout = 1000;
RCCHECK(rclc_timer_init_default(
&timer,
&support,
RCL_MS_TO_NS(timer_timeout),
timer_callback));
// create executor
RCCHECK(rclc_executor_init(&executor, &support.context, 1, &allocator));
RCCHECK(rclc_executor_add_timer(&executor, &timer));
msg.data = 0;
}
void loop() {
delay(100);
RCSOFTCHECK(rclc_executor_spin_some(&executor, RCL_MS_TO_NS(100)));
}
platformio.ini
[env:seeed_xiao_esp32c3]
platform = espressif32
board = seeed_xiao_esp32c3
framework = arduino
board_microros_transport = wifi
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio
warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
src/main.cpp:46:79: error: conversion from 'const char [14]' to 'IPAddress' is ambiguous
In file included from /home/w0x7ce/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:170,
from src/main.cpp:1:
/home/w0x7ce/.platformio/packages/framework-arduinoespressif32/cores/esp32/IPAddress.h:51:5: note: candidate: 'IPAddress::IPAddress(const uint8_t*)' <near match>
IPAddress(const uint8_t *address);
^~~~~~~~~
/home/w0x7ce/.platformio/packages/framework-arduinoespressif32/cores/esp32/IPAddress.h:51:5: note: conversion of argument 1 would be ill-formed:
src/main.cpp:46:58: error: invalid conversion from 'const char*' to 'const uint8_t*' {aka 'const unsigned char*'} [-fpermissive]
set_microros_wifi_transports("SEEED-MKT", "depot0518", "192.168.6.198", 8888);
^~~~~~~~~~~~~~~
In file included from /home/w0x7ce/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:170,
from src/main.cpp:1:
/home/w0x7ce/.platformio/packages/framework-arduinoespressif32/cores/esp32/IPAddress.h:50:5: note: candidate: 'IPAddress::IPAddress(uint32_t)' <near match>
IPAddress(uint32_t address);
^~~~~~~~~
/home/w0x7ce/.platformio/packages/framework-arduinoespressif32/cores/esp32/IPAddress.h:50:5: note: conversion of argument 1 would be ill-formed:
src/main.cpp:46:58: error: invalid conversion from 'const char*' to 'uint32_t' {aka 'long unsigned int'} [-fpermissive]
set_microros_wifi_transports("SEEED-MKT", "depot0518", "192.168.6.198", 8888);
^~~~~~~~~~~~~~~
In file included from .pio/libdeps/seeed_xiao_esp32c3/micro_ros_platformio/platform_code/micro_ros_platformio.h:34,
from src/main.cpp:2:
.pio/libdeps/seeed_xiao_esp32c3/micro_ros_platformio/platform_code/arduino/wifi/micro_ros_transport.h:9:20: note: initializing argument 3 of 'void set_microros_wifi_transports(char*, char*, IPAddress, uint16_t)'
static inline void set_microros_wifi_transports(char * ssid, char * pass, IPAddress agent_ip, uint16_t agent_port){
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.cpp:50:3: error: 'set_microros_serial_transports' was not declared in this scope
set_microros_serial_transports(Serial);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.cpp:50:3: note: suggested alternative: 'set_microros_wifi_transports'
set_microros_serial_transports(Serial);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set_microros_wifi_transports
*** [.pio/build/seeed_xiao_esp32c3/src/main.cpp.o] Error 1
Hardware description: Teensy 4.1
Installation type: Ubuntu 22.04.1, ROS2 (humble)
Version or commit hash: ROS-humble
Platformio Core 6.1.4·Home 3.4.3 withing VS-Code 1.72.2
Steps to reproduce the issue
Take Source code below, check how service AddTwoInts was "duplicated" and adjusted for Service "SetBool"
Create project in platformio
set-up your platformio.ini as the below code-sample
use proper build workflow: (a) clean, or delete .pio folder, b) pio lib install, c) pio run, d) pio run
Expected behavior
Compile without error and actually work on target, creating two individual services under single node
Actual behavior
Compiles just fine, but once loaded into target, the initialization of second service (setBool) will cause the error_loop to be called.
This is in line
RCCHECK(rclc_service_init_default(&service_setBool, &node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, SetBool), "/setbool"));
Additional Information
Each service works by itself. Removing (commenting) one or the other results in proper function.
There must be something wrong with the RCCHECK? Tracking it back, it returns error code
RCL_RET_OK
I found the definition in file types.h:
/// Success return code.
#define RCL_RET_OK RMW_RET_OK
/// Unspecified error return code.
#define RCL_RET_ERROR RMW_RET_ERROR
/// Timeout occurred return code.
#define RCL_RET_TIMEOUT RMW_RET_TIMEOUT
/// Failed to allocate memory return code.
#define RCL_RET_BAD_ALLOC RMW_RET_BAD_ALLOC
/// Invalid argument return code.
#define RCL_RET_INVALID_ARGUMENT RMW_RET_INVALID_ARGUMENT
/// Unsupported return code.
#define RCL_RET_UNSUPPORTED RMW_RET_UNSUPPORTED
Hovering with the mouse over the individual #defines, the tooltip revealed the "1" seen in my debug output resolves to
RMW_RET_ERROR
with the comment above:
/// Unspecified error return code.
platfomio.ini
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
board_microros_transport = serial
monitor_port = /dev/ttyUSB0
board_microros_distro = humble
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio
Source code
#include <Arduino.h>
#include <Wire.h>
#include <micro_ros_platformio.h>
#include <example_interfaces/srv/add_two_ints.h>
#include <example_interfaces/srv/set_bool.h>
#include <stdio.h>
#include <rcl/error_handling.h>
#include <rcl/rcl.h>
#include <rclc/rclc.h>
#include <rclc/executor.h>
#include <std_msgs/msg/int32.h>
#include <std_msgs/msg/int64.h>
#include <std_msgs/msg/bool.h>
#if !defined(MICRO_ROS_TRANSPORT_ARDUINO_SERIAL)
#error This example is only avaliable for Arduino framework with serial transport.
#endif
// ============================================================================
// INSTANCES, OBJECTS
// ============================================================================
// publisher and subscriber common
rcl_node_t node;
rclc_support_t support;
rcl_allocator_t allocator;
rclc_executor_t executor;
rcl_timer_t timer;
unsigned int num_handles = 4; // 1 subscriber, 1 publisher, 2 service
// service addTwoInts
rcl_service_t service_addTwoInts;
// service setBool
rcl_service_t service_setBool;
rcl_wait_set_t wait_set;
//publisher
rcl_publisher_t publisher;
std_msgs__msg__Int32 msg_pub;
// subscriber
rcl_subscription_t subscriber;
std_msgs__msg__Int32 msg_sub;
example_interfaces__srv__AddTwoInts_Response res;
example_interfaces__srv__AddTwoInts_Request req;
example_interfaces__srv__SetBool_Response res_setBool;
example_interfaces__srv__SetBool_Request req_setBool;
// ============================================================================
// DEFINES
// ============================================================================
// I/O - Definitions
#define LED_PIN 13
// ============================================================================
// FUNCTION PROTOTYPES
// ============================================================================
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}}
#define RCSOFTCHECK(fn) {rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}}
// Error handle loop
void error_loop() {
while(1) {
digitalWrite(LED_PIN, !digitalRead(LED_PIN));
delay(500);
}
}
// --------------------------------------------------------
// timer callback (currently just increments msg_pub.data)
void timer_callback(rcl_timer_t * timer, int64_t last_call_time) {
RCLC_UNUSED(last_call_time);
if (timer != NULL) {
RCSOFTCHECK(rcl_publish(&publisher, &msg_pub, NULL));
msg_pub.data++;
}
}
// --------------------------------------------------------
// subscriber callback
void subscription_callback(const void * msgin) {
const std_msgs__msg__Int32 * msg = (const std_msgs__msg__Int32 *)msgin;
digitalWrite(LED_PIN, (msg->data == 0) ? LOW : HIGH);
}
// --------------------------------------------------------
// srv.addTwoInts callback
void service_addTwoInts_callback(const void * req, void * res) {
example_interfaces__srv__AddTwoInts_Request * req_in = (example_interfaces__srv__AddTwoInts_Request *) req;
example_interfaces__srv__AddTwoInts_Response * res_in = (example_interfaces__srv__AddTwoInts_Response *) res;
//printf("Service request value: %d + %d.\n", (int) req_in->a, (int) req_in->b);
res_in->sum = req_in->a + req_in->b;
}
// --------------------------------------------------------
// srv.setBool callback
void service_setBool_callback(const void * req_setBool, void * res_setBool) {
bool previousState = digitalRead(LED_PIN);
example_interfaces__srv__SetBool_Request * req_in = (example_interfaces__srv__SetBool_Request *) req_setBool;
example_interfaces__srv__SetBool_Response * res_in = (example_interfaces__srv__SetBool_Response *) res_setBool;
digitalWrite(LED_PIN, (req_in->data == 0) ? LOW:HIGH);
if (previousState != digitalRead(LED_PIN)) {
res_in->success = true;
}
else {
res_in->success = false;
}
}
// ============================================================================
// SETUP
// ============================================================================
void setup() {
set_microros_serial_transports(Serial);
// I/O setup
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, HIGH);
delay(1000);
allocator = rcl_get_default_allocator();
// create init_options
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
// create node
RCCHECK(rclc_node_init_default(&node, "uros_platformio_node", "", &support));
// create service addTwoInts
RCCHECK(rclc_service_init_default(&service_addTwoInts, &node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, AddTwoInts), "/addtwoints"));
// create service setBool
RCCHECK(rclc_service_init_default(&service_setBool, &node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, SetBool), "/setbool"));
// create publisher
RCCHECK(rclc_publisher_init_default(&publisher, &node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32), "micro_ros_platformio_node_publisher"));
// create subscriber
RCCHECK(rclc_subscription_init_default(&subscriber, &node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32), "micro_ros_platformio_node_subscriber"));
// create timer,
const unsigned int timer_timeout = 1000;
RCCHECK(rclc_timer_init_default(&timer, &support, RCL_MS_TO_NS(timer_timeout), timer_callback));
// create executor
RCCHECK(rclc_executor_init(&executor, &support.context, num_handles, &allocator));
RCCHECK(rclc_executor_add_service(&executor, &service_addTwoInts, &req, &res, service_addTwoInts_callback));
RCCHECK(rclc_executor_add_service(&executor, &service_setBool, &req_setBool, &res_setBool, service_setBool_callback));
RCCHECK(rclc_executor_add_subscription(&executor, &subscriber, &msg_sub, &subscription_callback, ON_NEW_DATA));
RCCHECK(rclc_executor_add_timer(&executor, &timer));
msg_pub.data = 0;
}
// ============================================================================
// MAIN LOOP
// ============================================================================
void loop() {
delay(100);
RCSOFTCHECK(rclc_executor_spin_some(&executor, RCL_MS_TO_NS(100)));
}
Hi,
I used this repo on a Portenta H7, in oder to use native_ethernet i had to replace:
platform_code/arduino/native_ethernet/micro_ros_transport.cpp
#5 #include <NativeEthernetUdp.h> with <EthernetUdp.h>
and
platform_code/arduino/native_ethernet/micro_ros_transport.h
#1 #include <NativeEthernet.h> with #include <EthernetUdp.h>
I would create a pull request, but i don't know how to embed it into the existing system.
I'm trying to follow the tutorial from microROS custom messages: [https://micro.ros.org/docs/tutorials/advanced/create_new_type/]
Is there a similar way to do this custom messages in the platformIO version?
Check readme https://github.com/micro-ROS/micro_ros_platformio#transport-configuration
Check code https://github.com/micro-ROS/micro_ros_platformio/blob/main/platform_code/arduino/wifi/micro_ros_transport.cpp
ROS2 computer can communicate with ESP32 device using wifi. This is documented in the readme.
Wifi support is undocumented
If it's not yet implemented I might try this https://github.com/NITKK-ROS-Team/micro_ros_arduino_simpler#readme as it supports wifi I think.
Hi there,
After successfully implemented Micro ROS on my Teensy 4.1 I gave it a try on a ESP32 but for some reason it it hangs on rclc_support_init_with_options() after setting my domain ID.
here is my code:
#include <Arduino.h>
#include <micro_ros_platformio.h>
#include <rcl/rcl.h>
#include <rclc/rclc.h>
#include <rclc/executor.h>
#include <std_msgs/msg/int32.h>
#include <std_msgs/msg/float32_multi_array.h>
#include <std_msgs/msg/bool.h>
#define ROS_DOMAIN_ID 10
#define WIFI_SSID "someSSID"
#define WIFI_PASS "somePW"
rclc_executor_t executor;
rclc_support_t support;
rcl_allocator_t allocator;
rcl_node_t node;
rcl_timer_t timer;
rcl_publisher_t publisher;
std_msgs__msg__Float32MultiArray msg_out_act_position;
rcl_subscription_t subscriber_position;
std_msgs__msg__Bool msg_in_new_position;
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop(temp_rc);}}
#define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}}
void error_loop(rcl_ret_t returnCode){
Serial.print("Error in ROS with return code: ");
Serial.println(returnCode);
while(1) {
digitalWrite(LED_PIN, !digitalRead(LED_PIN));
delay(500);
}
}
void subscription_cb_new_position(const void * msgIn) {
Serial.print("Got a ros 'msg_in_new_position' message!");
}
void setup() {
Serial.begin(115200);
while (!Serial);
IPAddress agent_ip(172, 10, 10, 182);
size_t agent_port = 8888;
char SSID[] = WIFI_SSID;
char PASS[] = WIFI_PASS;
set_microros_wifi_transports(SSID, PASS, agent_ip, agent_port);
Serial.println("01: Initialized Wifi");
delay(1000);
allocator = rcl_get_default_allocator();
Serial.println("02: Initialized ROS allocator");
rcl_init_options_t init_options = rcl_get_zero_initialized_init_options();
Serial.println("03: Initialized ROS init options");
RCCHECK(rcl_init_options_init(&init_options, allocator));
Serial.println("04: processed ROS init options");
RCCHECK(rcl_init_options_set_domain_id(&init_options, 10));
Serial.println("05: set ROS domain ID");
RCCHECK(rclc_support_init_with_options(&support, 0, NULL, &init_options, &allocator));
Serial.println("06: Initialize ROS support with options");
rcl_ret_t returnNode = rclc_node_init_default(&node, "dixy_transporter", "", &support);
if(returnNode != 0) {
error_loop(returnNode);
}
Serial.println("07: Initialized ROS returnNode");
// create publisher "act_position"
RCCHECK(
rclc_publisher_init_best_effort(
&publisher,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Float32MultiArray),
"act_position"
)
);
Serial.println("08: Initialized ROS publisher");
// create subscriber "new_position"
RCCHECK(
rclc_subscription_init_best_effort(
&subscriber_position,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Float32MultiArray),
"new_position"
)
);
Serial.println("09: Initialized ROS subscriber_position");
// create executor
RCCHECK(
rclc_executor_init(
&executor,
&support.context,
1,
&allocator
)
);
Serial.println("10: Initialized ROS executor");
RCCHECK(
rclc_executor_add_subscription(
&executor,
&subscriber_position,
&msg_in_new_position,
&subscription_cb_new_position,
ON_NEW_DATA
)
);
Serial.println("11: Initialized ROS subscribers with the executor");
Serial.println("-----------------end setup--------------------");
}
//*
Any idea what is going wrong here, almost the same code is running without issues on my teensy 4.1 using native_ethernet
Continue after rclc_support_init_with_options
This is the serial out put:
01: Initialized Wifi
02: Initialized ROS allocator
03: Initialized ROS init options
04: processed ROS init options
05: set ROS domain ID
Error in ROS with return code: 1
My platformio.ini:
[env:wemos_d1_uno32]
platform = espressif32
board = wemos_d1_uno32
framework = arduino
board_microros_transport = wifi
monitor_speed = 115200
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio
I wanted to post this on ROS answers but is seems to be impossible to login there....
Thanks, MartijnD
I'm trying to publish String type message, but having some trouble doing it in the microROS version.
platformIO.ini
[env:esp32doit-devkit-v1]
; [env: heltec_wifi_lora_32_V2]
platform = espressif32
board = esp32doit-devkit-v1
; board = heltec_wifi_lora_32_V2
board_microros_transport = wifi ;serial ;wifi ;wifi_nina
board_microros_distro = foxy
framework = arduino
monitor_speed = 115200
lib_deps =
adafruit/Adafruit BusIO @ ^1.12.0
sparkfun/SparkFun u-blox GNSS Arduino Library @ ^2.2.10
https://github.com/micro-ROS/micro_ros_platformio # for microROS
stevemarple/SoftWire @ ^2.0.9
stevemarple/AsyncDelay @ ^1.1.2
adafruit/RTClib @ ^2.0.3
main.cpp
#include <Arduino.h>
#include <micro_ros_platformio.h>
#include <rcl/rcl.h>
#include <rclc/rclc.h>
#include <rclc/executor.h>
#include <micro_ros_utilities/type_utilities.h>
#include <micro_ros_utilities/string_utilities.h>
#include <std_msgs/msg/int32.h> //for integer messages
#include <std_msgs/msg/string.h>
#include "freertos/FreeRTOS.h" // freeRTOS Libraries
#include "freertos/task.h" // freeRTOS Task Header
#include "esp_system.h"
#include "soc/rtc_wdt.h"
#include <mySD.h>
#include <SparkFun_u-blox_GNSS_Arduino_Library.h>
//publisher initialization
rcl_publisher_t publisher;
rcl_publisher_t publisher2;
std_msgs__msg__Int32 msg;
std_msgs__msg__String msg_gps;
//rclc initialization...
rclc_executor_t executor;
rclc_support_t support;
rcl_allocator_t allocator;
rcl_node_t node;
rcl_timer_t timer;
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}}
#define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}}
// Error handle loop
void error_loop() {
while(1) {
delay(100);
}
}
//This is the function where the message data is set and the msg are actually published. RCLCPP_INFO macro ensures every published msg is printed to the console
void timer_callback(rcl_timer_t * timer, int64_t last_call_time) {
RCLC_UNUSED(last_call_time);
if (timer != NULL) {
RCSOFTCHECK(rcl_publish(&publisher, &msg, NULL));
msg.data+=1;
}
}
void setup() {
// ----------- Configure serial transport
Serial.begin(115200);
// set_microros_serial_transports(Serial);
//***** For Router WiFi....
IPAddress agent_ip(---, ---, --, --);
size_t agent_port = 8888;
char ssid[] = "----------";
char psk[]= "----------";
set_microros_wifi_transports(ssid, psk, agent_ip, agent_port);
//=========================ROS2 stuff setup..............===================
allocator = rcl_get_default_allocator();
//create init_options
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
// create node
RCCHECK(rclc_node_init_default(&node, "micro_ros_platformio_node", "", &support));
// create publisher
RCCHECK(rclc_publisher_init_default(
&publisher,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32),
"micro_ros_platformio_node_publisher"));
// create publisher2
RCCHECK(rclc_publisher_init_default(
&publisher2,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg_gps, String),
"micro_ros_platformio_node_publisher_lat"));
// micro_ros_utilities_create_message_memory(
// ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg_gps, String),
// &msg_gps,
// (micro_ros_utilities_memory_conf_t) {}
// );
// create timer,
const unsigned int timer_timeout = 1000;
RCCHECK(rclc_timer_init_default(
&timer,
&support,
RCL_MS_TO_NS(timer_timeout),
timer_callback));
// create executor
RCCHECK(rclc_executor_init(&executor, &support.context, 1, &allocator));
RCCHECK(rclc_executor_add_timer(&executor, &timer));
msg.data = 0;
}
void loop() {
delay(100);
RCSOFTCHECK(rclc_executor_spin_some(&executor, RCL_MS_TO_NS(100)));
}
Error message: pio run
src/main.cpp: In function 'void setup()':
.pio/libdeps/esp32doit-devkit-v1/micro_ros_platformio/libmicroros/include/rosidl_runtime_c/message_type_support_struct.h:78:5: error: 'rosidl_typesupport_c__get_message_type_support_handle__std_msgs__msg_gps__String' was not declared in this scope
rosidl_typesupport_c, PkgName, MsgSubfolder, MsgName)()
^~~~~~~~~~~~~~~~~~~~
src/main.cpp:39:43: note: in definition of macro 'RCCHECK'
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}}
^~
.pio/libdeps/esp32doit-devkit-v1/micro_ros_platformio/libmicroros/include/rosidl_typesupport_interface/macros.h:27:3: note: in expansion of macro 'ROSIDL_TYPESUPPORT_INTERFACE__SYMBOL_NAME'
ROSIDL_TYPESUPPORT_INTERFACE__SYMBOL_NAME( \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.pio/libdeps/esp32doit-devkit-v1/micro_ros_platformio/libmicroros/include/rosidl_runtime_c/message_type_support_struct.h:77:3: note: in expansion of macro 'ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME'
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME( \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.cpp:277:5: note: in expansion of macro 'ROSIDL_GET_MSG_TYPE_SUPPORT'
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg_gps, String),
^~~~~~~~~~~~~~~~~~~~~~~~~~~
.pio/libdeps/esp32doit-devkit-v1/micro_ros_platformio/libmicroros/include/rosidl_runtime_c/message_type_support_struct.h:78:5: note: suggested alternative: 'rosidl_typesupport_c__get_message_type_support_handle__std_msgs__msg__String'
rosidl_typesupport_c, PkgName, MsgSubfolder, MsgName)()
^~~~~~~~~~~~~~~~~~~~
src/main.cpp:39:43: note: in definition of macro 'RCCHECK'
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}}
^~
.pio/libdeps/esp32doit-devkit-v1/micro_ros_platformio/libmicroros/include/rosidl_typesupport_interface/macros.h:27:3: note: in expansion of macro 'ROSIDL_TYPESUPPORT_INTERFACE__SYMBOL_NAME'
ROSIDL_TYPESUPPORT_INTERFACE__SYMBOL_NAME( \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.pio/libdeps/esp32doit-devkit-v1/micro_ros_platformio/libmicroros/include/rosidl_runtime_c/message_type_support_struct.h:77:3: note: in expansion of macro 'ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME'
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME( \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.cpp:277:5: note: in expansion of macro 'ROSIDL_GET_MSG_TYPE_SUPPORT'
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg_gps, String),
^~~~~~~~~~~~~~~~~~~~~~~~~~~
*** [.pio/build/esp32doit-devkit-v1/src/main.cpp.o] Error 1
Publishing String type messege
Hardware description: Teensy 4.1
Installation type: Ubuntu 22.04.1, ROS2 (humble)
Version or commit hash: ROS-humble
Platformio Core 6.1.4·Home 3.4.3 withing VS-Code 1.72.2
Take Source code below, attempt to compile
Create project in platformio
set-up your platformio.ini as the below code-sample
use proper build workflow: (a) clean, and delete .pio folder, b) pio lib install, c) pio run,
Compile without error
Causes an error:
src/main.cpp: In function 'void setup()':
.pio/libdeps/teensy41/micro_ros_platformio/libmicroros/include/rosidl_runtime_c/message_type_support_struct.h:78:59: error: 'rosidl_typesupport_c__get_message_type_support_handle__sesnsor_msgs__msg__Range' was not declared in this scope
rosidl_typesupport_c, PkgName, MsgSubfolder, MsgName)()
^
src/main.cpp:107:43: note: in definition of macro 'RCCHECK'
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}}
^
src/main.cpp:330:64: note: in expansion of macro 'ROSIDL_GET_MSG_TYPE_SUPPORT'
RCCHECK(rclc_publisher_init_default(&publisher_range, &node, ROSIDL_GET_MSG_TYPE_SUPPORT(sesnsor_msgs, msg, Range), "micro_ros_platformio_node_publisher_range"));
This is in line causing the error
RCCHECK(rclc_publisher_init_default(&publisher_range, &node, ROSIDL_GET_MSG_TYPE_SUPPORT(sesnsor_msgs, msg, Range), "micro_ros_platformio_node_publisher_range"));
directory tree of .pio clearly shows the presence of sensor_msgs and the supporting structure
.pio
├── bin
└── libdeps
└── teensy41
└── micro_ros_platformio
├── libmicroros
│ ├── include
│ │ ├── sensor_msgs
│ │ │ ├── msg
│ │ │ │ ├── battery_state.h
│ │ │ │ ├── camera_info.h
│ │ │ │ ├── channel_float32.h
│ │ │ │ ├── compressed_image.h
│ │ │ │ ├── detail
│ │ │ │ │ ├── battery_state__functions.c
│ │ │ │ │ ├── battery_state__functions.h
│ │ │ │ │ ├── ...
│ │ │ │ │ ├── range__functions.c
│ │ │ │ │ ├── range__functions.h
│ │ │ │ │ ├── range__rosidl_typesupport_introspection_c.h
│ │ │ │ │ ├── range__rosidl_typesupport_microxrcedds_c.h
│ │ │ │ │ ├── range__struct.h
│ │ │ │ │ ├── range__type_support.c
│ │ │ │ │ ├── range__type_support.h
│ │ │ │ │ ├── region_of_interest__functions.c
│ │ │ │ │ ├── region_of_interest__functions.h
│ │ │ │ │ ├── ...
│ │ │ │ ├── fluid_pressure.h
│ │ │ │ ├── ...
│ │ │ │ ├── range.h
│ │ │ │ ├── region_of_interest.h
│ │ │ │ ├── ...
│ │ │ └── srv
│ │ │ ├── detail
platfomio.ini
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
board_microros_transport = serial
monitor_port = /dev/ttyUSB0
board_microros_distro = humble
board_microros_user_meta = custom.meta
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio
Source code
#include <Arduino.h>
#include <Wire.h>
#include <micro_ros_platformio.h>
#include <example_interfaces/srv/add_two_ints.h>
#include <example_interfaces/srv/set_bool.h>
#include <teensy_interfaces/srv/neo_pixel_control.h>
#include <stdio.h>
#include <global.h>
#include <config.h>
#include <setup.h>
#include <rcl/error_handling.h>
#include <rcl/rcl.h>
#include <rclc/rclc.h>
#include <rclc/executor.h>
#include <std_msgs/msg/int32.h>
#include <std_msgs/msg/int64.h>
#include <std_msgs/msg/bool.h>
#include <sensor_msgs/msg/range.h>
#include <WS2812Serial.h>
#if !defined(MICRO_ROS_TRANSPORT_ARDUINO_SERIAL)
#error This example is only avaliable for Arduino framework with serial transport.
#endif
volatile int TFMiniVal = 0;
volatile int TFMiniStrength = 0;
int TFMini_FloorDistance = 30;
int TFMini_FloorDistanceTolerance = 12;
// ============================================================================
// INSTANCES, OBJECTS
// ============================================================================
// publisher and subscriber common
rcl_node_t node;
rclc_support_t support;
rcl_allocator_t allocator;
rclc_executor_t executor;
rcl_timer_t timer;
unsigned int num_handles = 7; // 1 subscribers, 2 publishers, 4 services
// service addTwoInts
// rcl_service_t service_addTwoInts;
// services
rcl_service_t service_FrontLights;
rcl_service_t service_RearLights;
rcl_service_t service_OdriveFans;
rcl_service_t service_NeoPixel;
rcl_wait_set_t wait_set;
// msg_pub publisher
rcl_publisher_t publisher;
std_msgs__msg__Int32 msg_pub;
// msg_pub_range publisher
rcl_publisher_t publisher_range;
sensor_msgs__msg__Range msg_pub_range;
// subscriber
rcl_subscription_t subscriber;
std_msgs__msg__Int32 msg_sub;
// example_interfaces__srv__AddTwoInts_Response res;
// example_interfaces__srv__AddTwoInts_Request req;
example_interfaces__srv__SetBool_Request req_FrontLights;
example_interfaces__srv__SetBool_Response res_FrontLights;
example_interfaces__srv__SetBool_Request req_RearLights;
example_interfaces__srv__SetBool_Response res_RearLights;
example_interfaces__srv__SetBool_Request req_OdriveFans;
example_interfaces__srv__SetBool_Response res_OdriveFans;
teensy_interfaces__srv__NeoPixelControl_Request req_NeoPixel;
teensy_interfaces__srv__NeoPixelControl_Response res_NeoPixel;
// Left NeoPixel
byte dwgMem_NeoPixel_L[numNeoPixel_L*3]; // 3 bytes per LED
DMAMEM byte dispMem_NeoPixel_L[numNeoPixel_L*12]; // 12 bytes per LED
WS2812Serial objNeoPixel_L(numNeoPixel_L, dispMem_NeoPixel_L, dwgMem_NeoPixel_L, pinNeoPixel_L, WS2812_GRB);
// Right NeoPixel
byte dwgMem_NeoPixel_R[numNeoPixel_R*3]; // 3 bytes per LED
DMAMEM byte dispMem_NeoPixel_R[numNeoPixel_R*12]; // 12 bytes per LED
WS2812Serial objNeoPixel_R(numNeoPixel_R, dispMem_NeoPixel_R, dwgMem_NeoPixel_R, pinNeoPixel_R, WS2812_GRB);
// ============================================================================
// DEFINES
// ============================================================================
// I/O - Definitions
#define LED_PIN 13
// cleartext substitutions
// debug
#ifndef DebugMonitor
#define DebugMonitor Serial6
#endif
#define debug(x) DebugMonitor.print(x)
#define debugln(x) DebugMonitor.println(x)
// ============================================================================
// FUNCTION PROTOTYPES
// ============================================================================
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}}
#define RCSOFTCHECK(fn) {rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}}
// --------------------------------------------------------
// NeoPixel.colorWipe
void colorWipe(int, int, WS2812Serial);
// TFMini-Plus
void readTFMiniPlus(void);
// Error handle loop
void error_loop() {
while(1) {
digitalWrite(LED_PIN, !digitalRead(LED_PIN));
delay(500);
}
}
// --------------------------------------------------------
// timer callback (currently just increments msg_pub.data)
void timer_callback(rcl_timer_t * timer, int64_t last_call_time) {
RCLC_UNUSED(last_call_time);
if (timer != NULL) {
// increments msg_pub.data and publishes on the topic
RCSOFTCHECK(rcl_publish(&publisher, &msg_pub, NULL));
msg_pub.data++;
// publishes the latest value from TFMini-Plus
msg_pub_range.range = TFMiniVal;
msg_pub_range.min_range = 0;
msg_pub_range.max_range = 1000;
msg_pub_range.radiation_type = sensor_msgs__msg__Range__INFRARED;
msg_pub_range.field_of_view = 0.04;
msg_pub_range.header.frame_id.data = "TFMini-Plus";
RCSOFTCHECK(rcl_publish(&publisher, &msg_pub_range, NULL));
}
}
// --------------------------------------------------------
// subscriber callback
void subscription_callback(const void * msgin) {
const std_msgs__msg__Int32 * msg = (const std_msgs__msg__Int32 *)msgin;
digitalWrite(LED_PIN, (msg->data == 0) ? LOW : HIGH);
}
// --------------------------------------------------------
// srv.addTwoInts callback
// void service_addTwoInts_callback(const void * req, void * res) {
// example_interfaces__srv__AddTwoInts_Request * req_in = (example_interfaces__srv__AddTwoInts_Request *) req;
// example_interfaces__srv__AddTwoInts_Response * res_in = (example_interfaces__srv__AddTwoInts_Response *) res;
// //printf("Service request value: %d + %d.\n", (int) req_in->a, (int) req_in->b);
// res_in->sum = req_in->a + req_in->b;
// }
// --------------------------------------------------------
// srv.FrontLights callback
void service_FrontLights_callback(const void * req_FrontLights, void * res_FrontLights) {
bool previousState = digitalRead(FRONT_LIGHT);
example_interfaces__srv__SetBool_Request * req_in = (example_interfaces__srv__SetBool_Request *) req_FrontLights;
example_interfaces__srv__SetBool_Response * res_in = (example_interfaces__srv__SetBool_Response *) res_FrontLights;
digitalWrite(FRONT_LIGHT, (req_in->data == 0) ? LOW:HIGH);
if (previousState != digitalRead(FRONT_LIGHT)) {
res_in->success = true;
res_in->message.data = const_cast<char*>("Front Lights succeeded to update");
}
else {
res_in->success = false;
res_in->message.data = const_cast<char*>("Front Lights FAILED to update");
}
}
// --------------------------------------------------------
// srv.RearLights callback
void service_RearLights_callback(const void * req_RearLights, void * res_RearLights) {
bool previousState = digitalRead(REAR_LIGHT);
example_interfaces__srv__SetBool_Request * req_in = (example_interfaces__srv__SetBool_Request *) req_RearLights;
example_interfaces__srv__SetBool_Response * res_in = (example_interfaces__srv__SetBool_Response *) res_RearLights;
digitalWrite(REAR_LIGHT, (req_in->data == 0) ? LOW:HIGH);
if (previousState != digitalRead(REAR_LIGHT)) {
res_in->success = true;
res_in->message.data = const_cast<char*>("Rear Lights succeeded to update");
}
else {
res_in->success = false;
res_in->message.data = const_cast<char*>("Rear Lights FAILED to update");
}
}
// --------------------------------------------------------
// srv.OdriveFans callback
void service_OdriveFans_callback(const void * req_OdriveFans, void * res_OdriveFans) {
bool previousState = digitalRead(ODRIVE_FAN);
example_interfaces__srv__SetBool_Request * req_in = (example_interfaces__srv__SetBool_Request *) req_OdriveFans;
example_interfaces__srv__SetBool_Response * res_in = (example_interfaces__srv__SetBool_Response *) res_OdriveFans;
digitalWrite(ODRIVE_FAN, (req_in->data == 0) ? LOW:HIGH);
if (previousState != digitalRead(ODRIVE_FAN)) {
res_in->success = true;
res_in->message.data = const_cast<char*>("Odrive Fans succeeded to update");
}
else {
res_in->success = false;
res_in->message.data = const_cast<char*>("Odrive Fans FAILED to update");
}
}
// --------------------------------------------------------
// srv.NeoPixel callback
void service_NeoPixel_callback(const void * req_NeoPixel, void * res_NeoPixel) {
teensy_interfaces__srv__NeoPixelControl_Request * req_in = (teensy_interfaces__srv__NeoPixelControl_Request *) req_NeoPixel;
teensy_interfaces__srv__NeoPixelControl_Response * res_in = (teensy_interfaces__srv__NeoPixelControl_Response *) res_NeoPixel;
switch(req_in->status) {
case 1:
colorWipe(ORANGE, 10, objNeoPixel_L);
colorWipe(ORANGE, 10, objNeoPixel_R);
break;
case 2:
colorWipe(RED, 10, objNeoPixel_L);
colorWipe(RED, 10, objNeoPixel_R);
break;
case 3:
colorWipe(GREEN, 10, objNeoPixel_L);
colorWipe(GREEN, 10, objNeoPixel_R);
break;
case 4:
colorWipe(BLUE, 10, objNeoPixel_L);
colorWipe(BLUE, 10, objNeoPixel_R);
break;
case 5:
colorWipe(YELLOW, 10, objNeoPixel_L);
colorWipe(YELLOW, 10, objNeoPixel_R);
break;
case 6:
colorWipe(PINK, 10, objNeoPixel_L);
colorWipe(PINK, 10, objNeoPixel_R);
break;
case 7:
colorWipe(ORANGE, 10, objNeoPixel_L);
colorWipe(ORANGE, 10, objNeoPixel_R);
break;
case 8:
colorWipe(WHT, 10, objNeoPixel_L);
colorWipe(WHT, 10, objNeoPixel_R);
break;
default:
colorWipe(BLANK, 10, objNeoPixel_L);
colorWipe(BLANK, 10, objNeoPixel_R);
break;
}
res_in->success = true;
res_in->message.data = const_cast<char*>("Neopixel changed");
// res_in->success = true;
// res_in->message.data = const_cast<char*>("Neopixel blanked");
}
// ============================================================================
// SETUP
// ============================================================================
void setup() {
set_microros_serial_transports(Serial);
// Debug
DebugMonitor.begin(115200);
// I/O setup
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, HIGH);
pinMode(FRONT_LIGHT, OUTPUT); digitalWrite(FRONT_LIGHT, LOW);
pinMode(REAR_LIGHT, OUTPUT); digitalWrite(REAR_LIGHT, LOW);
pinMode(ODRIVE_FAN, OUTPUT); digitalWrite(ODRIVE_FAN, LOW);
// Neopixel
objNeoPixel_L.begin();
objNeoPixel_R.begin();
// TFMini Plus
TFMiniPlus.begin(115200); // HW Serial for TFmini
delay (200); // Give a little time for things to start
// Set TFMini Plus to Standard Output mode
TFMiniPlus.write(0x42);
TFMiniPlus.write(0x57);
TFMiniPlus.write(0x02);
TFMiniPlus.write(0x00);
TFMiniPlus.write(0x00);
TFMiniPlus.write(0x00);
TFMiniPlus.write(0x01);
TFMiniPlus.write(0x06);
delay(1000);
colorWipe(ORANGE, 10, objNeoPixel_L);
colorWipe(ORANGE, 10, objNeoPixel_R);
allocator = rcl_get_default_allocator();
// create init_options
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
// create node
RCCHECK(rclc_node_init_default(&node, "uros_platformio_node", "", &support));
// create service addTwoInts
// RCCHECK(rclc_service_init_default(&service_addTwoInts, &node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, AddTwoInts), "/addtwoints"));
// create service FrontLights
RCCHECK(rclc_service_init_default(&service_FrontLights, &node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, SetBool), "/frontlights"));
// create service RearLights
RCCHECK(rclc_service_init_default(&service_RearLights, &node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, SetBool), "/rearlights"));
// create service OdriveFans
RCCHECK(rclc_service_init_default(&service_OdriveFans, &node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, SetBool), "/odrivefans"));
// create service NeoPixel
RCCHECK(rclc_service_init_default(&service_NeoPixel, &node, ROSIDL_GET_SRV_TYPE_SUPPORT(teensy_interfaces, srv, NeoPixelControl), "/neopixel"));
// create msg_pub publisher
RCCHECK(rclc_publisher_init_default(&publisher, &node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32), "micro_ros_platformio_node_publisher"));
// create msg_pub_range publisher
// RCCHECK(rclc_publisher_init_default(&publisher_range, &node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32), "micro_ros_platformio_node_publisher_range"));
RCCHECK(rclc_publisher_init_default(&publisher_range, &node, ROSIDL_GET_MSG_TYPE_SUPPORT(sesnsor_msgs, msg, Range), "micro_ros_platformio_node_publisher_range"));
// create subscriber
RCCHECK(rclc_subscription_init_default(&subscriber, &node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32), "micro_ros_platformio_node_subscriber"));
// create timer,
const unsigned int timer_timeout = 1000;
RCCHECK(rclc_timer_init_default(&timer, &support, RCL_MS_TO_NS(timer_timeout), timer_callback));
// create executor
RCCHECK(rclc_executor_init(&executor, &support.context, num_handles, &allocator));
// RCCHECK(rclc_executor_add_service(&executor, &service_addTwoInts, &req, &res, service_addTwoInts_callback));
RCCHECK(rclc_executor_add_service(&executor, &service_FrontLights, &req_FrontLights, &res_FrontLights, service_FrontLights_callback));
RCCHECK(rclc_executor_add_service(&executor, &service_RearLights, &req_RearLights, &res_RearLights, service_RearLights_callback));
RCCHECK(rclc_executor_add_service(&executor, &service_OdriveFans, &req_OdriveFans, &res_OdriveFans, service_OdriveFans_callback));
RCCHECK(rclc_executor_add_service(&executor, &service_NeoPixel, &req_NeoPixel, &res_NeoPixel, service_NeoPixel_callback));
RCCHECK(rclc_executor_add_subscription(&executor, &subscriber, &msg_sub, &subscription_callback, ON_NEW_DATA));
RCCHECK(rclc_executor_add_timer(&executor, &timer));
msg_pub.data = 0;
} // end setup
// ============================================================================
// MAIN LOOP
// ============================================================================
void loop() {
// variable declarations
uint32_t t = millis();
if (bFirstScan) {
bFirstScan = false;
debugln("First Scan");
}
// ------------------------------------------------------
// Service Routine[0]: DEBUG
#if SR00_DEBUG_EN == 1
if ((t-tTime[0]) >= (1000 / DEBUG_PULSE))
{
debugln(msg_pub.data);
tTime[0] = t;
}
#endif
#if SR01_TFMINI_EN == 1
if ((t-tTime[1]) >= (1000 / TFM_PULSE))
{
readTFMiniPlus();
debug("Distance: "); debugln(TFMiniVal);
debug("Strength: "); debugln(TFMiniStrength);
debugln("--------------------");
tTime[1] = t;
}
#endif
// EXECUTOR HANDLE SPIN
if ((t-tTime[10]) >= (1000 / SPIN_PULSE))
{
RCSOFTCHECK(rclc_executor_spin_some(&executor, RCL_MS_TO_NS(100)));
tTime[10] = t;
}
}
// --------------------------------------------------------
// FUNCTIONS
// --------------------------------------------------------
// colorWipe
void colorWipe(int color, int wait, WS2812Serial refObject) {
for (int i=0; i < refObject.numPixels(); i++) {
refObject.setPixel(i, color);
refObject.show();
delayMicroseconds(wait);
}
}
// ----------------------------------------------------------------------------
void readTFMiniPlus(){
// Data Format for Benewake TFmini
// ===============================
// 9 bytes total per message:
// 1) 0x59
// 2) 0x59
// 3) Dist_L (low 8bit)
// 4) Dist_H (high 8bit)
// 5) Strength_L (low 8bit)
// 6) Strength_H (high 8bit)
// 7) Reserved bytes
// 8) Original signal quality degree
// 9) Checksum parity bit (low 8bit), Checksum = Byte1 + Byte2 +…+Byte8. This is only a low 8bit though
while(TFMiniPlus.available()>=9) // When at least 9 bytes of data available (expected number of bytes for 1 signal), then read
{
// debugln("Check2");
if((0x59 == TFMiniPlus.read()) && (0x59 == TFMiniPlus.read())) // byte 1 and byte 2
{
unsigned int t1 = TFMiniPlus.read(); // byte 3 = Dist_L
unsigned int t2 = TFMiniPlus.read(); // byte 4 = Dist_H
t2 <<= 8;
t2 += t1;
TFMiniVal = t2*10;
t1 = TFMiniPlus.read(); // byte 5 = Strength_L
t2 = TFMiniPlus.read(); // byte 6 = Strength_H
t2 <<= 8;
t2 += t1;
TFMiniStrength = t2;
for(int i=0; i<3; i++)TFMiniPlus.read(); // byte 7, 8, 9 are ignored
}
}
}
First of all I want to thank you guys to support PlatformIO, we really appreciate it!
Previously we were working in PlatformIO with micro_ros_arduino. I ported the project to this new repo and everything compiles fine except that Intellisense in VS Code is not recognizing #include <micro_ros_platformio.h>
anymore, so syntax highlight in micro-ROS is not working.
PlatformIO correctly adds micro_ros_platformio
in c_cpp_properties.json
, I also tried to rebuild Intellisense index with no luck. Any help is welcome. Thanks!
/ci
folderpio lib install
pio run
pio run --target upload
Intellisense should work, #include <micro_ros_platformio.h>
is found and code highlight works
Intellisense is not working, #include <micro_ros_platformio.h>
not found.
Error: #include errors detected. Please update your includePath. Squiggles are disabled for this translation unit
Step 1: Copy the contents of the micro_ros_publisher example.
Step 2: platform.ini
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
board_microros_distro = galactic
board_microros_transport = serial
board_microros_user_meta = colcon.meta
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio.git
Step3: pio lib install
Step4: pio run
Build the packages
Build fails with the following output:
--- stderr: rmw_implementation
CMake Error at /home/scch1092/example/.pio/libdeps/teensy41/micro_ros_platformio/build/mcu/install/share/rmw_implementation_cmake/cmake/get_default_rmw_implementation.cmake:60 (message):
Could not find ROS middleware implementation 'rmw_fastrtps_cpp'. Choose
one of the following: rmw_microxrcedds
Call Stack (most recent call first):
CMakeLists.txt:22 (get_default_rmw_implementation)
---
Failed <<< rmw_implementation [0.44s, exited with code 1]
$ env | grep ROS
ROS_VERSION=2
ROS_PYTHON_VERSION=3
ROS_LOCALHOST_ONLY=0
ROS_DISTRO=galactic
$ env | grep RMW
RMW_IMPLEMENTATION=rmw_fastrtps_cpp
env | grep AMENT_PREFIX_PATH
AMENT_PREFIX_PATH=/home/scch1092/ros2_ws/install/micro_ros_agent:/home/scch1092/ros2_ws/install/micro_ros_msgs:/opt/ros/galactic
Having trouble building the micro-ros
Downloading micro-ROS dev dependencies
ament_cmake clone failed:
fatal: Too many arguments.
usage: git clone [<options>] [--] <repo> [<dir>]
-v, --verbose be more verbose
-q, --quiet be more quiet
--progress force progress reporting
--reject-shallow don't clone shallow repository
-n, --no-checkout don't create a checkout
--bare create a bare repository
--mirror create a mirror repository (implies bare)
-l, --local to clone from a local repository
--no-hardlinks don't use local hardlinks, always copy
-s, --shared setup as shared repository
--recurse-submodules[=<pathspec>]
initialize submodules in the clone
--recursive ... alias of --recurse-submodules
-j, --jobs <n> number of submodules cloned in parallel
--template <template-directory>
directory from which templates will be used
--reference <repo> reference repository
--reference-if-able <repo>
reference repository
--dissociate use --reference only while cloning
-o, --origin <name> use <name> instead of 'origin' to track upstream
-b, --branch <branch>
checkout <branch> instead of the remote's HEAD
-u, --upload-pack <path>
path to git-upload-pack on the remote
--depth <depth> create a shallow clone of that depth
--shallow-since <time>
create a shallow clone since a specific time
--shallow-exclude <revision>
deepen history of shallow clone, excluding rev
--single-branch clone only one branch, HEAD or --branch
--no-tags don't clone any tags, and make later fetches not to follow them
--shallow-submodules any cloned submodules will be shallow
--separate-git-dir <gitdir>
separate git dir from working tree
-c, --config <key=value>
set config inside the new repository
--server-option <server-specific>
option to transmit
-4, --ipv4 use IPv4 addresses only
-6, --ipv6 use IPv6 addresses only
--filter <args> object filtering
--also-filter-submodules
apply partial clone filters to submodules
--remote-submodules any cloned submodules will use their remote-tracking branch
--sparse initialize sparse-checkout file to include only files at root
========================================================================================== [FAILED] Took 4.28 seconds ==========================================================================================
config file
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
board_microros_distro = humble
board_microros_transport = serial
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio
Click on the build button in VS code
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
It's not clear to me what the differences are between this project and micro_ros_arduino and when I would use one versus the other. I think adding a note highlighting the differences would help others looking at the two projects.
For example
[env:seeed_xiao]
platform = atmelsam
board = seeed_xiao
framework = arduino
lib_deps =
https://github.com/micro-ROS/micro_ros_arduino#v2.0.5-humble
build_flags =
-L ./.pio/libdeps/seeed_xiao/micro_ros_arduino/src/cortex-m0plus/
-l microros
-D micro_ros_xiao.json
works fine in platformIO. When and why would I use this project instead?
Hello,
Recently I tried to use multiple publishers controlled by multiple timers, but it appears that using more than 4 timers causes an error and the program ends up in an error loop. I would also like to mention that according to Teensy 4.0 documentation (https://www.pjrc.com/store/teensy40.htmla), it has 4 Interval Timers. Is there any way to use more than 4 micro-ros timers in my setup?
cocon.meta:
"cmake-args": [
"-DRMW_UXRCE_MAX_NODES=2",
"-DRMW_UXRCE_MAX_PUBLISHERS=6",
"-DRMW_UXRCE_MAX_SUBSCRIPTIONS=6",
"-DRMW_UXRCE_MAX_SERVICES=1",
"-DRMW_UXRCE_MAX_CLIENTS=1",
"-DRMW_UXRCE_MAX_HISTORY=2",
"-DRMW_UXRCE_TRANSPORT=custom"
]
´´´
I was trying to rebuild the library after changing some settings. Running:
pio run
again did not rebuild the library so I tried to clean build artifacts first by running:
pio run -t clean
This also didn't work because the build artifacts of micro-ROS library are not recognized as project's build artifacts by PlatformIO.
I then tried the cleanall
target:
pio run -t cleanall
which should completely remove the cloned library and its artifacts. It worked but I noticed it takes a really long time to finish, almost 10 minutes in my case.
I found out that running:
rm -rf .pio/libdeps
works but it doesn't feel "proper" for me.
Issue compiling in Visual Studio Code with PlatformIO.
Created blank project, added the config in platfomio.ini and copied the example, then followed the instructions below on how to set everything up.
(Initially I tried doing all this in Window$ until I realized it won't work. So I switched into Ubuntu 22.04, which has ROS2 already installed.
Here is the error trace. It first downloaded heaps of packages and then it suddenly failed.
administrator@dev01:~/Documents/gitclones/AutoBot_uros$ pio run
Processing teensy41 (platform: teensy; board: teensy41; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy41.html
PLATFORM: Teensy (4.17.0) > Teensy 4.1
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 7.75MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
- framework-arduinoteensy @ 1.157.220801 (1.57)
- tool-teensy @ 1.157.0 (1.57)
- toolchain-gccarmnoneeabi @ 1.50401.190816 (5.4.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Installing pyyaml with pip at PlatformIO environment
/usr/bin/python3 -m pip install pyyaml
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (5.4.1)
Installing markupsafe==2.0.1 with pip at PlatformIO environment
/usr/bin/python3 -m pip install markupsafe==2.0.1
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: markupsafe==2.0.1 in /usr/lib/python3/dist-packages (2.0.1)
Configuring teensy41 with transport serial
Downloading micro-ROS dev dependencies
- Downloaded ament_cmake
- Downloaded ament_lint
- Downloaded ament_package
- Downloaded googletest
- Downloaded ament_cmake_ros
- Downloaded ament_index
Building micro-ROS dev dependencies
Downloading micro-ROS library
- Downloaded microcdr
- Downloaded microxrcedds_client
- Downloaded rcl_action
- Downloaded rcl
- Downloaded rcl_lifecycle
- Downloaded rcl_yaml_param_parser (ignored)
- Downloaded rclc
- Downloaded rclc_parameter
- Downloaded rclc_examples (ignored)
- Downloaded rclc_lifecycle
- Downloaded micro_ros_utilities
- Downloaded rcutils
- Downloaded micro_ros_msgs
- Downloaded rmw_microxrcedds
- Downloaded rosidl_typesupport_cpp (ignored)
- Downloaded rosidl_typesupport_c
- Downloaded rosidl_typesupport_microxrcedds_cpp (ignored)
- Downloaded rosidl_typesupport_microxrcedds_test_msg
- Downloaded rosidl_typesupport_microxrcedds_c_tests
- Downloaded rosidl_typesupport_microxrcedds_cpp_tests
- Downloaded rosidl_typesupport_microxrcedds_c
- Downloaded rosidl_runtime_c
- Downloaded rosidl_generator_cpp (ignored)
- Downloaded rosidl_typesupport_introspection_c
- Downloaded rosidl_typesupport_introspection_tests
- Downloaded rosidl_typesupport_introspection_cpp (ignored)
- Downloaded rosidl_parser
- Downloaded rosidl_cmake
- Downloaded rosidl_runtime_cpp (ignored)
- Downloaded rosidl_generator_c
- Downloaded rosidl_adapter
- Downloaded rosidl_typesupport_interface
- Downloaded rosidl_cli
- Downloaded rmw
- Downloaded rmw_implementation_cmake
- Downloaded builtin_interfaces
- Downloaded rcl_interfaces
- Downloaded test_msgs
- Downloaded statistics_msgs
- Downloaded composition_interfaces
- Downloaded lifecycle_msgs
- Downloaded rosgraph_msgs
- Downloaded action_msgs
- Downloaded rosidl_default_generators
- Downloaded rosidl_default_runtime
- Downloaded unique_identifier_msgs
- Downloaded visualization_msgs
- Downloaded stereo_msgs
- Downloaded actionlib_msgs
- Downloaded nav_msgs
- Downloaded diagnostic_msgs
- Downloaded sensor_msgs_py
- Downloaded trajectory_msgs
- Downloaded geometry_msgs
- Downloaded std_srvs
- Downloaded std_msgs
- Downloaded sensor_msgs
- Downloaded common_interfaces
- Downloaded shape_msgs
- Downloaded test_interface_files
- Downloaded rmw_implementation
- Downloaded test_rmw_implementation
- Downloaded rcl_logging_interface
- Downloaded rcl_logging_noop
- Downloaded rcl_logging_spdlog (ignored)
- Downloaded tracetools
- Downloaded tracetools_test
- Downloaded test_tracetools_launch
- Downloaded test_tracetools
- Downloaded tracetools_launch
- Downloaded ros2trace
- Downloaded tracetools_read
- Downloaded tracetools_trace
- Extra packages folder not found, skipping...
Building micro-ROS library
AssertionError: :
File "/usr/local/lib/python3.10/dist-packages/platformio/builder/main.py", line 188:
env.SConscript("$BUILD_SCRIPT")
File "/home/administrator/.platformio/packages/tool-scons/scons-local-4.4.0/SCons/Script/SConscript.py", line 597:
return _SConscript(self.fs, *files, **subst_kw)
File "/home/administrator/.platformio/packages/tool-scons/scons-local-4.4.0/SCons/Script/SConscript.py", line 285:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/home/administrator/.platformio/platforms/teensy/builder/main.py", line 162:
target_elf = env.BuildProgram()
File "/home/administrator/.platformio/packages/tool-scons/scons-local-4.4.0/SCons/Util.py", line 737:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/platformio/builder/tools/piobuild.py", line 61:
env.ProcessProjectDeps()
File "/home/administrator/.platformio/packages/tool-scons/scons-local-4.4.0/SCons/Util.py", line 737:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/platformio/builder/tools/piobuild.py", line 137:
plb = env.ConfigureProjectLibBuilder()
File "/home/administrator/.platformio/packages/tool-scons/scons-local-4.4.0/SCons/Util.py", line 737:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/platformio/builder/tools/piolib.py", line 1176:
project.install_dependencies()
File "/usr/local/lib/python3.10/dist-packages/platformio/builder/tools/piolib.py", line 965:
if _is_builtin(spec):
File "/usr/local/lib/python3.10/dist-packages/platformio/builder/tools/piolib.py", line 957:
for lb in self.env.GetLibBuilders():
File "/home/administrator/.platformio/packages/tool-scons/scons-local-4.4.0/SCons/Util.py", line 737:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/platformio/builder/tools/piolib.py", line 1089:
lb = LibBuilderFactory.new(env, lib_dir)
File "/usr/local/lib/python3.10/dist-packages/platformio/builder/tools/piolib.py", line 60:
obj = globals()[clsname](env, path, verbose=verbose)
File "/usr/local/lib/python3.10/dist-packages/platformio/builder/tools/piolib.py", line 154:
self.process_extra_options()
File "/usr/local/lib/python3.10/dist-packages/platformio/builder/tools/piolib.py", line 302:
self.env.SConscript(
File "/home/administrator/.platformio/packages/tool-scons/scons-local-4.4.0/SCons/Script/SConscript.py", line 597:
return _SConscript(self.fs, *files, **subst_kw)
File "/home/administrator/.platformio/packages/tool-scons/scons-local-4.4.0/SCons/Script/SConscript.py", line 285:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/home/administrator/Documents/gitclones/AutoBot_uros/.pio/libdeps/teensy41/micro_ros_platformio@src-0343cbc825a368aff84aef9d951ed072/extra_script.py", line 64:
global_env.AddCustomTarget("clean_microros", None, clean_microros_callback, title="Clean Micro-ROS", description="Clean Micro-ROS build environment")
File "/home/administrator/.platformio/packages/tool-scons/scons-local-4.4.0/SCons/Util.py", line 737:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/platformio/builder/tools/piotarget.py", line 87:
return env.AddTarget(group="Custom", *args, **kwargs)
File "/home/administrator/.platformio/packages/tool-scons/scons-local-4.4.0/SCons/Util.py", line 737:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/platformio/builder/tools/piotarget.py", line 72:
assert name not in env["__PIO_TARGETS"]`
I would like to add tf2 package to the build.
I have updated extra_packages.repo as such :
repositories:
tf2:
type: git
url: https://github.com/ros2/geometry2
version: galactic
I cleaned the build and made a pio run
Build OK
The compilation failed complaining about hpp (geom_msg) files not found in the code of tf2. Indeed they are present with the .h extension but not the hpp extension.
Trying to patch tf2 to replace hpp by h include failed also (complain about the namespace usage of tf2).
It seams that idl is producing c file and not cpp files, any clue ? or something I miss ?
Thanks in advance !
Several compilation errors when compiling for the [env:esp32dev_wifi] environment.
How do I resolve these?
$ git clone [email protected]:safdark/micro_ros_platformio_ci.git
./ci
(This is a copy of the ci/ folder from the original repository, with only the esp32dev_wifi environment present in the platformio.ini file, for simplicity)
$ cd ci
$ pio lib install
Library Storage: /home/safdar/code/repositories/myproject_firmware/entrypoints/ci/.pio/libdeps/esp32dev_wifi
Library Manager: Installing git+https://github.com/micro-ROS/micro_ros_platformio
git version 2.25.1
Cloning into '/home/safdar/.platformio/.cache/tmp/pkg-installing-fvshhh20'...
remote: Enumerating objects: 64, done.
remote: Counting objects: 100% (64/64), done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 64 (delta 10), reused 42 (delta 5), pack-reused 0
Unpacking objects: 100% (64/64), 123.23 KiB | 882.00 KiB/s, done.
Library Manager: micro_ros_platformio @ 0.0.1+sha.c20916a has been installed!
Should compile succesfully since I haven't changed anything in the original ci/ folder.
Output:
$ pio run
Processing esp32dev_wifi (platform: espressif32; board: esp32dev; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.5.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 3.10006.210326 (1.0.6)
- tool-esptoolpy 1.30100.210531 (3.1.0)
- toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Installing pyyaml with pip at PlatformIO environment
/home/safdar/.platformio/penv/bin/python -m pip install pyyaml
Requirement already satisfied: pyyaml in /home/safdar/.platformio/penv/lib/python3.8/site-packages (6.0)
WARNING: You are using pip version 21.3.1; however, version 22.0.4 is available.
You should consider upgrading via the '/home/safdar/.platformio/penv/bin/python -m pip install --upgrade pip' command.
Installing markupsafe==2.0.1 with pip at PlatformIO environment
/home/safdar/.platformio/penv/bin/python -m pip install markupsafe==2.0.1
Requirement already satisfied: markupsafe==2.0.1 in /home/safdar/.platformio/penv/lib/python3.8/site-packages (2.0.1)
WARNING: You are using pip version 21.3.1; however, version 22.0.4 is available.
You should consider upgrading via the '/home/safdar/.platformio/penv/bin/python -m pip install --upgrade pip' command.
Configuring esp32dev with transport wifi
Downloading micro-ROS dev dependencies
- Downloaded ament_cmake
- Downloaded ament_lint
- Downloaded ament_package
- Downloaded googletest
- Downloaded ament_cmake_ros
- Downloaded ament_index
Building micro-ROS dev dependencies
Downloading micro-ROS library
- Downloaded microcdr
- Downloaded microxrcedds_client
- Downloaded rcl_yaml_param_parser (ignored)
- Downloaded rcl_lifecycle
- Downloaded rcl_action
- Downloaded rcl
- Downloaded rclc
- Downloaded rclc_examples (ignored)
- Downloaded rclc_parameter
- Downloaded rclc_lifecycle
- Downloaded micro_ros_utilities
- Downloaded rcutils
- Downloaded micro_ros_msgs
- Downloaded rmw_microxrcedds
- Downloaded rosidl_typesupport_c
- Downloaded rosidl_typesupport_cpp (ignored)
- Downloaded rosidl_typesupport_microxrcedds_c
- Downloaded rosidl_typesupport_microxrcedds_cpp (ignored)
- Downloaded rosidl_typesupport_microxrcedds_cpp_tests
- Downloaded rosidl_typesupport_microxrcedds_test_msg
- Downloaded rosidl_typesupport_microxrcedds_c_tests
- Downloaded rosidl_typesupport_introspection_c
- Downloaded rosidl_generator_c
- Downloaded rosidl_runtime_cpp (ignored)
- Downloaded rosidl_cmake
- Downloaded rosidl_runtime_c
- Downloaded rosidl_parser
- Downloaded rosidl_typesupport_introspection_cpp (ignored)
- Downloaded rosidl_adapter
- Downloaded rosidl_cli
- Downloaded rosidl_typesupport_interface
- Downloaded rosidl_generator_cpp (ignored)
- Downloaded rmw
- Downloaded rmw_implementation_cmake
- Downloaded statistics_msgs
- Downloaded composition_interfaces
- Downloaded rcl_interfaces
- Downloaded rosgraph_msgs
- Downloaded action_msgs
- Downloaded builtin_interfaces
- Downloaded test_msgs
- Downloaded lifecycle_msgs
- Downloaded rosidl_default_generators
- Downloaded rosidl_default_runtime
- Downloaded unique_identifier_msgs
- Downloaded actionlib_msgs
- Downloaded stereo_msgs
- Downloaded diagnostic_msgs
- Downloaded sensor_msgs
- Downloaded std_msgs
- Downloaded visualization_msgs
- Downloaded shape_msgs
- Downloaded sensor_msgs_py
- Downloaded std_srvs
- Downloaded trajectory_msgs
- Downloaded nav_msgs
- Downloaded common_interfaces
- Downloaded geometry_msgs
- Downloaded test_interface_files
- Downloaded test_rmw_implementation
- Downloaded rmw_implementation
- Downloaded rcl_logging_spdlog (ignored)
- Downloaded rcl_logging_interface
- Downloaded rcl_logging_log4cxx (ignored)
- Downloaded rcl_logging_noop
- Downloaded tracetools_read
- Downloaded tracetools
- Downloaded tracetools_trace
- Downloaded tracetools_test
- Downloaded tracetools_launch
- Downloaded ros2trace
Checking extra packages
- Downloaded control_msgs
- Adding my_custom_message
Building micro-ROS library
Build mcu micro-ROS environment failed:
...
...
... <<<<<< Several CMake Warning messages >>>>>>
...
...
CMake Error at /opt/ros/galactic/share/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_c-extras.cmake:5 (find_package):
Could not find a configuration file for package "fastcdr" that is
compatible with requested version "".
The following configuration files were considered but not accepted:
/opt/ros/galactic/lib/cmake/fastcdr/fastcdr-config.cmake, version: 1.0.20 (64bit)
/usr/local/lib/cmake/fastcdr/fastcdr-config.cmake, version: 1.0.23 (64bit)
Call Stack (most recent call first):
/opt/ros/galactic/share/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_cConfig.cmake:41 (include)
/home/safdar/code/repositories/myproject_firmware/entrypoints/ci/.pio/libdeps/esp32dev_wifi/micro_ros_platformio/build/mcu/install/share/rosidl_typesupport_c/cmake/rosidl_typesupport_c-extras.cmake:13 (find_package)
/home/safdar/code/repositories/myproject_firmware/entrypoints/ci/.pio/libdeps/esp32dev_wifi/micro_ros_platformio/build/mcu/install/share/rosidl_typesupport_c/cmake/rosidl_typesupport_cConfig.cmake:41 (include)
/home/safdar/code/repositories/myproject_firmware/entrypoints/ci/.pio/libdeps/esp32dev_wifi/micro_ros_platformio/build/mcu/install/share/rosidl_default_generators/cmake/rosidl_default_generators-extras.cmake:21 (find_package)
/home/safdar/code/repositories/myproject_firmware/entrypoints/ci/.pio/libdeps/esp32dev_wifi/micro_ros_platformio/build/mcu/install/share/rosidl_default_generators/cmake/rosidl_default_generatorsConfig.cmake:41 (include)
CMakeLists.txt:14 (find_package)
---
Failed <<< lifecycle_msgs [0.61s, exited with code 1]
============================================================================================================================== [FAILED] Took 59.21 seconds ==============================================================================================================================
$ colcon version-check
colcon-argcomplete 0.3.3: up-to-date
colcon-bash 0.4.2: up-to-date
colcon-cd 0.1.1: up-to-date
colcon-cmake 0.2.26: up-to-date
colcon-core 0.7.1: newer version available (0.8.2)
colcon-defaults 0.2.6: up-to-date
colcon-devtools 0.2.3: up-to-date
colcon-library-path 0.2.1: up-to-date
colcon-metadata 0.2.5: up-to-date
colcon-notification 0.2.13: up-to-date
colcon-output 0.2.12: up-to-date
colcon-package-information 0.3.3: up-to-date
colcon-package-selection 0.2.10: up-to-date
colcon-parallel-executor 0.2.4: up-to-date
colcon-pkg-config 0.1.0: up-to-date
colcon-powershell 0.3.7: up-to-date
colcon-python-setup-py 0.2.7: up-to-date
colcon-recursive-crawl 0.2.1: up-to-date
colcon-ros 0.3.22: newer version available (0.3.23)
colcon-test-result 0.3.8: up-to-date
colcon-zsh 0.4.0: up-to-date
Environment:
$ env | grep ROS
ROS_VERSION=2
ROS_PYTHON_VERSION=3
ROS_LOCALHOST_ONLY=0
ROS_DISTRO=galactic
PIO version:
$ pio --version
PlatformIO Core, version 5.2.5
What are the supported message types for this library?
micro_ros_arduino arduino provides a list of precompiled ROS 2 types but I cannot find something similar here.
I thought it might be the same between the two packages but I am getting the following error when trying to create a subscriber
Using teensy 4.1 with platformio in VSCode on Ubuntu 22.04
I have followed the tutorial:
https://micro.ros.org/docs/tutorials/core/teensy_with_arduino/
Now I'm trying to expand this for the "micro-ros_addtwoints_servcie".
However I'm having issue understanding how to port this over. I do understand this example comes from the pure "arduino" microROS side and there are a few differences. But what I lack is the understanding how this could be ported over.
Currently it already hangs at the point where I
#include <example_interfaces/srv/add_two_ints.h>
Please help me understand how I can port this over.
Once I have a working example I will update the github repo, and add this add_two_ints so others can also benefit.
Thanks
Question to the Documentation
I need to configure the client transport protocol for an arduino client. In meta files I found configuration variables, but I do not find a list of possible values for the variables.
Can someone give advice how to set variables for serial transport?
https://github.com/rosmo-robot/linorobot2_hardware#1-motor-check
Software compiles without error
Linking to ticket I opened on Linorobot to avoid duplicaton: linorobot/linorobot2_hardware#19
Hi, i want to use 12 publishers/topics on the Portenta H7,
I tried changing: ./Projects/project_name/.pio/libdeps/portenta_h7_m7/micro_ros_platformio/libmicroros/include/rmw_microxrcedds_c/config.h
#define RMW_UXRCE_MAX_PUBLISHERS 10, changed to 12
but the topic i use for testing just stops working when the elevenths publisher is instantiated.
is there another variable? I dont think the portenta really minds having more than 10 topics...
I am trying to connect my esp32 over wifi with the micro ros agent. It runs in a docker container. My machine is a Ubuntu 22.04.
My code is working with serial transport, i tried also with the example code form adruino and platform io adapted for wifi, nothing woked.
But here my code for the wifi:
IPAddress agent_ip(192, 168, 1, 100);
size_t agent_port = 8888;
char ssid[] = "ssid";
char psk[] = "pswd";
set_microros_wifi_transports(ssid, psk, agent_ip, agent_port);
My platform.ini:
[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
board_microros_transport = wifi
monitor_filters =
direct
esp32_exception_decoder
lib_deps =
waspinator/AccelStepper@^1.61
https://github.com/micro-ROS/micro_ros_platformio
Micro ros agent in docker (it runs):
docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:humble udp4 --port 8888 -v6
working (connecting to agent) :)
No output on docker. I tried with serial print the program runs and I cloud print all the wifi credentials
Esp is in wifi range and i tried some time before with esp idf and it worked also.
Thanks for help and super cool project thanks for making it possible!
Thank you for supporting platformio! I have problems to use the parameter-feature on galactic and with micro_ros_platformio. Therefore I reproduced the issue with this example.
The command rclc_parameter_server_init_default
fails like the resources are not configured well. Did someone stumble across the same problem?
#include <micro_ros_platformio.h>
#include <rcl/rcl.h>
#include <rcl/error_handling.h>
#include <rclc/rclc.h>
#include <rclc/executor.h>
#include <rclc_parameter/rclc_parameter.h>
#include <std_msgs/msg/int32.h>
#include <stdio.h>
#include <unistd.h>
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){Log.printf("Failed status on line %d: %d. Aborting.\n",__LINE__,(int)temp_rc); return 1;}}
#define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){Log.printf("Failed status on line %d: %d. Continuing.\n",__LINE__,(int)temp_rc);}}
#define Log Serial2
rcl_publisher_t publisher;
rclc_parameter_server_t param_server;
rcl_timer_t timer;
bool publish = true;
std_msgs__msg__Int32 msg;
void timer_callback(rcl_timer_t * timer, int64_t last_call_time)
{
(void) last_call_time;
(void) timer;
if (publish)
{
RCSOFTCHECK(rcl_publish(&publisher, &msg, NULL));
Log.printf("Sent: %d\n", msg.data);
msg.data++;
}
}
void on_parameter_changed(Parameter * param)
{
if (strcmp(param->name.data, "publish_toogle") == 0 && param->value.type == RCLC_PARAMETER_BOOL)
{
publish = param->value.bool_value;
Log.printf("Publish %s\n", (publish) ? "ON" : "OFF");
}
else if (strcmp(param->name.data, "publish_rate_ms") == 0 && param->value.type == RCLC_PARAMETER_INT)
{
int64_t old;
RCSOFTCHECK(rcl_timer_exchange_period(&timer, RCL_MS_TO_NS(param->value.integer_value), &old));
Log.printf("Publish rate %ld ms\n", param->value.integer_value);
}
}
int main()
{
Log.begin(9600);
Serial.begin(115200);
set_microros_serial_transports(Serial);
rcl_allocator_t allocator = rcl_get_default_allocator();
rclc_support_t support;
// create init_options
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
// create node
rcl_node_t node;
RCCHECK(rclc_node_init_default(&node, "micro_ros_node", "", &support));
// create publisher
RCCHECK(rclc_publisher_init_default(
&publisher,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32),
"micro_ros_pub"));
// Create parameter service
RCCHECK(rclc_parameter_server_init_default(¶m_server, &node));
// create timer,
RCCHECK(rclc_timer_init_default(
&timer,
&support,
RCL_MS_TO_NS(1000),
timer_callback));
// create executor
rclc_executor_t executor = rclc_executor_get_zero_initialized_executor();
RCCHECK(rclc_executor_init(&executor, &support.context, RCLC_PARAMETER_EXECUTOR_HANDLES_NUMBER + 1, &allocator));
RCCHECK(rclc_executor_add_parameter_server(&executor, ¶m_server, on_parameter_changed));
RCCHECK(rclc_executor_add_timer(&executor, &timer));
// Add parameters
RCCHECK(rclc_add_parameter(¶m_server, "publish_toogle", RCLC_PARAMETER_BOOL));
RCCHECK(rclc_add_parameter(¶m_server, "publish_rate_ms", RCLC_PARAMETER_INT));
//rclc_parameter_set_bool(¶m_server, "publish_toogle", true);
//rclc_parameter_set_int(¶m_server, "publish_rate_ms", 1000);
Log.println("before spin");
RCCHECK(rclc_executor_spin(&executor));
Log.println("after spin");
RCCHECK(rcl_publisher_fini(&publisher, &node));
RCCHECK(rcl_node_fini(&node));
}
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
upload_protocol = teensy-cli
board_microros_transport = serial
board_microros_distro = galactic
board_microros_user_meta = project_colcon.meta
lib_deps = https://github.com/micro-ROS/micro_ros_platformio
{
"names": {
"rmw_microxrcedds": {
"cmake-args": [
"-DRMW_UXRCE_MAX_NODES=1",
"-DRMW_UXRCE_MAX_PUBLISHERS=20",
"-DRMW_UXRCE_MAX_SUBSCRIPTIONS=20",
"-DRMW_UXRCE_MAX_SERVICES=10",
"-DRMW_UXRCE_MAX_CLIENTS=1",
"-DRMW_UXRCE_MAX_HISTORY=2",
"-DRMW_UXRCE_TRANSPORT=custom"
]
}
}
}
Executer spins, counter is published and parameters are available by calling ros2 param list
.
Output: Failed status on line 84: 1. Aborting.
which is:
// Create parameter service
RCCHECK(rclc_parameter_server_init_default(¶m_server, &node));
When extra_packages.yaml
contains incorrect url
or version
and cloning the package does not succeed, the builder will still say that it downloaded the package and continue building the library.
Hardware description: ESP32, Debian10 running in VirtualBox
Version or commit hash: 87baf5e
Steps to reproduce the issue
clone 4ef4b18
open examples/ESP32 project with Platformio
try building
OR
Create new ESP32 platformio project
Add lines below to platformio.ini
microros_transport = serial
microros_distro = galactic
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio
Try building
Expected behavior
code compiles with microros library
Actual behavior
Could not paste actual log, VirtualBox misbehaving
Hello, I am trying to use the two ESP32 cores to do separate task, where core 1 handles robot controls and core 0 handles MicroROS.
I made a test script to see if this is feasible, where core 0 runs a task that contains rclc_executor_spin() that has a timer that publishes to a counter topic and core1 runs a dummy serial print task.
#include <Arduino.h>
#include <micro_ros_platformio.h>
#include <stdio.h>
#include <rcl/rcl.h>
#include <rcl/error_handling.h>
#include <rclc/rclc.h>
#include <rclc/executor.h>
#include <std_msgs/msg/int32.h>
#include <geometry_msgs/msg/vector3.h>
#if !defined(ESP32) && !defined(TARGET_PORTENTA_H7_M7) && !defined(ARDUINO_NANO_RP2040_CONNECT)
#error This example is only avaible for Arduino Portenta, Arduino Nano RP2040 Connect and ESP32 Dev module
#endif
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}}
#define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}}
rcl_publisher_t publisher;
std_msgs__msg__Int32 msg;
const char * publisher_topic_name = "/counter_test1";
rclc_executor_t executor;
rclc_support_t support;
rcl_allocator_t allocator;
rcl_node_t node;
rcl_timer_t timer;
/* End of MicroROS variables */
IPAddress agent_ip(192, 168, 1, 130);
size_t agent_port = 8888;
char ssid[] = "WIFI";
char psk[]= "PASS";
// Error handle loop
void error_loop() {
while(1) {
}
}
void rclc_executor_task(void *parameter)
{
RCSOFTCHECK(rclc_executor_spin(&executor));
}
void dummy_task(void *parameter)
{
Serial.println("Hello world");
}
void timer_callback(rcl_timer_t * timer, int64_t last_call_time)
{
RCLC_UNUSED(last_call_time);
if (timer != NULL)
{
// display the data
msg.data++;
RCSOFTCHECK(rcl_publish(&publisher, &msg, NULL));
Serial.println("Publishing and incrementing counter msg!!");
}
}
void setup() {
// serial to display data
Serial.begin(115200);
Serial.println("Begin simple test");
Serial.println(xPortGetCoreID());
/* MicroROS stuff */
set_microros_wifi_transports(ssid, psk, agent_ip, agent_port);
delay(1000);
allocator = rcl_get_default_allocator();
//create init_options
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
// create node
RCCHECK(rclc_node_init_default(&node, "micro_ros_platformio_wifi_node", "", &support));
// create best effort publishers
RCCHECK(rclc_publisher_init_best_effort(
&publisher,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32),
publisher_topic_name));
// create a msg timer that is triggered every 1000ms
RCCHECK(rclc_timer_init_default(
&timer,
&support,
RCL_MS_TO_NS(1000),
timer_callback));
// create executor
RCCHECK(rclc_executor_init(&executor, &support.context, 1, &allocator));
RCCHECK(rclc_executor_add_timer(&executor, &timer));
msg.data = 0;
Serial.println("Done set up");
xTaskCreatePinnedToCore( // Use xTaskCreate() in vanilla FreeRTOS
dummy_task, // Function to be called
"Test", // Name of task
1048, // Stack size (bytes in ESP32, words in FreeRTOS)
NULL, // Parameter to pass
1, // Task priority (must be same to prevent lockup)
NULL, // Task handle
1); // Run on one core for demo purposes (ESP32 only)
xTaskCreatePinnedToCore( // Use xTaskCreate() in vanilla FreeRTOS
rclc_executor_task, // Function to be called
"Test2", // Name of task
1048, // Stack size (bytes in ESP32, words in FreeRTOS)
NULL, // Parameter to pass
2, // Task priority (must be same to prevent lockup)
NULL, // Task handle
0); // Run on one core for demo purposes (ESP32 only)
}
void loop() {
// Run the executor
// RCSOFTCHECK(rclc_executor_spin(&executor));
}
Able to see ROS2 counter topic and debug output from serial port.
ESP32 crash and kept on restarting itself.
Guru Meditation Error: Core 0 panic'ed (IllegalInstruction). Exception was unhandled, below is a screenshot of the ouput
Thanks!
Just wondering if the microROS platformIO version supports over the air upload like this one: https://randomnerdtutorials.com/esp32-over-the-air-ota-programming/#:~:text=Upload%20a%20new%20sketch%20over%2Dthe%2Dair%20to%20the%20ESP32,code%20should%20be%20successfully%20uploaded.
or anyway to upload the microROS to multiple ESP32 at once?
I'm currently trying to implement support of Ethernet for the ESP32 with microROS, however, the ESP-IDF API looks really complicated, so I tried to use https://github.com/espressif/arduino-esp32/tree/master/libraries/Ethernet in conjunction with this project.
However, it isn't working as expected:
E (1014) esp.emac: emac_esp32_init(349): reset timeout
E (1015) esp_eth: esp_eth_driver_install(214): init mac failed
[ 1018][E][ETH.cpp:323] begin(): esp_eth_driver_install failed
[ 4079][E][WiFiUdp.cpp:183] endPacket(): could not send data: 118
Do you have any tips or ideas on how to implement Ethernet support for the ESP32 into microROS?
I'm am trying to compile the example but i am getting an error while building. I installed all packages.
Thanks for help and the great project :)
in src/main.cpp is the example code. I initialized the project with Platform IO
Versions
git version 2.34.1
cmake version 3.22.1
Python 3.10.6
platformio.ini
[env:uno]
platform = atmelavr
board = uno
framework = arduino
board_microros_transport = serial
lib_deps =
waspinator/AccelStepper@^1.61
https://github.com/micro-ROS/micro_ros_platformio
Compiling :)
Error:
Building micro-ROS library
Build mcu micro-ROS environment failed:
--- stderr: microcdr
CMake Warning:
Manually-specified variables were not used by the project:
BUILD_TESTING
THIRDPARTY
CMake Warning (dev) at /usr/share/cmake-3.22/Modules/GNUInstallDirs.cmake:239 (message):
Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
target architecture is known. Please enable at least one language before
including GNUInstallDirs.
Call Stack (most recent call first):
CMakeLists.txt:84 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
avr-gcc: error: device-specs/specs-OARD_MCU: No such file or directory
avr-gcc: error: device-specs/specs-OARD_MCU: No such file or directory
gmake[5]: *** [CMakeFiles/microcdr.dir/build.make:76: CMakeFiles/microcdr.dir/src/c/common.c.obj] Error 1
gmake[5]: *** Waiting for unfinished jobs....
gmake[5]: *** [CMakeFiles/microcdr.dir/build.make:90: CMakeFiles/microcdr.dir/src/c/types/basic.c.obj] Error 1
avr-gcc: error: device-specs/specs-OARD_MCU: No such file or directory
avr-gcc: error: device-specs/specs-OARD_MCU: No such file or directory
gmake[5]: *** [CMakeFiles/microcdr.dir/build.make:118: CMakeFiles/microcdr.dir/src/c/types/array.c.obj] Error 1
gmake[5]: *** [CMakeFiles/microcdr.dir/build.make:104: CMakeFiles/microcdr.dir/src/c/types/string.c.obj] Error 1
avr-gcc: error: device-specs/specs-OARD_MCU: No such file or directory
gmake[5]: *** [CMakeFiles/microcdr.dir/build.make:132: CMakeFiles/microcdr.dir/src/c/types/sequence.c.obj] Error 1
gmake[4]: *** [CMakeFiles/Makefile2:83: CMakeFiles/microcdr.dir/all] Error 2
gmake[3]: *** [Makefile:136: all] Error 2
gmake[2]: *** [CMakeFiles/ucdr.dir/build.make:86: ucdr-prefix/src/ucdr-stamp/ucdr-build] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/ucdr.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
---
Failed <<< microcdr [1.56s, exited with code 2]
Start:
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR (4.0.0) > Arduino Uno
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 31.50KB Flash
DEBUG: Current (avr-stub) On-board (avr-stub, simavr)
PACKAGES:
- framework-arduino-avr @ 5.1.0
- toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Installing pyyaml with pip at PlatformIO environment
/usr/bin/python3 -m pip install pyyaml
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pyyaml in /home/neb/.local/lib/python3.10/site-packages (6.0)
Installing markupsafe==2.0.1 with pip at PlatformIO environment
/usr/bin/python3 -m pip install markupsafe==2.0.1
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: markupsafe==2.0.1 in /home/neb/.local/lib/python3.10/site-packages (2.0.1)
Configuring uno with transport serial
My code ran before, but I've changed my platformIO environment (same installation methods...)
void setup() {
// ----------- Configure serial transport
Serial.begin(115200);
// set_microros_serial_transports(Serial);
//****** For Main WiFi....
IPAddress agent_ip(---, ---, -, --);
size_t agent_port = 8888;
char ssid[] = "------------";
char psk[]= "--------------";
set_microros_wifi_transports(ssid, psk, agent_ip, agent_port);
//multiarray initialization
msg2.data.capacity = 10;
msg2.data.data = (float*)infoBuffer;
msg2.data.size = 10;
SPI2.begin(H_CLK, H_MISO, H_MOSI, H_CS);
// cli();
delay(500);
SetupSD();
delay(100);
Wire.begin(4, 15);
// Wire.begin();
delay(100);
Wire.setClock(400000); //fast mode
delay(100);
delay(2000);
Serial.println("Initialized...");
//create Mutex/Semaphores
// GPSMutex = xSemaphoreCreateMutex();
// IMUMutex = xSemaphoreCreateMutex();
// LORAMutex = xSemaphoreCreateMutex();
// xTaskCreatePinnedToCore(update_latitude_and_longitude, "update_latitude_and_longitude", 8912, NULL, 1, &Task1, 1);
// delay(100); //important delay
// xTaskCreatePinnedToCore(update_IMU_data, "update_IMU_data", 8912, NULL, 1, &Task2, 1);
// delay(100); //important delay
//=========================ROS2 stuff setup..............===================
Serial.println("ROS2 Allocator...");
allocator = rcl_get_default_allocator();
Serial.println("ROS2 Allocated...");
//create init_options
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator)); <------------STUCK HERE********
Serial.println("ROS2 Node Creating...");
// create node
RCCHECK(rclc_node_init_default(&node, "micro_ros_platformio_node", "", &support));
Serial.println("ROS2 Node Created...");
// // create publisher2
RCCHECK(rclc_publisher_init_best_effort(
&publisher,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Float32MultiArray),
"micro_ros_my_custom_publisher"));
// create timer,
const unsigned int timer_timeout = 1000; //this is the speed on which it is published, set to 1 for extra speed
RCCHECK(rclc_timer_init_default(
&timer,
&support,
RCL_MS_TO_NS(timer_timeout),
timer_callback));
// create executor
RCCHECK(rclc_executor_init(&executor, &support.context, 1, &allocator));
RCCHECK(rclc_executor_add_timer(&executor, &timer));
msg.data = 0;
}
Executes properly in the Setup()
Got executes up to the line RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
then stops there...
I am trying to install the micro_ros_platformio library but colcon build fails.
Platformio version: 6.1.4
Visual Studio Code version: 1.7.1.0
OS: Windows 10
platfomrio.ini :
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:dueUSB]
platform = atmelsam
board = dueUSB
framework = arduino
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio
jandrassy/EthernetENC@^2.0.2
monitor_speed = 115200
Building the project results in the following output:
Processing dueUSB (platform: atmelsam; board: dueUSB; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/dueUSB.html
PLATFORM: Atmel SAM (8.1.0) > Arduino Due (USB Native Port)
HARDWARE: AT91SAM3X8E 84MHz, 96KB RAM, 512KB Flash
DEBUG: Current (atmel-ice) External (atmel-ice, blackmagic, jlink, stlink)
PACKAGES:
- framework-arduino-sam @ 1.6.12
- framework-cmsis @ 1.40500.0 (4.5.0)
- framework-cmsis-atmel @ 1.2.2
- 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
C:\Users\spiro\.platformio\penv\Scripts\python.exe -m pip install pyyaml
Requirement already satisfied: pyyaml in c:\users\spiro\.platformio\penv\lib\site-packages (6.0)
[notice] A new release of pip available: 22.1.2 -> 22.2.2
[notice] To update, run: python.exe -m pip install --upgrade pip
Installing markupsafe==2.0.1 with pip at PlatformIO environment
C:\Users\spiro\.platformio\penv\Scripts\python.exe -m pip install markupsafe==2.0.1
Requirement already satisfied: markupsafe==2.0.1 in c:\users\spiro\.platformio\penv\lib\site-packages (2.0.1)
[notice] A new release of pip available: 22.1.2 -> 22.2.2
[notice] To update, run: python.exe -m pip install --upgrade pip
Configuring dueUSB with transport serial
Downloading micro-ROS dev dependencies
- Downloaded ament_cmake
- Downloaded ament_lint
- Downloaded ament_package
- Downloaded googletest
- Downloaded ament_cmake_ros
- Downloaded ament_index
Building micro-ROS dev dependencies
Build dev micro-ROS environment failed:
--- stderr: gtest_vendor
Traceback (most recent call last):
File "C:\Users\spiro\.platformio\penv\lib\site-packages\colcon_core\executor\__init__.py", line 91, in __call__
rc = await self.task(*args, **kwargs)
File "C:\Users\spiro\.platformio\penv\lib\site-packages\colcon_core\task\__init__.py", line 93, in __call__
return await task_method(*args, **kwargs)
File "C:\Users\spiro\.platformio\penv\lib\site-packages\colcon_ros\task\cmake\build.py", line 35, in build
rc = await extension.build(
File "C:\Users\spiro\.platformio\penv\lib\site-packages\colcon_cmake\task\cmake\build.py", line 87, in build
rc = await self._reconfigure(args, env)
File "C:\Users\spiro\.platformio\penv\lib\site-packages\colcon_cmake\task\cmake\build.py", line 153, in _reconfigure
raise RuntimeError(
RuntimeError: VisualStudioVersion is not set, please run within a Visual Studio Command Prompt.
---
Failed <<< gtest_vendor [0.89s, exited with code 1]
VisualStudioVersion is not set, please run within a Visual Studio Command Prompt.
I have tried the exact same process in Ubuntu 20 and didn't get any errors.
Step 1: Upgrade system to the latest PIO version:
> pio upgrade
Step 2: Copy the contents of the micro_ros_publisher example.
Step 3: Other tool versions:
Step 4: With the following platformio.ini (mostly unchanged from the example, except for the addition of platform/board properties):
[env]
monitor_speed = 115200
upload_speed = 921600
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
board_microros_transport = serial
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio
Run:
> pio run --target clean_microros
> pio lib install
> pio run
pio run
should build the packages successfully.
Build fails with the following output:
Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (4.3.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 3.20003.0 (2.0.3)
- tool-esptoolpy @ 1.30300.0 (3.3.0)
- toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Installing pyyaml with pip at PlatformIO environment
/home/safdar/.platformio/penv/bin/python -m pip install pyyaml
Requirement already satisfied: pyyaml in /home/safdar/.platformio/penv/lib/python3.8/site-packages (6.0)
Installing markupsafe==2.0.1 with pip at PlatformIO environment
/home/safdar/.platformio/penv/bin/python -m pip install markupsafe==2.0.1
Requirement already satisfied: markupsafe==2.0.1 in /home/safdar/.platformio/penv/lib/python3.8/site-packages (2.0.1)
Configuring esp32dev with transport wifi
Downloading micro-ROS dev dependencies
- Downloaded ament_cmake
- Downloaded ament_lint
- Downloaded ament_package
- Downloaded googletest
- Downloaded ament_cmake_ros
- Downloaded ament_index
Building micro-ROS dev dependencies
Build dev micro-ROS environment failed:
--- stderr: gtest_vendor
CMake Warning:
Manually-specified variables were not used by the project:
BUILD_TESTING
---
--- stderr: gmock_vendor
CMake Warning:
Manually-specified variables were not used by the project:
BUILD_TESTING
---
--- stderr: ament_lint
Traceback (most recent call last):
File "setup.py", line 6, in <module>
setup(
File "/home/safdar/.platformio/penv/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/home/safdar/anaconda3/envs/ros2/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/safdar/anaconda3/envs/ros2/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/safdar/anaconda3/envs/ros2/lib/python3.8/distutils/dist.py", line 984, in run_command
cmd_obj.ensure_finalized()
File "/home/safdar/anaconda3/envs/ros2/lib/python3.8/distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/home/safdar/.platformio/penv/lib/python3.8/site-packages/setuptools/command/develop.py", line 56, in finalize_options
easy_install.finalize_options(self)
File "/home/safdar/.platformio/penv/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 311, in finalize_options
self.set_undefined_options(
File "/home/safdar/anaconda3/envs/ros2/lib/python3.8/distutils/cmd.py", line 287, in set_undefined_options
src_cmd_obj.ensure_finalized()
File "/home/safdar/anaconda3/envs/ros2/lib/python3.8/distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/home/safdar/.platformio/penv/lib/python3.8/site-packages/setuptools/command/install_lib.py", line 17, in finalize_options
self.set_undefined_options('install',('install_layout','install_layout'))
File "/home/safdar/anaconda3/envs/ros2/lib/python3.8/distutils/cmd.py", line 290, in set_undefined_options
setattr(self, dst_option, getattr(src_cmd_obj, src_option))
File "/home/safdar/anaconda3/envs/ros2/lib/python3.8/distutils/cmd.py", line 103, in __getattr__
raise AttributeError(attr)
AttributeError: install_layout
---
Failed <<< ament_lint [1.50s, exited with code 1]
This could also return an error for a different ament package, like ament_cppcheck.
As far as I remember, the only change I made since a previous successful compilation is that I upgraded platformio to version 6.0. I can't think of any other system change that I've made, since the last time this successfully compiled.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.