Aditya Nisal
Email : anisal@wpi.edu
Description
Objectives:
This project was aimed at finding the Circles in the block which is kept in the Gazebo environment.
​
Methodology:
For the robot and the block to spawn, the following lines were needed to run:
-
ros2 launch rrbot_gazebo rrbot_world.launch.py : This is a ros launch file. The executable python file - rrbot_world.launch.py contains the files and packages that this launch file makes run. This launch file when run, spawns a 2R joint robot, thus called R_R bot.
-
ros2 launch rrbot_description object_spawn.launch.py : Similar to above, this as well is a launch file. However, this executable python launch file - object_spawn.launch.py spawns a plate that contains our circles of a different color.
-
ros2 rviz 2 rviz2 : Rviz is a tool that is used to view the camera captures in a gazebo environment. Here it captures the simulation and shows the detected circles.
-
ros2 run image_view image_view -r image:=camera1/image_raw : This command runs the image view executable. This executable subscribes to a topic. Here, it subscribes to the remapped topic, camera1/output_image.
-
ros2 run opencv_test hough_circle: This node generates the circles present in the plate. As I had thresholded it as pink, it will show the circles in pink color. The final image is published to the /output_image topic.
-
ros2 run image_view image_view -r image:=output_image - Again using the image_view executable but this time remapping the topic to which it subscribes to output_image.
​
What happens in the code :
-
First, an image is received from the camera1/image_view topic.
-
A new image is created with a single channel.
-
Also, the RGB image is converted to HSV image.
-
Using the hough detection function, we get the circles to the original image in a different image which we then publish to the /output_image topic.
​
The output after detecting circles:
​
​
​
​
Detected Circles