Closed LucasR-GIT closed 1 year ago
micro-ROS is compatible with ROS 2, not with ROS 1 (ROS Noetic): https://micro.ros.org/
Hi @pablogs9 , I'm working with ESP32dev with the vs Code + Platformio , host computer : Ubuntu 22.04 + ros2 humble and I have the same error !
my platformio.ini code
[env:esp32dev]
platform = https://github.com/platformio/platform-espressif32.git
framework = arduino
board = esp32dev
monitor_speed = 115200
lib_deps =
WiFi
https://github.com/micro-ROS/micro_ros_arduino.git
build_flags =
-L ./.pio/libdeps/esp32dev/micro_ros_arduino/src/esp32/
-l microros
-D ESP32
platform_packages =
toolchain-xtensa32
platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git
my main.cpp code
#include <micro_ros_arduino.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>
rcl_publisher_t publisher;
std_msgs__msg__Int32 pub_msg;
// WiFi credentials
char ssid[] = "TP-LINK_E9E8";
char password[] = "2016****";
char agent_ip[] = "192.168.0.105";
uint agent_port = 8888;
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){while(1){Serial.println("Failed at setup"); delay(1000);};}}
#define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}}
void setup() {
Serial.begin(115200);
Serial.println("setup start");
set_microros_wifi_transports(ssid, password, agent_ip , agent_port);
// set_microros_transports();
delay(2000);
rcl_allocator_t allocator = rcl_get_default_allocator();
rclc_support_t support;
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
Serial.println("setup done");
}
void loop() {
}
Hello !
I'm working with ESP32 with the Arduino IDE and I'm trying to create a simple publisher on it. My goal is to send data on my ROS master (ROS Noetic) then retrieve it with a subscriber in Matlab connected to this master.
I tried to run the "micro-ros_publisher_wifi" example (slightly modified, exact code bellow) but the rclc_support_init() function systematically goes into the error_loop() function. I double checked the WiFi SSID / password and the ROS Master IP / Port parameters and everything seem correct to me. Any Idea ?
Code :
Serial monitor output :
Thank you in advance !