I cannot see the drivers in Device Manager, have been through all the forums and cannot figure out my problem. I have Python 2.7 but cannot upload to my APM. Have been working this for days now. When I upload thru Arduino, I get "expected constructor, destructor, or type conversion before '(' token" and have no idea of what that means?
Then down below, I get the folowing:
AP_OpticalFlow_test.cpp: In function 'void loop()': AP_OpticalFlow_test.pde:-1: error: 'flowSensor' was not declared in this scope
Can anyone please help, thanks............Don
Ok, Programming basics 101. The issue here is libraries are missing in your Arduino folder specific to Ardupilot. You got all those errors because in the main file, it calls functions in the other files in your arduino library folder and since they aren't there the compliler sees this and warns you.
The libraries needed for the code can be found here.
Also note, you must be using the relax patch version of Arduino here:
That said, if you didn't know how to use Arduino,read the directions and see that the libraries need to be there and using the relax patch version, stop. Follow the directions that say just download mission planner, use it to update the APM with the trusted code firmware which has th checkbox to use the optical flow sensor. Then if you want to try and compile other versions, fine, do that but read the directions which would have told you that.
NOTE: I may have guessed incorrectly you are using APM2 but APM1 directions are right there also.
Your first step is that you must load the driver to get a serial port for the APM, otherwise you will NEVER load the code. Even Arduino needs the serial port driver working.
Note: the optical sensor is not yet compatible with the APM2
Ignore this if you are in fact using APM1. My point is, get your APM working BEFORE adding sensors such as optical flow.
Thank you very much for responding, I am using APM, don't have APM2 yet. I have wiki AC2 in Mission Planner but cannot get Arduino to show up in my device manager, driver.
When you plug the APM board in for the first time to your PC and are running Windows 7, it should recognize the FTDI USB-to-serial chip and install the right drivers. But if it doesn't or if you're using an earlier version of Windows, you should download and install the appropriate driver for your Operating System from here. Once you've done so, reboot your PC and plug in the cable again.
Here is that link directly http://www.ftdichip.com/Drivers/CDM/CDM20814_Setup.exe
Again, follow the directions on that page to get the com port to show up.
Also, since you had Arduino, the same *.inf file is in the drivers folder in the arduino directory.
I have done all of this several times, maybe I should go thru where I am at right now:
Things that are working:
Have flown the Hex several times, works well, just trying to get it to recognize the Optical Flow Sensor
Mission planner cli, run opticalflow and it shows the X&Y and shows enabled, but when I move the sensor, the X&Y don't change.
In my Device Manager com port does not show Arduino
When I start Arduino, I can load the sketchfile, but I can never get it to compile or upload.
I think I have 2 problems, not sure I understand what the folder is suppose to be called, sketch, or sketchbook, or sketchfile or what or where it should be for sure. I have moved Arducopter and libraries to my Arduino folder, but that didn't help. If I go there it says it doesn't recognize because they are not a .ino or .pde file.
At this point I'm not sure what I should have where, but I do appreciate your help, thanks.....Don
I will try this again,http://www.ftdichip.com/Drivers/VCP.htm do I go directly from the USB port on the computer to the FTDI cable, or do I go from the USB on the computer to the small USB on the APM board. I think I have tried direct with the FTDI cable some time ago, but not sure if I did it right. Either way I think I have a driver problem and maybe the way I am trying to access my sketches, thanks..........Don
You have a number of problems going:
First, the APM1 uses a FTDI chip on the IMU shield so no matter what you need a FTDI driver.
APM2 uses a small Arduino chip to act like FTDI to connect the USB port to the 2560 mega chip.
The first rule of most Arduino chips is that they are serial port only! (1280, 2560, 328, 168) SO in order to talk to them, somewhere there is a serial to USB converter. FTDI is really a brand name but it's just a USB to serial converter. ONLY and I mean only a real Arduino Mega 2560 or the new APM2 uses the other method of a tiny Arduino chip onboard to act as a serial to USB converter and since it's not FTDI, it uses a different driver that is included with Windows 7, but not XP. APM1 uses the FTDI on the oilpan or you could have a FTDI cable plugged into where telemetry goes but let's not even go down that path.
So back to your problem! APM1 will not show up as "Arduino" in device manager ever because the computer only sees the FTDI chip as a serial port. This is where your problem is because either you're looking for the wrong thing in device manager or still didn't get the driver inf file associated with the plug-n-pray device detection. SO there is no confusion you should be plugging a mini usb cable into the BLUE OILPAN shield. When you do this with the device manager open, a new device will be detected and will only show up as a com port. IT will not be identifed as any form of Arduino.
Also, to help us troubleshoot, what OS is your computer running? (Win7, 64 or 32 bit, Win XP?)
Your code not compiling is a whole tutorial on Arduino-so I'm not even going to address it. The fact you didn't get the libraries into the correct folder is the first problem and then again, are you even using the relaxed patch version 22 I mentioned in the post. This is way to lengthy to discuss here. Arduino has great tutorials on how to get libraries loaded. Do some Googling on this a later subject, but fix your FTDI problem first since we know you are running APM1.
This really shouldn't be anywhere near this difficult.
Wow, thanks, there is a lot of information and answers a lot of my questions.
Yes I am connecting to the mini-usb on the blue oilpan shield. I am using the latest Windows 7, 64 bit. When I do plug in the USB connection, it does show up in device manager as a com port. In one of the forums I read that it was suppose to show up as a Arduino driver. At least now I know I don't have a driver problem. Jani said that the Optical Flo should load automatically and to make sure that I have activated Optical Flow flight mode. I assume he means to check the box in setup for that which I have. So, my only problem must be my libraries, would that be right, thanks for all your time in answering my e-mails.......Don
Well, again, going back to the tutorial page for the optical flow, it sounds like you are at a stage you want to actually check an image and in order for that step to work, you must fix the Arduino libraries, be able to compile the code, flash it to the APM in order to be able to capture an image from the sensor and most likely adjust the focus of the optical flow module.
FYI the Python and Py Serial are just used to process the image on your PC and have nothing to do with Arduino.
The big gotcha here where you are getting hung up is that you must follow the directions to compile APM code and that's not directly linked from that page.
But here is the LINK:
Hopefully that gets you fixed up.
Load the PDE on the APM
Capture the image
Adjust the focus as required (repeating capture the image until you get it right)
Use mission planner to reflash the APM back to flying code.
Fly to your hearts content.
And just as a heads up, I too have the optical flow sensor and haven't even tried to hook it up as I've been far too busy with work so this is just priming me up to try out the same thing. It's actually helping both of us to get the links and understanding in one thread.
I'm still at it, too many hours later, got Arduino working fine, loading the PDE on the APM is what I cannot figure out, I think I have tried everything, but must not. I can get the imagegrabber but it is blank, I have the right com port (5) in my case and of course I cannot capture the image. If you get yours working, I would like to know, thanks...........Don
Don, seriously, this worked the first time I followed the directions. I've given you the links but to recap:
Download the relaxpatch version of Arduino http://code.google.com/p/ardupilot-mega/downloads/detail?name=ardui...=
Dowload the arduplane zip http://code.google.com/p/ardupilot-mega/downloads/detail?name=ArduP...=
DO NOT LET ARDUINO AUTO UPDATE WHEN YOU START IT
Copy the files from the libraries folder in arduplane after you unzipped it and place them in the arduino22 relax patch libraries folder with all the other files.
You should have had Arduino closed during that process but if you didn't, and had it open, just restart it.
Now you should be able to open the PDE filehttp://code.google.com/p/ardupilot-mega/source/browse/libraries/AP_...
Now hit the "verify" button AKA play arrow in the upper left hand corner of Arduino IDE.
It should compile with no errors.
Again I just did this,following the directions I gave you the first time and it worked. It took me longer to download the files than to do this operation.
If you make it to this stage and it compiles, now you jsut need to flash it.
Step 1 =Choose the mega 2560 for board under the tools menu in Arduino
Step2= choose the serial port of the usb com port by number
Step3= click the upload button