That is a really complicated project. I hope you can do it - it would be really cool. I looked into using a robot as a router for a short time and came to the conclusion it wouldn't work very well due to lack of precision and high software cost. The lack of precision might not be an issue for you in carving foam, but the software one probably will be. 6 axis cam programs are typically very expensive. I'm not sure how much robot specific ones are, but I'd expect they're similarly priced. Mastercam was about $15k for a 5 axis router version when I asked for a quote a while back just to get you in the ballpark. If you just want to do simple 2D and 3D stuff, that might be a bit easier if you can write your own interpreter. For simple cam programs you can go all the way from free up to several thousand dollars. I use Visual Mill which is $1k, but it has a lot of features. You can look at Vectric for simpler programs. For lots of other ones try doing a search for threads on cam programs here.