Sonntag, 3. Februar 2008

A few lessons learned in the past couple of days. Most of them are good, but it's still all laying tedious groundwork - I'm really skeptic regarding the desired may-release-date of the robot. But still, it's good to see at least some pieces falling together

What did I learn?
  • How to create multiple instances of COCOA-InterfaceBuilder-created interfaces! That was a long-needed thing. What you essentially do is to create a NIB-file for your visual component. Then you can load that component using NSBundle.loadNibNamed:owner:. Whatever you attach to outlets of the owner will become available to you. Thanks to Kyle from cocoa-dev ML who teached me that.
  • There is no need to make the main-thread of my robot-controlling application a real-time-scheduled thread. Paolo suggested that only my control-loop needs to be real-time. I followed his suggestions - and voila, my previous problems with my main-thread eating up more or less every CPU-cycle has gone away. However, this somehow introduced a spurious segmentation-fault it appears, that makes my app die sometimes and even seems to have the potential to crash the whole system - it rebooted a few times today, without me doing anything else. I already began working on a solution, but so far to no avail - needs more attention it seems.
  • Bonjour/ZeroConf is out of the game for now. The reason is that I wasn't able to decouple it from the gobject-mainloop. And for some reason I don't get my Pyro-Nameserver reacting to broadcasts (or they aren't communicated properly). So currently I'm running on a fixed IP with my robot's WIFI-card. The bonjour-thing will resurface at some point, but right now there is more urgend stuff to do.
  • It seems that ctypes-Structure-objects aren't pickable. At least I can't send them over the wire using Pyro without them being null'ed - so not much sense in that.
  • And I found out that my all-knowing-physics-genius David can produce complex differential equations I'm going to need for the later path-controlling straight out of his head, even when he has the flu. Impressive, and a bit intimidating.
So what's working? I got my OS X-based monitoring app connecting to the state-server so that motor-information is displayed. I did have the robot-control-program spawn a pyro-server that reacted to commands locally, but for some reason I can't fathom it won't work when invoked from the monitoring-app on the notebook. That will be the next thing to attend to.