Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: Streaming data to polargraph controller.
unsound
Newbie
Posts: 3
Permalink
Post Streaming data to polargraph controller.
on: August 17, 2013, 09:39
Quote

Hey Sandy,

I am a novice at processing so I thought I would ask you for some advice.

I have a sketch that I have written that I would like to stream changing co-ordinate data to the polargraph controller... Is this possible?

Can the polargraph controller read a stream of data from a source. If so how would I go about doing it?

Any help you could provide me would be greatly appreciated.

Kind Regards

Robert Cameron

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Streaming data to polargraph controller.
on: August 17, 2013, 11:24
Quote

Hi, good question. I was going to say "depends what you mean by streaming", but it actually doesn't - regardless of what you mean by streaming, I'm sure its technically possible to get a processing sketch to connect to another one, and do some communication. Peel back a fairly thin layer in Processing and you've got java, and can do anything that java can do. There's a couple of hoops to jump through to do with the way that processing executes its code, vs the way that most java programs get executed, but I'd be surprised if those problems have not already been well-solved. If nothing else, a network protocol could be used to open a socket between the two sketches.

HOwever, all of that is a bit of a moot point because the polargraph controller does not (at this time) have any interface for such a connection - which is, I guess, what
you were actually asking.

The question I have is what do you need the controller for? To take a cartesian coordinate pair and send it off to the arduino? There's definitely a better solution. Really, there should be a kind of back-end library that does all that stuff, with a good API, and the front end is all the wizzy graphical stuff. So the library could be reused in any program that wants to be able to talk to a polargraph. It doesn't have that yet, so to use a polargraph machine you need to reimplement all the comms, coordinate conversion and commands stuff, which is [at least one reason] why nobody has done it.

I don't think it would be at all hard to modify the controller so that it could have commands sent to it over a socket, and they would then land in the command queue and be dealt with like any other. The real issue is that that would probably not be enough to be useful. What I would actually want (if I was writing another client for polargraph), is the ability to get a "machine" object, set it to my target size (or ask it what size it is), then be able to ask it to convert between two coordinate systems. The comms side of things might be better separated out into another object so that the comms is not coupled to the coordinatey stuff.

So the process might be
1. Instantiate new _Machine_ object, tell it the size of itself (physically).
2. Generate your coordinate for your first point,
3. Ask the Machine object for the _Command_ required to draw to the coordinate
4. Add the new Command object to the Dispatcher

Where the Machine knows all about machine sizes, coordinate systems, the command syntax etc.
And the Dispatcher object knows all about the USB ports, wireless dongles, esoteric network connections required to actually get the command into the arduino itself.

Drop me an email (sandy dot noble at gmail) about this if you would like to take it forward - the above looks a bit like a spec for an API, but it'll be much easier for me to figure out where to draw the line (ha) if I have a real person who wants to use it! If not, well it might happen spontaneously, but then it might not!

cheers!
sn

awdriven
Newbie
Posts: 1
Permalink
Post Re: Streaming data to polargraph controller.
on: August 19, 2013, 18:47
Quote

Definitely interested in having a means of pushing realtime data to polargraph! I sent you an e-mail. My own ideation was to have a 'headless' controller that could process a series of svg files into a command queue that would be sent to the arduino. If another approach is more generally useful, I'd go along with whatever 😉

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.017 seconds.