This task involves detecting Aruco markers in two different cases:
- Real-world video detection: Using OpenCV to detect Aruco markers in a video recorded from a mobile camera.
- Simulation in Gazebo: Using TurtleBot3 to detect Aruco markers in a simulated Gazebo environment.
Ensure you have the following software installed:
- Python 3.x
- OpenCV
- ROS (Robot Operating System) with TurtleBot3 packages
- Gazebo
- Git
Clone the project repository:
git clone https://github.com/rishang19dx/Task_3A_Aruco_Marker_Detection.git
cd Task_3A_Aruco_Marker_Detection
-
Print Aruco Markers:
- Print the provided Aruco markers on an A4 sheet.
-
Record Video:
- Record a video of the printed Aruco markers using your mobile camera. Move the camera around to capture different angles and distances.
- Save the video as
aruco.mp4
in the project directory. - Add the path to the python script.
-
Install Required Packages:
-
Install the necessary ROS and Gazebo packages.
-
Clone the
gazebo_aruco_models
package from GitHub:git clone https://github.com/sacchinbhg/gazebo_aruco_models.git cd gazebo_aruco_models cp -r aruco_marker /path/to/your/catkin_ws/src/ cd /path/to/your/catkin_ws catkin_make source devel/setup.bash
-
-
Launch Gazebo with TurtleBot3 and Aruco Markers:
-
Open Gazebo simulation in empty world and add the aruco markers using the insert tab in the Gazebo GUI
-
We shall use waffle model because it has in-built camera in it.
export TURTLEBOT3_MODEL=waffle roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch
-
- Python Script:
- Navigate to the task directory.
- Run the provided Python script
aruco.py
to detect Aruco markers in the video
-
Launch TurtleBot3 in Gazebo:
-
Use the following command to launch the simulation:
export TURTLEBOT3_MODEL=waffle roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch
-
-
Spawn Aruco Markers:
- Use the Gazebo GUI and add markers to the environment.
-
Run Detection Node:
-
Run the detection node to detect Aruco markers using TurtleBot3's camera:
rosrun aruco_detection aruco_detection.py
-
-
View Camera Images :
-
View images from the TurtleBot3's camera topic
/camera/rgb/image_raw
usingimage_view
rosrun image_view image_view image:=/camera/rgb/image_raw
-
-
Real-World Video Detection:
- The script will display the video with detected Aruco markers highlighted.
-
Gazebo Simulation:
- The detection node will output the positions of the detected Aruco markers in the simulation and highlight the same in the simulation.