Overview Design Principles Vision Performance Good Design Principles

  • Slides: 20
Download presentation
Overview Design Principles Vision Performance

Overview Design Principles Vision Performance

Good Design Principles Stick to a Schedule Keep It Simple Stupid (KISS) Have a

Good Design Principles Stick to a Schedule Keep It Simple Stupid (KISS) Have a contingency plan Can you explain it to an audience? Be Consistent Discuss team conventions

Modular Design Divide problems into chunks of work Individual chunks are simple Consistent interface

Modular Design Divide problems into chunks of work Individual chunks are simple Consistent interface between chunks Additional Benefits Enables efficient individual work Enables validity testing on each chunk

Modular Design Example

Modular Design Example

Iterative Design Don't assume your initial design is perfect Prototype high risk problems first

Iterative Design Don't assume your initial design is perfect Prototype high risk problems first

Testing Unit Testing Every module should have one System Tests Avert day-of-contest embarrassment with

Testing Unit Testing Every module should have one System Tests Avert day-of-contest embarrassment with a complete test suite

Source Control Always Keep A Working Copy Keep teammates productive while you fix things

Source Control Always Keep A Working Copy Keep teammates productive while you fix things Undo mysterious changes made during 6 am binge programming sessions

Source Control Exercise Get your robot online and on source control svn checkout svn+ssh:

Source Control Exercise Get your robot online and on source control svn checkout svn+ssh: //athena. dialup. mit. edu/afs/athena. mit. e du/course/6/6. 186/2008/team-repos/team#/ repos Additional common operations: svn up svn ci man svn

Overview Design Principles Vision Performance

Overview Design Principles Vision Performance

Feature Detection Colors: Red and Yellow, Probably Others. . . Shapes: Parallelograms and Circles

Feature Detection Colors: Red and Yellow, Probably Others. . . Shapes: Parallelograms and Circles

Colors RGB HSV

Colors RGB HSV

Colors RGB HSV Provided Format Coherent Format No Cost Requires Conversion

Colors RGB HSV Provided Format Coherent Format No Cost Requires Conversion

Shapes Lots of options Average points of same color Edge Detection RANSAC

Shapes Lots of options Average points of same color Edge Detection RANSAC

Camera Calibration Lighting / White-Balance Lens Focus Caveat: Limited setup time at competition

Camera Calibration Lighting / White-Balance Lens Focus Caveat: Limited setup time at competition

Overview Design Principles Vision Performance

Overview Design Principles Vision Performance

Software Performance CPU bottleneck: Image processing 160 x 120 = 19, 200 pixels to

Software Performance CPU bottleneck: Image processing 160 x 120 = 19, 200 pixels to process every frame Minimize raw image passes Downsample Skip lines if your feature detection can handle it In Java, avoid get/set pattern for data arrays

Hardware Limitations Camera Capture Frequency Motor Slew Rate

Hardware Limitations Camera Capture Frequency Motor Slew Rate

Threading Enables multiple processes to run simultaneously Behind the scenes, the CPU only runs

Threading Enables multiple processes to run simultaneously Behind the scenes, the CPU only runs one process at a time, and switches frequently between them.

Threading Pros: Simplifies CPU Cons: Timesharing Context Switching Overhead Minimizes Non-CPU Concurrency Bugs Bottlenecks

Threading Pros: Simplifies CPU Cons: Timesharing Context Switching Overhead Minimizes Non-CPU Concurrency Bugs Bottlenecks Single Processor

Threading Exercise Coilette's logic and dependencies: Wander (depends on IR and motors) Image processing

Threading Exercise Coilette's logic and dependencies: Wander (depends on IR and motors) Image processing (depends on Capture Rate) Other behaviors (depends on processed image) Action selection (depends on behaviors in order) Conclusion: Dependency chain prohibits useful threading