Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Md. Khairul AlamUmme Nur Mafiha Majid
Published © MIT

Human Following Robot

KR260 and ROS2 based AI Robot that can follow any human.

AdvancedFull instructions providedOver 1 day576
Human Following Robot

Things used in this project

Hardware components

Kria™ KR260 Robotics Starter Kit
AMD Kria™ KR260 Robotics Starter Kit
KR260 is the main part of my project and it is built for robotics and industrial applications, complete with high-performance interfaces and native ROS 2 support for ease of development by roboticists and software developers.
×1
Webcam, Logitech® HD Pro
Webcam, Logitech® HD Pro
To take the images of the surrounding object. Any other webcam should also work.
×1
Black Gladiator - Tracked Robot Chassis
DFRobot Black Gladiator - Tracked Robot Chassis
I used the Rover 5 Tank Chassis but other chassis will be okay. Link: https://www.dfrobot.com/product-390.html
×1
Arduino UNO
Arduino UNO
Arduino UNO is used for driving the motors. You can use any microcontroller board you are comfortable with.
×1
Romeo V2- an Arduino Robot Board (Arduino Leonardo) with Motor Driver
DFRobot Romeo V2- an Arduino Robot Board (Arduino Leonardo) with Motor Driver
This board has built-in motor driver and can be a good alternative of Arduino + motor driver board.
×1
Dual H-Bridge motor drivers L298
SparkFun Dual H-Bridge motor drivers L298
For driving 4 low-power gear motors. You may use any motor driver board of your choice.
×1
Mini Pan/Tilt Camera Platform
For vertically and horizontally moving the camera.
×1

Software apps and online services

Vivado Design Suite
AMD Vivado Design Suite
Vivado is the design software for AMD adaptive SoCs and FPGAs. It includes: Design Entry, Synthesis, Place and Route, Verification/Simulation tools.
Xilinx Software Development Kit
AMD Xilinx Software Development Kit
PYNQ Framework
AMD PYNQ Framework
For programming FPGA using Python without any FPGA hardware development knowledge.
Vitis Unified Software Platform
AMD Vitis Unified Software Platform
The AMD Vitis™ software platform is a development environment for developing designs that includes FPGA fabric, Arm® processor subsystems, and AI Engines. The Vitis tools work in conjunction with AMD Vivado™ ML Design Suite to provide a higher level of abstraction for design development.
Arduino IDE
Arduino IDE
Robot Operating System
ROS Robot Operating System
The Robot Operating System (ROS) is a set of software libraries and tools that help you build robot applications. From drivers to state-of-the-art algorithms, and with powerful developer tools, ROS has what you need for your next robotics project.
balenaEtcher
balenaEtcher
Burning Ubuntu in the SD card.
WinSCP FTP Client
For transferring files between the host PC and Kria 260 Robotics Starter Kit.

Hand tools and fabrication machines

Mastech MS8217 Autorange Digital Multimeter
Digilent Mastech MS8217 Autorange Digital Multimeter
Multitool, Screwdriver
Multitool, Screwdriver
Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires

Story

Read more

Schematics

Node flow

Program Flow

Hardware Connection

Power connections are not shown as those are very common and fixed.

Code

ROS2 Related command sets

Python
# Following command is for being superuser (you may need to enter password after the command)
sudo su

# follwing command is for activating pynq virtual environment
source /etc/profile.d/pynq_venv.sh

# making a directory for the project
mkdir person_follower

# creating ros2_ws directory inside person_follower
cd person_follower
mkdir ros2_ws
cd ros2_ws

# all source will be inside src folder
mkdir src

# back to ros2_ws using follwoing command
cd ../

# Fou building the project suing colcon build tool
colcon build

# Then source the ros2 (required every time opening a new terminal or edit the .bashrc file)
source /opt/ros/humble/setup.bash

# Then for creating a new ros package using python
ros2 pkg create robot_controller --build-type ament_python --dependencies rclpy

# new directory will be created inside src folder as robot_controller, we will 
# create ros node inside the robot_controller, go to robot_controller using follwing command 
cd src/robot_controller/robot_controller

# for creating a ros2 node (python file)
touch usbcam_publisher.py

# for making the python file executable 
chmod +x usbcam_publisher.py

# if any problem with write permission we can give write permission 
# for whole directory like src
sudo chmod -R 777 src

# after writing and modifying code we need to build it again from
# /home/ubuntu/person_follower/ros2_ws
# full location will be as follows
(pynq-venv) root@kria:/home/ubuntu/person_follower/ros2_ws# colcon build

# for affecting new functionality we need to source it again
source ./install/setup.bash

# for running a python node from the file location (src/robot_controller/robot_controller)
./usbcam_publisher.py

# for lunching the node
ros2 run robot_controller usbcam_publisher

GitHub Link

Credits

Md. Khairul Alam

Md. Khairul Alam

68 projects • 587 followers
Developer, Maker & Hardware Hacker. Currently working as a faculty at the University of Asia Pacific, Dhaka, Bangladesh.
Umme Nur Mafiha Majid

Umme Nur Mafiha Majid

2 projects • 7 followers
I love technology

Comments