2nd week: First applications with Visual Circuit and a lot of troubles.
On the second week I have tried to do create my first robot application using Visual Circuit. Through the process I faced a lot of different issues. First of all, I tried to follow the Getting started tutorial, in which you need to make a drone follow a road using the ventral camera of the drone. To make this, I needed to install the Robotics Academy exercises to use it in native, as well as several dependencies like gazebo models that can be found in. Here I launched for the first time the follow_road.launch found at RoboticsAcademy/exercises/static/exercises/follow_road.
I thought that everything was working, as the gazebo world appeared to be working, also a RQT window showed up with both camera images and PX4 loading correctly. Here I tried some PX4 commands I knew, like:
px4> commander arm
px4> commander takeoff
But there was an automatic landing mode called RTL (Return To Launch), I try to search how to disable this mode but nothing worked. So I started searching for other errors that could make this happen.
Here I saw several problems: the RQT window popped-up with some plugins missing (comparing to the tutorial image) and the terminal showed some errors while loading the launcher.
One of the plugins missing showed a trace about “teleopWidget”, so I searched on internet and found nothing. The next step I took was to search in my whole repository using:
ls -R | grep teleopWidget
I found out that i had a file called “teleopWidget.py” at “drones/rqt_drone_teleop/src/rqt_vel_teleop”, so I found in a really old blog entry that i had to update the PYTHONPATH variable in my .bashrc to add these new paths:
export PYTHONPATH="${PYTHONPATH}:~/catkin_ws/src/drones/rqt_drone_teleop/src/rqt_vel_teleop:~/catkin_ws/src/drones/rqt_drone_teleop/src/rqt_cam_viewer:~/catkin_ws/src/drones/rqt_drone_teleop/src/rqt_pos_teleop"
With this done, I launched the follow_road file again, but i found an error of “qfi module missing”. Here I got really lost, because I couldn’t find any kind of information about that package, until somehow I found a repository inside JdeRobot github where this module had some info and installing instructions.
After all the errors around packages missing, I could finally launch the follow_road and see the RQT window with all the plugins.
Now that everything seemed to work, I started working on the Visual Circuit part. For this project I used 6 different blocks: CameraROS, Color Filter, Code, Screen (for debug), PID and MotorDriver.
In the code block, I made a contour detection to get the biggest contour and see the x coordinate of its center, to get the error from the center of the image.
Also I found out about a bug in the MotorDriver block, where it receives a string but tries to read an image, so I fixed it and made a merge-request on the Visual Circuit github. So there is my actual first contribution to the actual project. ^.^
I built and downloaded the project and test it with the simulator. The color and the contours worked fine, but i needed to find the topic where I had to post the final MotorDriver message for the drone to move. But after a lot of research, looking the active topics, the messages they used and the ones they where sending, the services that I could call, etc, I couldnt find the one. So here is where the week ends. :C