The Right Code for the Right Service Page !

Yay Worky ! -

Yay .. this is worky closes issue #106

Adding ?branch={someBranch} will switch code samples, icons, javadoc references and other materials in documentation to the appropriate branch.  This is helpful, because we develop on the develop branch but release from the master branch.  Most users will be interested in master, most developers will want the develop branch.

By default master is on, previously it only allowed develop branch material to be seen.

To demonstrate how this works

Here's my code sample - it has 2 versions 1 on master branch and one on develop 

Click the develop link and WATCH THE SAMPLE CHANGE BEFORE YOUR VERY EYES !!! - yet its a single reference to get your github code all formatted, pretty, link-ified, and correctly referenced  [ [home/GroG/codeSample.py] ], and it's all worky auto-magically !


#file : home/GroG/codeSample.py edit raw
# BLEEDING EDGE DEVELOP SCRIPT - MERGED with master !!!!!
# this is my most awesome code sample on the develop branch
# its cutting edge - but if you want to see it
# you supply ?branch=develop at the end of the documentation url

useVirtualArduino = False;
xPin = 9;
yPin = 6;
arduinoPort = "COM5";
cameraIndex = 0;
# using Sarxos for usb webcam, the other frame grabbers only worked on my integrated camera
frameGrabberType = "org.myrobotlab.opencv.SarxosFrameGrabber";

Runtime.start("gui", "SwingGui");

if useVirtualArduino:
  virtual = Runtime.start("virtual", "VirtualArduino");
  virtual.connect(arduinoPort);


t01 = Runtime.start("t01", "Tracking");
x = t01.getX();
# invert if necessary
# x.setInverted(True);

y = t01.getY();
# invert if necessary
# y.setInverted(True);

t01.connect(arduinoPort, xPin, yPin, cameraIndex);
opencv = t01.getOpenCV();
# noticed some swing display issues - I don't think Sarxos gets updated to display
opencv.setFrameGrabberType(frameGrabberType);
opencv.broadcastState();

# not sure if necessary - but get things to settle for 3 seconds
# before starting tracking
sleep(3);
# do lk optical point tracking
# t01.startLKTracking();
# do face tracking
=======
# MASTER RELEASED STABLE SCRIPT SCRIPT !!!!!
# this is my most awesome code sample on the develop branch
# its cutting edge - but if you want to see it
# you supply ?branch=develop at the end of the documentation url

useVirtualArduino = False;
xPin = 9;
yPin = 6;
arduinoPort = "COM5";
cameraIndex = 0;
# using Sarxos for usb webcam, the other frame grabbers only worked on my integrated camera
frameGrabberType = "org.myrobotlab.opencv.SarxosFrameGrabber";

Runtime.start("gui", "SwingGui");

if useVirtualArduino:
  virtual = Runtime.start("virtual", "VirtualArduino");
  virtual.connect(arduinoPort);


t01 = Runtime.start("t01", "Tracking");
x = t01.getX();
# invert if necessary
# x.setInverted(True);

y = t01.getY();
# invert if necessary
# y.setInverted(True);

t01.connect(arduinoPort, xPin, yPin, cameraIndex);
opencv = t01.getOpenCV();
# noticed some swing display issues - I don't think Sarxos gets updated to display
opencv.setFrameGrabberType(frameGrabberType);
opencv.broadcastState();

# not sure if necessary - but get things to settle for 3 seconds
# before starting tracking
sleep(3);
# do lk optical point tracking
# t01.startLKTracking();
# do face tracking

t01.faceDetect();