User:BenMcDonald

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
m
(Iteration Three)
Line 2: Line 2:
  
  
I am doing my design study for my COSC426:Augmented Reality project. I need a design for a boxing skills trainer. No code has been written so far. I have made a sketch of the requirements for the design of the software. The project is in C++ using the libraries open scene graph (osg) and augmented reality tool-kit open scene graph (ARTosg)
+
I am doing my design study for my COSC426:Augmented Reality project. I need a design for a boxing skills trainer. No code has been written so far. I have made a sketch of the requirements for the design of the software. The project is in C++ using the libraries open scene graph (osg), augmented reality tool-kit open scene graph (ARTosg) and the Wii controller library for windows
  
 
Requirements:
 
Requirements:
Line 10: Line 10:
 
** Bobbing and weaving
 
** Bobbing and weaving
 
** Timing of punches
 
** Timing of punches
* Each skill needs to be modelled and the evaluation method for each skill also needs to be modelled.
+
* Each skill needs to be modeled and the evaluation method for each skill also needs to be modeled.
 
* The performance on the skills needs to be evaluated and for additional activities to be recommended to the athlete.
 
* The performance on the skills needs to be evaluated and for additional activities to be recommended to the athlete.
 
* An athlete’s evaluation history, progress and general details to be recorded and recoverable.
 
* An athlete’s evaluation history, progress and general details to be recorded and recoverable.
 +
== Iteration Three ==
 +
[[Image:BenM's UMLI3.png|border|800px]]
 +
 +
Maxims that have been useful:
 +
* [[Command query separation]] - One plus of C++ is that you can mark queries, and enforce them, with the const keyword.
 +
* [[Design by contract]] - Using assert's to enforce conditions at the moment
 +
* [[Don't expose mutable attributes]] - In C++, objects returned from another object's method can be marked as const to make them immutable.
 +
 +
=== Patterns ===
 +
[[Intelligent children pattern]]
 +
* BoxerPose hierarchy
 +
* Boxer hierarchy
 +
 +
[[State|State Pattern]]:
 +
* Context - Trainer
 +
* State - TrainingActivity
 +
* ConcreteStates - PunchingDrill, BobbingAndWeaving
 +
 +
[[Visitor|Visitor Pattern]]
 +
* ConcreteElement - Trainer, Boxer
 +
* Element - Boxer
 +
* Visitor - Exporter
  
== Iteration One ==
 
[[Image:BenM's UMLI1.png|border|700px]]
 
== Design: ==
 
 
[[Observer|Observer Pattern]]:
 
[[Observer|Observer Pattern]]:
 
* Subject - Observable
 
* Subject - Observable
* ConcreteSubject - Athlete
+
* ConcreteSubject - UserBoxerPose
 
* Observer - Observer
 
* Observer - Observer
 
* ConcreteObserver - Trainer
 
* ConcreteObserver - Trainer
 +
A trainer can be made to observer a UserBoxerPose. The trainer will record the pose history and generate evaluations from that history, generate feedback from its observations and react to the pose's actions.
 +
 +
[[Observer|Observer Pattern]]:
 +
* Subject - Observable
 +
* ConcreteSubject - TrainerPose
 +
* Observer - Observer
 +
* ConcreteObserver - TrainerAnimation
 +
 +
I wanted the Trainer to know about the timings of the animations and was tempted to couple the Trainer class to the TrainerAnimations class and vice versa. I instead decided to remove the Trainer's knowledge of its animations and required the animations to conform to the timings of the Trainer's movements. The TrainerAnimations class is likely to change and coupling the Trainer class to it would increase maintenance of the Trainer class.
 +
 
== Iteration Two ==
 
== Iteration Two ==
[[Image:BenM's UMLI2.png|border|700px]]
+
[[Image:BenM's UMLI2.png|border|600px]]
 
== Design: ==
 
== Design: ==
 
[[State|State Pattern]]:
 
[[State|State Pattern]]:
Line 39: Line 68:
 
* Observer - Observer
 
* Observer - Observer
 
* ConcreteObserver - TrainerAnimation
 
* ConcreteObserver - TrainerAnimation
The design is modular. The osg libraries are only used in two classes, TrainerAnimation and osgDiplay, and no other classes are dependent on this graphics library. This is achieved through the observer pattern. TrainerAnimation observers the Trainer and because of this the Trainer class has no knowlege and is therefore independent of the way is displayed and the osg graphics library.
 
  
Maxims that have been useful:
+
 
* [[Command query separation]] - One plus of C++ is that you can mark queries, and enforce them, with the const keyword.
+
== Iteration One ==
* [[Design by contract]] - Using assert's to enforce conditions at the moment
+
[[Image:BenM's UMLI1.png|border|600px]]
 +
== Design: ==
 +
[[Observer|Observer Pattern]]:
 +
* Subject - Observable
 +
* ConcreteSubject - Athlete
 +
* Observer - Observer
 +
* ConcreteObserver - Trainer

Revision as of 08:10, 21 September 2009

Contents

Ben McDoanld's page

I am doing my design study for my COSC426:Augmented Reality project. I need a design for a boxing skills trainer. No code has been written so far. I have made a sketch of the requirements for the design of the software. The project is in C++ using the libraries open scene graph (osg), augmented reality tool-kit open scene graph (ARTosg) and the Wii controller library for windows

Requirements:

  • A score needs to be generated from a set of tested skills:
    • Consistent guard
    • Eyes forward and on opponent
    • Bobbing and weaving
    • Timing of punches
  • Each skill needs to be modeled and the evaluation method for each skill also needs to be modeled.
  • The performance on the skills needs to be evaluated and for additional activities to be recommended to the athlete.
  • An athlete’s evaluation history, progress and general details to be recorded and recoverable.

Iteration Three

BenM's UMLI3.png

Maxims that have been useful:

Patterns

Intelligent children pattern

  • BoxerPose hierarchy
  • Boxer hierarchy

State Pattern:

  • Context - Trainer
  • State - TrainingActivity
  • ConcreteStates - PunchingDrill, BobbingAndWeaving

Visitor Pattern

  • ConcreteElement - Trainer, Boxer
  • Element - Boxer
  • Visitor - Exporter

Observer Pattern:

  • Subject - Observable
  • ConcreteSubject - UserBoxerPose
  • Observer - Observer
  • ConcreteObserver - Trainer

A trainer can be made to observer a UserBoxerPose. The trainer will record the pose history and generate evaluations from that history, generate feedback from its observations and react to the pose's actions.

Observer Pattern:

  • Subject - Observable
  • ConcreteSubject - TrainerPose
  • Observer - Observer
  • ConcreteObserver - TrainerAnimation

I wanted the Trainer to know about the timings of the animations and was tempted to couple the Trainer class to the TrainerAnimations class and vice versa. I instead decided to remove the Trainer's knowledge of its animations and required the animations to conform to the timings of the Trainer's movements. The TrainerAnimations class is likely to change and coupling the Trainer class to it would increase maintenance of the Trainer class.

Iteration Two

BenM's UMLI2.png

Design:

State Pattern:

  • Context - Trainer
  • State - TrainingState
  • ConcreteStates - PunchingDrill, BobbingAndWeaving

Observer Pattern:

  • Subject - Observable
  • ConcreteSubject - UserBoxer
  • Observer - Observer
  • ConcreteObserver - Trainer

Observer Pattern:

  • Subject - Observable
  • ConcreteSubject - Trainer
  • Observer - Observer
  • ConcreteObserver - TrainerAnimation


Iteration One

BenM's UMLI1.png

Design:

Observer Pattern:

  • Subject - Observable
  • ConcreteSubject - Athlete
  • Observer - Observer
  • ConcreteObserver - Trainer
Personal tools