กลับไปหน้ารวมไฟล์
arduino-line-follower-driven-by-ros1-561556-en.md

OVERVIEW:

This project aims to grasp the fundamentals of ROS1, understanding the workings of publishers and subscribers. Although the line follower isn't exceptionally fast, it serves as a practical example of utilizing rosserial on an Arduino board. To do this project, a foundational understanding of ROS is necessary, including concepts such as creating workspaces, packages, and scripts.

WORKING:

The Arduino gathers data from the IR sensors (e.g., 0000, 10000, etc.) and publishes it to the ROS node. The ROS node subscribes to this data and executes a script. Based on the received IR sensor data, the script issues commands to the line follower (e.g., forward, right, stop). The Arduino subscribes to these commands and changes the line follower's movements accordingly.

STEPS:

1] Create a Workspace.

2] Create a package inside the src folder of your workspace

3] Create a script folder inside src folder of your package

4] Copy paste the script which i attached (in code section) and save it

5] Then catkin_make your workspace

after doing these steps, follow the "line_follower_steps.txt" file attached in downloads section.

and you are done!!

PHOTOS:

WORKING VIDEO:

EXPANDED TECHNICAL DETAILS

Robot Operating System (ROS) Integration

This advanced line follower bridges the simple Arduino hardware with the powerful ROS1 (Robot Operating System) ecosystem for complex path planning.

  • rosserial Protocol: The Arduino acts as a ROS Hardware Node. It gathers data from a 5-channel Infrared (IR) sensor array and publishes it to the ROS master (typically running on a Raspberry Pi or PC) as a /sensor_data topic.
  • Distributed Computing: The high-level "Velocity" commands are calculated in ROS using a PID or path-following node and sent back to the Arduino via the /cmd_vel topic, which then drives the motors.

Educational Impact

  • Architecture Visualization: Students can use RViz to visualize the robot's sensor data and state in 3D in real-time, providing a professional industry-standard workflow for embedded robotics development.

ข้อมูล Frontmatter ดั้งเดิม

title: "Arduino line follower driven by ROS1"
description: "In this project, you'll discover the process of establishing serial communication between ROS and Arduino by implementing a simple publisher and listener setup."
author: "asbro10"
category: "Motors & Robotics"
tags:
  - "Cars"
  - "Communication"
views: 1327
likes: 2
price: 2450
difficulty: "Intermediate"
components:
  - "1x 44mm Wheel for N20 Motor"
  - "1x Arduino Nano"
  - "1x N20 motor Mounting bracket"
  - "1x MINI 3PI car N20 Caster Robot Ball Wheel"
  - "1x Digital Multimeter"
  - "1x 6v N20 motor 100rpm"
  - "1x Soldering kit"
  - "1x MX1508 motor driver"
  - "1x Cutting and Drilling Tools"
  - "2x 2.10\\tBatería lipo 3.7v-1000 mAh"
  - "1x TCRT5000L 5 Channel IR sensor"
tools: []
apps:
  - "1x Arduino IDE 1.8"
  - "1x ROS1 Noetic"
  - "1x ubuntu 20.04"
downloadableFiles:
  - "https://projects.arduinocontent.cc/66cb0273-4e1d-4fc1-bff1-c4e0b07aa6c3.py"
  - "https://projects.arduinocontent.cc/58d2c3a1-eb0e-400f-8502-7ac03f38e60c.ino"
documentationLinks: []
passwordHash: "ff319ee40c89b0855970bfcd3f68bd8677e64abae1b32e28563384f1b029fa6e"
encryptedPayload: "U2FsdGVkX18wv6mDWfhwMPvkPSP9kI1yPWoG0tZoYPfqSxplNDuwsuFswrDQSXn8FRrAFk08ig3SxxhsPscedXWy1IAWfVUeCzNxk8ysX6WRfOtctrnKjQsI3NeBp918bIqDJXjnldz56gQwBPmW0w=="
seoDescription: "Learn to set up Serial communication between ROS and Arduino using Publisher and Listener for an Arduino line follower robot."
videoLinks:
  - "https://youtu.be/8Ue1YoUdv98?si=P6_8AhlQj1R4UmP9"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/arduino-line-follower-driven-by-ros1-561556_cover.png"
lang: "en"