Skip to content

A ROS package for marker detection, tracking, and alignment using a robot's camera. The markers are placed on a circle around the robot. This package enables the robot to gather marker information, navigate to them, and visually highlight detected markers on the camera feed in two different cases: 1. Whole car rotating . 2. Only the camera rotating

Notifications You must be signed in to change notification settings

Vahidba72/Aruco-Marker-Tracker-Robot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 

Repository files navigation

Marker Tracker Project

A ROS package for marker detection, tracking, and alignment using a robot's camera. The markers are placed on a circle around the robot. This package enables the robot to gather marker information, navigate to them, and visually highlight detected markers on the camera feed. Two different codes are written. In the first python code camera_fix_controller.py the whole chassis of the car rotates and detects the markers which are placed around it. In the second code camera_rotating_controller.py only the link which ccarries the camera rotates and the car chassis stays still.


Table of Contents

  1. Features
  2. Dependencies
  3. Usage
  4. Topics
  5. Code Overview
  6. Author

Features

  • Identifies markers based on their unique IDs.
  • Tracks marker positions and aligns the robot's camera center with detected markers.
  • Draws a circle around detected markers in the camera feed and publishes the processed image.
  • Provides a mechanism for the robot to rotate and gather data on multiple markers.
  • Stops rotation and alignment once all markers are processed.

Dependencies

Ensure the following software and libraries are installed:

Required Software

  • Python 3.x
  • ROS Noetic

Python Libraries

  • numpy
  • scipy
  • opencv-python
  • imutils

Install Python dependencies:

pip install numpy scipy imutils opencv-python

Usage

  1. At first clone the following Aruco Ros Repository in your workspace:
git clone https://github.com/CarmineD8/aruco_ros
  1. clone the robot_urdf folder into your workspace
  2. form the aruco_ros folder in this repository substitute the .cpp file in src folder in the src folder of the aruco_ros repository you cloned before
  3. build your workspace:
catkin_make 
  1. Run the camera_fix_controller node:
roslaunch robot_urdf assignment1_2.launch
  1. Ensure the following topics are active and functioning:
  • /robot/camera1/image_raw/compressed
  • /robot/camera1/camera_info
  • /marker/id_number
  • /marker/center_loc
  1. The robot will rotate to gather marker information and align its camera with the markers one by one.
  2. for the case that you want only the camera link to rotate and the car stays fixed. run the following launch file:
roslaunch robot_urdf assignment1_3.launch

Topics

Published Topics

/output/image_raw/compressed

  • Message Type: sensor_msgs/CompressedImage
  • Description: Publishes the processed image with detected markers highlighted.

/cmd_vel

  • Message Type: geometry_msgs/Twist
  • Description: Publishes velocity commands to navigate the robot towards markers.

Subscribed Topics

/robot/camera1/image_raw/compressed

  • Message Type: sensor_msgs/CompressedImage
  • Description: Subscribes to the raw camera feed for marker detection.

/robot/camera1/camera_info

  • Message Type: sensor_msgs/CameraInfo
  • Description: Subscribes to the camera's resolution and focal properties.

/marker/id_number

  • Message Type: std_msgs/Int32
  • Description: Subscribes to the ID of the currently detected marker.

/marker/center_loc

  • Message Type: geometry_msgs/Point
  • Description: Subscribes to the center coordinates of the detected marker.

Code Overview

The camera_fix_controller class is the core of this package. Below are the key methods and their functions: Camera_callback(self, msg)

  • Extracts the camera's center coordinates from the CameraInfo message.

Id_callback(self, msg)

  • Updates the detected marker's ID (Id_number).

Center_callback(self, msg)

  • Tracks the detected marker's center coordinates and stores them in a dictionary.

Controller_callback(self, msg)

Implements:

  • Marker detection and alignment.
  • Rotational strategy to gather all marker information.
  • Drawing circles on the processed image for visual feedback.

main()

  • Initializes the ROS node and starts the camera_fix_controller.

About

A ROS package for marker detection, tracking, and alignment using a robot's camera. The markers are placed on a circle around the robot. This package enables the robot to gather marker information, navigate to them, and visually highlight detected markers on the camera feed in two different cases: 1. Whole car rotating . 2. Only the camera rotating

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published