Archive for August, 2015

Part III of Lab 2

Posted in Altera Labs, Cyclone II Experiments, FPGA on August 29, 2015 by asteriondaedalus

Here is were I am up to with Digital Lab 2, having sorted out what I thought was an issue with Part III.  Turned out I was muddled by my use of 4 bit LPM constants so I just opted for 4×1-bit constants so as not to confound.

DL-L2

Advertisements

Windoze 10, NO IDEA

Posted in Windoze10 on August 24, 2015 by asteriondaedalus

What on earth is this thing they call a “Start Menu“.  I am a software developer come system engineer come safety engineer and I have loaded my machine with, well, stuff.

I take a deep breath and install Windows 10 over my Windows 7 install.  How bad can it be right, they have to run all the older software or go out of business right AND I hear that they brought the start menu back.

Nope.  They lied, it is a “Stop Menu“.  I have rafts of applications that don’t turn up at all in the “Stop Menu“.  In some cases an entry might turn up and it will only have say a help file or even an uninstall program in the list under the menu – that is no application icon.

It isn’t even obvious that if I go to the trouble of pining applications to the start menu that they will turn up in the half built menus that already exist for the application.  If the “Stop Menu” cannot work out to put them in the list then how would it know to associate an application with a skeleton folder?  Or, if it can why the frack didn’t it put the application file in?

Makes me itch to want to write an Windoze 10 App call “The Other Start Menu”.

They aren’t real Apps in any event for crying out loud.  Why didn’t they just buy Google or Apple and real App based environments.  I am still running consoles and IDE etc. – when I can find the fracking things.

I even downloaded an Explorer App.  Doh! Has same dopey sense of HMI (Horribly Modelled Interface).

I mean look at this.

idea

No IDEA in “All Apps”.  No Jetbrains either.  Nothing found in search.

I actually am playing with MPS and MBEDDR as well as IDEA so where the hell are they in the search if they aren’t in the “All Apps”?

I have so much stuff on my machine I forget where I put IDEA 😉 I must be powered by Windoze 10 LOL!

Any old how, I had a clutter of shortcuts on me desktop and … phew … there it was.

So, Windoze 10 cannot find an application in the Windoze “Program Files (x86)” folder.  Now I would forgive it … not really … if I had it in one of my D: or E: drive hidy holes but it is in a default Windoze application install folder and Windoze cannot find it!

WAIT A FRACKEN GODDAM MINUTE!!!  Have a look at this!

ideareg

IDEA IS IN THE FRACKEN REGISTRY AND WINDOZE 10 “Stop Menu” search cannot find it!!!

As far as WINDOZE 10 is concerned, it has NO IDEA!  Apt if not App … DIG IT!?

OH COME ON!!!!!!!!!!!   FRAAAAAAAAACCCCCCCCKKKKK!!!

Have a FRACKEN look at this!!!

noidea

NO IDEA in “Stop Menu

NO IDEA in “Search the web and Windoze – except for the bits we don’t search

I tried dragging from folder and NO to IDEA for dropping into either start menu or apps.

QUADRUPLE FRAAAAAAAAACCCCCCCCKKKKK!!!

I tried skipping down to the folder were the exe is sitting. Sure enough right click and it has the option of “Pin to Start”.

Except, 5 attempts and it doesn’t work!  Nothing turns up in “Stop Menu” as often as I hit the “Pin to Stop” menu item.  There is even as 64bit exe in the bin folder.  That did not get put in list either.

Why is Windoze 10 anti-exe?

Isn’t this the same people who wrote the BING search engine?  Is there really a “Dark Web” or is it just Microsoft can’t write search algorithms?

OMG!

Posted in Processing, Prototyping on August 23, 2015 by asteriondaedalus

I have IntelliJ IDEA on my desktop, I sort of flick between it, Eclipse JDT etc.  I had actually pulled it up to use it for my Elixir and Erlang programming.

Turns out BoofCV has a Gradle build and is IDEA friendly so I thought I would poke around and make a few changes.

One thing I wanted to do was to look at integrating sarxos webcam-capture in with BoofCV and I was poking around trying to workout how to do that.  Well, turns out there is a folder in the BoofCV project in IDEA that actually already does this so I was able to run a couple of feature and object tracking examples off my Bloggie.

I did note they were using 0.3.10 versions of webcam-capture so the “get camera by name” method was missing, so I had a look at how to add it in the IntelliJ IDEA.  I will have to get a Gradle book but it looks like an xml file pulls jar base libraries into a cache.  I did the change the dirty sneaky way and I copied 0.3.11 over 0.3.10 in the cache to see if that would let be play.  It did and I modified a BoofCV class to allow for named webcams.

I will still need to read up on Gradle to work out WTFO on the URL and the URI that seems embedded in it.  Might not be straight forward as 0.3.11 does not appear in the main or tagged branches yet (you can download a jar with that version from the sarxos site however).

So, will now look at prototyping the omnivision collision detection and fuzzy steering on my PC before porting to the Processing for Android.

I am feeling it is all doable.

Getting webcams working in Processing…

Posted in Processing, The downside of Opensource on August 22, 2015 by asteriondaedalus

… when processing video library does not help.

Some webcams don’t appear to work with Processing video library.

When you use the default example you will get the camera listed but it will never be available nor will it raise a capture event.

processingvideo

Having poked around, the solution I found was to go to:

http://webcam-capture.sarxos.pl/

Download: webcam-capture-0.3.10-dist.zip

From the zip file above unzip: bridj-0.6.2.jarslf4j-api-1.7.2.jar

Grab the latest development jar for webcam-capture from here as the one in the zip is missing the get camera by name function.  The jar at the link (when I looked last) was webcam-capture-0.3.11-20150713.101234-10.jar

Create a sketch and add all three jar to the sketch using:

addfile

Enter following code:

helpt

When you run it you should get a small window, or at least I did.

Replace my camera name with yours.  Mine is “MHS-FS2 0”.

To find the name and index for you camera use the following:

helpt2

The camera name is your “camera name” + ” ” + “index”.

Note the index will not necessarily be the same each time (if you have multiple cameras) as they might be found by system in different order each time you start up.

Multiple Java examples at author’s websites at either:

http://webcam-capture.sarxos.pl/

or

https://github.com/sarxos

Note you get get the image with:

BufferedImage image = webcam.getImage();

But you will have to convert it to PImage if using Processing window thingies.

Suspicion is currently that one uses the BufferedImage.getRBG() method with the PImage.pixels[]. This assumes PImage.pixels[] is an RBG array.  There is some example Processing code which seems to confirm this so fingers crossed.

Hmmmmm

Posted in Altera Labs, Cyclone II Experiments, FPGA on August 20, 2015 by asteriondaedalus

When testing Part III of Lab 2 there were some anomalies. Here is where I am at – DL-L2.

I have double checked the 1-bit adder so I am thinking it is in the wiring up.  I think also I have forgotten, as usual, that the input pins need inversion before use (since they are pulled UP).  Still, when I pulled them up, I still got weird results so that points back to the wiring up.

Stay tuned for corrections.

Give me one ping Captain …

Posted in The downside of Opensource on August 18, 2015 by asteriondaedalus

… please! Just one lousy ping.

PinG!!

Pinarrrrggggggggggggh!

Nope.

No ping, just some cycling rubbish that appears to interact somehow with delay between pings.  Zero returns mixed with occasional fixed value that does not fluctuate with distance of sensor from object.

Using the newping library was no help despite the author claiming that this gadget was one of the gadgets the library was tuned for.

Web search suggests multiple people trying and giving up on this gadget.

Might well do the same.

Pity, I thought, it might act as sonic bumper for my dive camera housing based submersible.

sony cam

Back to drawing board.

In the meantime …

Posted in Doodling, Processing on August 14, 2015 by asteriondaedalus

… it occurred that fuzzy controllers might be possible in Processing if a fuzzy library was imported.  I opted to try out jFuzzylite as it appeared more compact than jFuzzyLogic.

I built the jar using ant and then imported it into a Processing sketch.  Just use “Add file” menu thus:

addfile

The modified example is coded below in Processing.  Quirk is it opens a small window (as expected) but fills the console with window event logging – as well as the intended print out at bottom.  So, needs some investigating but the fuzzylogic works.

jFuzzylite is also supposed to work with Android so I will switch the Android mode in and see what happens.  The fuzzy logic will be useful for the omni sensor app as the steering may need to be fuzzy to take account of the possible “noise” in the visual field.

Looking good.  Especially as it has a visual tool to design the fuzzywuzzyness that will export to various formats.

qtfuzzy

Very neat.

 __________________________________________

import com.fuzzylite.Engine;
import com.fuzzylite.FuzzyLite;
import com.fuzzylite.Op;
import com.fuzzylite.defuzzifier.Centroid;
import com.fuzzylite.imex.FldExporter;
import com.fuzzylite.norm.s.Maximum;
import com.fuzzylite.norm.t.Minimum;
import com.fuzzylite.rule.Rule;
import com.fuzzylite.rule.RuleBlock;
import com.fuzzylite.term.Triangle;
import com.fuzzylite.variable.InputVariable;
import com.fuzzylite.variable.OutputVariable;

Engine engine = null; 
OutputVariable power = null;
RuleBlock ruleBlock = null;
InputVariable ambient = null;

void setup() {
   engine = new Engine();
   engine.setName("simple-dimmer");
   
   ambient = new InputVariable();
   ambient.setName("Ambient");
   ambient.setRange(0.000, 1.000);
   ambient.addTerm(new Triangle("DARK", 0.000, 0.250, 0.500));
   ambient.addTerm(new Triangle("MEDIUM", 0.250, 0.500, 0.750));
   ambient.addTerm(new Triangle("BRIGHT", 0.500, 0.750, 1.000));
   
   engine.addInputVariable(ambient);
 
   power = new OutputVariable();
   power.setName("Power");
   power.setRange(0.000, 1.000);
   power.setDefaultValue(Double.NaN);
   power.addTerm(new Triangle("LOW", 0.000, 0.250, 0.500));
   power.addTerm(new Triangle("MEDIUM", 0.250, 0.500, 0.750));
   power.addTerm(new Triangle("HIGH", 0.500, 0.750, 1.000));
 
   engine.addOutputVariable(power);

   ruleBlock = new RuleBlock();
   ruleBlock.addRule(Rule.parse("if Ambient is DARK then Power is HIGH", engine));
   ruleBlock.addRule(Rule.parse("if Ambient is MEDIUM then Power is MEDIUM", engine));
   ruleBlock.addRule(Rule.parse("if Ambient is BRIGHT then Power is LOW", engine));
   
   engine.addRuleBlock(ruleBlock);
 
   engine.configure("", "", "Minimum", "Maximum", "Centroid");
 
   noLoop();
}
void draw() {
   StringBuilder status = new StringBuilder();
   
   if (!engine.isReady(status)) {
      throw new RuntimeException("Engine not ready. "
      + "The following errors were encountered:\n" + status.toString());
    } 

   for (int i = 0; i < 50; ++i) {
      double light = ambient.getMinimum() + i * (ambient.range() / 50);
      ambient.setInputValue(light);
      engine.process();
      println(String.format( "Ambient.input = %s -> Power.output = %s",
      Op.str(light), Op.str(power.getOutputValue())));
   }
}