본문으로 건너뛰기
cccskills
무료GitHub에 공개

ros2-microros

micro-ROS: agent, rclc client API, micro_ros_setup, custom transports, static memory.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md3.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

micro-ROS Instructions (Ubuntu 24.04 LTS & ROS 2 Jazzy)

Experimental; not validated on MCU hardware. An MCU and a micro-ROS agent connection were unavailable for this release. Treat these source pointers and examples as a starting point to verify against your board, transport and Jazzy versions, not as proof that a firmware configuration works.

1. Architecture

micro-ROS connects constrained MCUs to the ROS 2 DDS graph via micro_ros_agent and rclc over Micro XRCE-DDS. RMW_UXRCE_ALLOW_DYNAMIC_ALLOCATIONS=OFF prevents dynamic growth of the RMW's static pools; it does not guarantee zero heap allocation throughout the firmware. See the Jazzy RMW configuration for the flag's scope.

2. Documentation Entry Points

ForEntry point
Tutorials, supported boards, transportshttps://micro.ros.org/
Firmware build system (micro_ros_setup)https://github.com/micro-ROS/micro_ros_setup
rclc executor / node API sourcehttps://github.com/ros2/rclc

3. Key Concepts & Patterns

A. Embedded Client Node Setup (rclc in C)

#include <rcl/rcl.h>
#include <rclc/rclc.h>
#include <rclc/executor.h>
#include <std_msgs/msg/int32.h>

int main(void) {
  rcl_allocator_t allocator = rcl_get_default_allocator();
  rclc_support_t support = {0};
  rcl_node_t node = {0};
  rcl_publisher_t pub = {0};

  rclc_support_init(&support, 0, NULL, &allocator);
  rclc_node_init_default(&node, "mcu_node", "", &support);
  rclc_publisher_init_default(&pub, &node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32), "chatter");

  // Clean up
  rcl_publisher_fini(&pub, &node);
  rcl_node_fini(&node);
  rclc_support_fini(&support);
  return 0;
}

B. Micro-ROS Agent Execution

# Serial Transport (e.g. UART to USB)
ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyUSB0 -b 115200

# UDP Transport
ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888

4. Symptom -> Root Cause -> Action

SymptomLikely root causeAction
MCU node vanishes from graph after MCU reset, agent still runningXRCE session not re-created; firmware assumes a one-time initAdd a reconnect state machine: rmw_uros_ping_agent() periodically, re-init entities on failure
rclc_support_init returns error on the MCUTransport not reachable (wrong serial dev/baud, UDP port/IP)Run the agent with -v6 verbose and watch for session establishment; verify transport config in firmware
Publisher works but subscriber callback never firesExecutor never spun, or rclc_executor_init handle count smaller than the number of subscriptions/timersSpin the executor in the main loop; count every subscription+timer+service in num_handles
Hard fault / crash when publishing string or sequence messagesMessage memory not allocated — rclc doesn't auto-allocate unbounded fieldsAllocate with micro_ros_utilities_create_message_memory or assign static buffers before publishing
Large messages never arrivePayload exceeds XRCE-DDS stream/MTU buffer configured in the firmwareIncrease the transport MTU/stream buffer in the colcon.meta / transport config, or shrink the message
Best-effort topics flood then stall on serialSerial bandwidth saturated: publish rate x message size exceeds baud rateLower publish rate, raise baud rate, or switch to UDP transport

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Implement or change ROS 2 Jazzy packages, nodes, interfaces, launch files and configuration in a colcon workspace. Use for building and validating a development change, including tests that report success without running. For a live QoS, TF, IMU or odometry fault, use ros2-troubleshooting.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Leehyunbin0131/claude-ros2-skills202026년 9월 27일 업데이트

Diagnose ROS 2 Jazzy faults that reading the code cannot settle: QoS mismatch, sensor-mount and frame errors (REP 103/105), and odometry calibrated against CAD instead of the floor. Ships four runnable pass/fail checks.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Leehyunbin0131/claude-ros2-skills202026년 9월 27일 업데이트

Leehyunbin0131의 스킬 모두 보기

이 스킬의 문제 신고