I want to shake your hand and give you a pat on the back for writing this- organizing these thoughts and getting a proposal for how to do things on paper is exactly what we need. THANK YOU!
Here are some of my thoughts to start the discussion:
1. To clarify, I don't think the Arduino should necessarily be responsible for more things (in fact, I think it's code should be quite basic), but I think people should be able to add code for what they want on the Arduino side without necessarily having to modify the BeagleBone code. In general, I think the BeagleBone should be used for high-level and permanent tasks (e.g. data manipulation, web connection, camera connection and configuration, etc), and the Arduino should be used for hardware interfaces (such as listening to sensors and commanding actuators like motors and servos). But people should also be able to add control functionality to the Aruduino (such as a control loop that listens to sensors to control motors) that does not incorporate BB code.
2. I think your proposal satisfies this capability.
3. I think that some types of tasking are not mutually exclusive. To use our recent throttle limit discussion as an example, I think we could have Cockpit controls that change the throttle limits using BB code (that is, the commands ranging from 0 to 255 coming out of the BB's UART connection going to the Arduino could be limited to something like 20-235 when I slider is moved in Cockpit), but if someone wanted to do the same thing in Arduino, they could program it so that inputs coming from the UART command get trimmed by 20 on each side.
4. I tend to disagree with the idea of using levels of abstraction for Arduino code (such as Firmata, or special libraries) because those things make hacking using already available Arduino code (which I think a lot of people will want to do) a lot harder.
Here are some examples of code I could see someone wanting to adapt to work with their OpenROV:
Ideally, I think the default Arduino code would be a single file with very basic and easy to understand programming. People would be able to easily write their own code directly into this file and pass data to and from the UART connection in a very intuitive or standard way.
Although I think it is unlikely we'd be able implement this, what I really fantasize about, would be something that looks like the Arduino IDE that could be brought up through Cockpit (no sw would be on the topside computer) and you could program/ bring up serial termainals/ etc the same as if you had an Arduino plugged in directly to your computer with a USB cable.
The challenging bit with all of this is that people will want to interact with the programming they've written, and that requires talking through the interface that is hosted from the BeagleBone. I don't know the right way to do that, but I like some of the ideas that have been brought up so far (such as a print function in the Arduino code which specifies that data should be displayed in cockpit and specify how it should be displayed).
These are the times I really wish I had studied programming more earlier on, because I know there are principles to designing the right architecture I just don't understand. I'm really glad there are so many of us chiming in on how we can put this together the right way!