This work is an example of software-in-the-loop (SIL), where trajectory planning is performed within a strawberry field using a visual memory. The process starts with a camera that compares a reference image with a desired image (the latter are stored in the visual memory).
First, ORB points are detected in both images, and then a point correspondence is established to gather information and compute the homography matrix. This matrix provides data on rotation and translation. Finally, this information is used to integrate it into the IBVS control, as presented in [1].
You need to install OpenCV first. You can install it with the following command:
sudo apt-get update
sudo apt-get install libopencv-devYou need to install the TurtleBot3 packages in order to use the TurtleBot in Gazebo:
You also need to install the ViSP library:
Additionally, install the ViSP ROS package:
-
Download the source code and place it inside a ROS workspace.
-
Compile the workspace by running:
catkin_make
-
Modify the image reference path:
- Open
homography_vision.cpp. - Change the path on line 154 to the full path where the
image_referencefolder is located.
- Open
-
Run the program with the following commands:
source devel/setup.bash export TURTLEBOT3_MODEL=turtlebot3_waffle1 roslaunch turtlebot3_gazebo turtlebot3_fresa.launch
If you want to visualize the point correspondences and the desired image transformation:
-
Open a new terminal in the same workspace directory.
-
Run the following command:
rqt_image_view
-
Look for the topic
/camera/rgb/vision_image_matchesin the list.
Note: The models used for the strawberry field environment were added to
turtlebot3_simulations/turtlebot3_gazebo/models.
This program was developed and tested in ROS 1 Noetic. 🚀
[1] Chaumette, F., & Hutchinson, S. (2006). Visual Servo Control, Part I: Basic Approaches. IEEE Robotics & Automation Magazine, 13(4), 82–90. Link
[2] Implementación De Control Visual Para Planificación De Trayectorias En Un Cultivo De Fresas Virtual. Jóvenes en la Ciencia. Universidad de Guanajuato. Link
[3] Visual Control Based Trajectory Design for a Mobile Robot in an Agricultural Environment. Master’s Thesis. Centro de Investigaciones en Óptica, A.C. (CIO), 2025. Link

