I'm working through object tracking and keep encountering a couple of issues. I am experienced in several programming languages, Arduinos, and animatronics and have gotten this to work before using OpenCV and Processing, but now I have a nearly complete InMoov and feel it is important to learn MRL from the basics so I know how it all works.
But I'm having some trouble and there are a few too many moving pieces for me to get a complete picture of what is happening.
Basic set up is a simple Ubisoft SD camera on a 2-servo pan and tilt mech.
I'm running MRL 1.01.1165, the latest 32-bit Java 8.77. (I set this up on 3 different computers to troubleshoot).
When I configure manually, the servo sliders and camera work properly and in the correct directions. The X and Y pids have options in them as they should.
My Python scripts (both the very basic one from the tutorial and the more advanced one from the information link) are properly configured for servos, ports, etc. I have not altered PID settings in the script. The Arduino is running version 27 of the control IDE and magic number is happy. I am using the 3 default OPenCV filters from the script.
I then shut MRL down, terminate the extra java process and start again using the Python script that has been modified for ports and pins.
The Python script loads and runs and I get an initial response from the Pan &Tilt and camera. The camera tracks in the correct directions. I can get the camera to lock on an object that is very near the center of the camera image.
But then the camera drifts off into space and one of two things happen. Either I get a Limit out of range error and the Arduino stops communicating, or the camera just moves off of the object and becomes unresponsive. I do not see any relevent error messages in the log file.
I noticed that in the latest version of MRL, when I run the Python script for object tracking, there is only one PID (not PID2) and there are no options to adjust servo movement. This is different then when I set up PIDs manually. Also, when I un-comment the setPID lines in the Python script, I get a Python Traceback error, so I haven't changed those settings. Apparently there is something else I have to uncomment to alter the default 5.0,220.127.116.11 settings.
I have tried:
3 different computers. (There were some 64-bit Java issues) (Windows 10 and Windows 7)
4 different Arduino units (mega and R3 Uno)
Different servos (all digital)
3 different cameras
Different USB ports
Several Arduino pin-out combinations.
The InMoov Nervo board, a servo shield, a proto shield or direct pins to the servos.
By most accounts and my own experience, this should be a piece of cake, but I'm missing something obvious. I've put a really stupid amount of time into troubleshooting this and very much want to get it working so I can get back to my currently-motionless InMoov.