Microros client stops receiving data
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- cpp, embedded-iot
- Lĩnh vực
- embedded-iot, networking
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện thiết lập với ba thiết bị ESP32 bằng cách sử dụng set_microros_wifi_transports và các cổng UDP4 khác nhau. Kiểm tra thiết lập transport và vòng lặp rclc_executor_spin_some trong khi so sánh hành vi của một thiết bị với hành vi của ba thiết bị. Hoàn thành khi tất cả các thiết bị vẫn tiếp tục nhận dữ liệu mà chúng đã subscribe khi chạy đồng thời.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hey @pablogs9 ,
I am facing some sort of communication issue as follows....
Problem Description:
I am facing difficulties when attempting to run three ESP32 devices simultaneously, each connecting to a MicroROS agent and publishing twist data to three separate bots. Despite having a strong WiFi signal and utilizing the UDP4 protocol on different ports for each ESP32 device (port 8888 and others), we encounter a recurring problem. Initially, when each ESP32 device is started individually, communication runs smoothly. However, after a short period, all three ESP32 devices cease to receive data.
Key Details:
- WiFi Signal Strength: Strong
- Protocol: UDP4
- Port Configuration: Each ESP32 device uses a unique port for communication
Efforts Made:
- Ensured strong WiFi signal.
- Configured each ESP32 device to use a unique port for communication.
- Verified that communication functions correctly when bots are started individually.
Code on each ESP32(changing the node and topic names as well as ports accordingly):
#include <ESP32Servo.h>
#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 <geometry_msgs/msg/twist.h>
#include <std_msgs/msg/bool.h> // Include Bool message type
rcl_subscription_t subscriber_cmd_vel;
geometry_msgs__msg__Twist msg;
rcl_subscription_t subscriber_pen_down;
std_msgs__msg__Bool pen_msg;
rclc_executor_t executor;
rclc_support_t support;
rcl_allocator_t allocator;
rcl_node_t node;
rcl_timer_t timer;
Servo servo1;
Servo servo2;
Servo servo3;
Servo servo_pen;
#define servo1_pin 25
#define servo2_pin 26
#define servo3_pin 27
#define servo_pen_pin 19
#define LED_PIN LED_BUILTIN
#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)){}}
void error_loop(){
while(1){
digitalWrite(LED_PIN, !digitalRead(LED_PIN));
delay(100);
}
}
void cmd_vel_callback(const void * msgin)
{
const geometry_msgs__msg__Twist * msg = (const geometry_msgs__msg__Twist *)msgin;
// Your processing logic for Twist messages goes here
}
void pen_down_callback(const void * msgin)
{
const std_msgs__msg__Bool * pen_msg = (const std_msgs__msg__Bool *)msgin;
// Your processing logic for Bool messages goes here
}
void setup() {
set_microros_wifi_transports("wifi", "password", "192.168..", 8888);
// set_microros_tcp_transports("192.168.65.44", 8892);
Serial.begin(9600);
servo1.attach(servo1_pin);
servo2.attach(servo2_pin);
servo3.attach(servo3_pin);
servo_pen.attach(servo_pen_pin);
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, HIGH);
delay(2000);
allocator = rcl_get_default_allocator();
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
RCCHECK(rclc_node_init_default(&node, "subscriber_node_3", "", &support));
RCCHECK(rclc_subscription_init_default(
&subscriber_cmd_vel,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(geometry_msgs, msg, Twist),
"/cmd_vel/bot3"));
RCCHECK(rclc_subscription_init_default(
&subscriber_pen_down,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Bool),
"/pen3_down"));
RCCHECK(rclc_executor_init(&executor, &support.context, 2, &allocator));
RCCHECK(rclc_executor_add_subscription(&executor, &subscriber_cmd_vel, &msg, &cmd_vel_callback, ON_NEW_DATA));
RCCHECK(rclc_executor_add_subscription(&executor, &subscriber_pen_down, &pen_msg, &pen_down_callback, ON_NEW_DATA));
}
void loop() {
RCCHECK(rclc_executor_spin_some(&executor, RCL_MS_TO_NS(1)));
servo1.write(msg.linear.x + 90);
servo2.write(msg.linear.y + 90);
servo3.write(msg.linear.z + 90);
// Process msg_pen_down (bool) if needed
if (pen_msg.data) {
servo_pen.write(95);
} else {
servo_pen.write(90);
}
}
- Ngôn ngữ chính
- Shell
- Star
- 514
- Fork
- 184
- Merge trung bình
- 22 giờ 26 phút
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của micro-ROS/micro_ros_setup
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
micro-ROS/micro_ros_setup#837 · 1 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
micro-ROS/micro_ros_setup#814 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
micro-ROS/micro_ros_setup#809 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
micro-ROS/micro_ros_setup#808 · 2 bình luận ·
-
sensor msgs dependenciesĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
micro-ROS/micro_ros_setup#806 ·
Tất cả issue của micro-ROS/micro_ros_setup
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
adobe-fonts/source-serif#152 ·
-
area:ansible source:reader type:content-error
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
stephrobert/blog-roadmap#42 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
nolabs-ai/nono-packs#44 ·
Maintainer thường phản hồi trong vòng 1 ngày