So this would be like a GPS where a marking would be home and the raspery determines position by visual reference and sends it to the APM like a GPS coorindinate?
The tracking itself will be done off board on our motion capture system (it's a
vicon system with 8 cameras, it can also be used for gait analysis and even movie stuff, although you might need more cameras for the latter). You have to put small reflective markers on your object (which look like small silver balls). The cameras placed all around the test area use a variety of filters to detect where the markers are and use some fancy math to combine the 2D position detected by each camera to get a 3D pose (you don't even have to tell it where you put the cameras, it calculates that by itself). According to the manual it's supposed to have sub-mm accuracy. I didn't test that specifically but it doesn't seem far off in any case - it's pretty amazing.
The pose (x, y, z position and roll, pitch, yaw) of the quad will be streamed over wifi (or maybe something else if wifi doesn't work). [The software that comes with the motion capture system is actually great for that, it's super simple to use: you put some markers on your object, they appear on the screen, you select them, give a name to the object and bam, it's being automatically streamed on your network.]
The raspberry pi will receive that info and convert it to the appropriate format (latitude, longitude, height and a couple more). Finally it'll send it to the APM like a GPS coordinate.
It's not something that everyone will need but in this case it'll def help me. There are no regulations for indoor flying so I won't have to worry about any of that stuff, and it's a lot closer to the lab than pretty much any other place.
The main issue with indoor flying though, is the lack of GPS reception and magnetic interference screwing up the compass. In general you want your experimental setups to match real conditions as much as possible... Since I'm looking at using UAVs in agriculture it's fair to assume GPS would be available in a typical scenario, so it'd suck not having access to that sensor while testing. This raspberry pi "GPS" is just a way to try to fix that issue, hopefully it works.
There are a couple of on-board vision based solutions that are supported by APM copter:
Pixy camera
PX4Flow optical flow sensor
But, well, getting them to work well and reliably does take quite a bit of effort (I spent 2 days this week banging my head against a desk trying to get that optical flow sensor to work properly haha - still don't know what's wrong with it), and even then they won't be as accurate as the motion capture system.