Write OpenCV Script to Track Aruco pt 2


How to view my corners variable?
Now I am confused


I have responded to your email. You need to comment out where you assign ids = [129,72]

The reason is because the aruco.detectMarkers() function assigns the aruco IDs found to the ids variable, AND it matters what order the aruco markers are assigned in the ids array.

This is because the index of the corners array and ids array are matched. So if ids[0] is 129, the corners for that marker will be located at corners[0].

I made the modifications to the script you sent me (just comment out line 128) and the drone is able to land on aruco 72.


Hope this helps!


Comment out ids[] ,The result is the same, but as long as the camera determines that the arucomarker drone will land vertically, it cannot be accurately positioned


Are you sure? I commented out that ids[] line in the script you sent me and it started working fine on my end. I sent back the fixed file to your email in case you wanted to try that.

If it still isn’t working, try running the below command in the MAVProxy termianl (the one you start SITL simulated drone from)

param show RNGFND1_TYPE

If that doesn’t say 1, then that is your issue. Set it to 1 with param set RNGFND1_TYPE 1



please help,Flying around,It’s a little bit different from what I thought


Hmmm, Make sure the camera matrix data is correct. Problems like your video can be due to the wrong camera matrix being used in your script.

Type rostopic echo /camera/color/camera_info to see what your camera matrix is and compare it with your camera_matrix variable in your script.

If that doesn’t work, have you tried the huang_array.py script that I emailed you? That script was working perfect on my environment.