Fixed interpretation of roll yaw and pitch. Increased time to sleep between to events send to the wiimote.
git-svn-id: svn://svn.code.sf.net/p/wiigee/code/trunk@96 c7eff9ee-dd40-0410-8832-91a4d88773cf
This commit is contained in:
@@ -27,13 +27,17 @@ package org.wiigee.control;
|
|||||||
import org.wiigee.util.Log;
|
import org.wiigee.util.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* The mother of all classes. :-) It's just used as parent class
|
||||||
|
* to print version information and later on maybe dynamic configuring
|
||||||
|
* of the whole wiimote system... detecting plugins and devices automatically
|
||||||
|
* maybe. :)
|
||||||
*
|
*
|
||||||
* @author bepo
|
* @author Benjamin 'BePo' Poppinga
|
||||||
*/
|
*/
|
||||||
public class Wiigee {
|
public class Wiigee {
|
||||||
|
|
||||||
protected static String version = "1.5.2 alpha";
|
protected static String version = "1.5.3 alpha";
|
||||||
protected static String releasedate = "20090625";
|
protected static String releasedate = "20090626";
|
||||||
|
|
||||||
protected Wiigee() {
|
protected Wiigee() {
|
||||||
Log.write("This is wiigee version "+version+" ("+releasedate+")");
|
Log.write("This is wiigee version "+version+" ("+releasedate+")");
|
||||||
|
|||||||
@@ -31,6 +31,14 @@ import org.wiigee.logic.*;
|
|||||||
import org.wiigee.event.*;
|
import org.wiigee.event.*;
|
||||||
import org.wiigee.filter.*;
|
import org.wiigee.filter.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Abstract representation of a device with very basic functionalities. This
|
||||||
|
* class should be derived from, if anybody plans to add a new class of devices,
|
||||||
|
* like Wiimote or AndroidDevice does. This class mainly consist of filter
|
||||||
|
* management, recognition control and core event control.
|
||||||
|
*
|
||||||
|
* @author Benjamin 'BePo' Poppinga
|
||||||
|
*/
|
||||||
public class Device {
|
public class Device {
|
||||||
|
|
||||||
// Fixed number values.
|
// Fixed number values.
|
||||||
|
|||||||
@@ -28,6 +28,13 @@ import java.util.EventObject;
|
|||||||
|
|
||||||
import org.wiigee.device.Device;
|
import org.wiigee.device.Device;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An ActionStartEvent is an Event where other different events can
|
||||||
|
* be derived from, if they can be considered as an event actually starting
|
||||||
|
* a process like e.g. Training, Recognition, ...
|
||||||
|
*
|
||||||
|
* @author Benjamin 'BePo' Poppinga
|
||||||
|
*/
|
||||||
public class ActionStartEvent extends EventObject {
|
public class ActionStartEvent extends EventObject {
|
||||||
|
|
||||||
protected boolean trainbutton;
|
protected boolean trainbutton;
|
||||||
|
|||||||
@@ -27,6 +27,13 @@ package org.wiigee.event;
|
|||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
import org.wiigee.device.Device;
|
import org.wiigee.device.Device;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An ActionStopEvent is an Event where other different events can
|
||||||
|
* be derived from, if they can be considered as an event actually stopping
|
||||||
|
* a process like e.g. Training, Recognition, ...
|
||||||
|
*
|
||||||
|
* @author Benjamin 'BePo' Poppinga
|
||||||
|
*/
|
||||||
public class ActionStopEvent extends EventObject {
|
public class ActionStopEvent extends EventObject {
|
||||||
|
|
||||||
public ActionStopEvent(Device source) {
|
public ActionStopEvent(Device source) {
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ import org.wiigee.device.*;
|
|||||||
* Button 15 unknown
|
* Button 15 unknown
|
||||||
* Button 16 unknown
|
* Button 16 unknown
|
||||||
*
|
*
|
||||||
|
* There can be other interpretations of buttons for other devices.
|
||||||
|
*
|
||||||
* @author Benjamin 'BePo' Poppinga
|
* @author Benjamin 'BePo' Poppinga
|
||||||
*/
|
*/
|
||||||
public class ButtonPressedEvent extends ActionStartEvent {
|
public class ButtonPressedEvent extends ActionStartEvent {
|
||||||
|
|||||||
@@ -26,6 +26,11 @@ package org.wiigee.event;
|
|||||||
|
|
||||||
import org.wiigee.device.Device;
|
import org.wiigee.device.Device;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This Event gets fired, if the Device starts to move.
|
||||||
|
*
|
||||||
|
* @author Benjamin 'BePo' Poppinga
|
||||||
|
*/
|
||||||
public class MotionStartEvent extends ActionStartEvent {
|
public class MotionStartEvent extends ActionStartEvent {
|
||||||
|
|
||||||
public MotionStartEvent(Device source) {
|
public MotionStartEvent(Device source) {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import org.wiigee.device.Device;
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* This event would be generated if a motion stops.
|
* This event would be generated if a motion stops.
|
||||||
* contains: source (wiimote).
|
* contains: source.
|
||||||
*
|
*
|
||||||
* @author Benjamin 'BePo' Poppinga
|
* @author Benjamin 'BePo' Poppinga
|
||||||
*/
|
*/
|
||||||
@@ -37,7 +37,6 @@ public class MotionStopEvent extends ActionStopEvent {
|
|||||||
|
|
||||||
public MotionStopEvent(Device source) {
|
public MotionStopEvent(Device source) {
|
||||||
super(source);
|
super(source);
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import java.util.EventObject;
|
|||||||
import org.wiigee.logic.ProcessingUnit;
|
import org.wiigee.logic.ProcessingUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* This is a StateEvent, telling the listeners in which state of recognition
|
* This is a StateEvent, telling the listeners in which state of recognition
|
||||||
* the tool is:
|
* the tool is:
|
||||||
* 1 = training,
|
* 1 = training,
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ package org.wiigee.event;
|
|||||||
import java.util.EventListener;
|
import java.util.EventListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* This is the StateListener interface which has to be implemented
|
* This is the StateListener interface which has to be implemented
|
||||||
* by any application which should receive recognized statechanges.
|
* by any application which should receive recognized statechanges.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -24,6 +24,12 @@
|
|||||||
|
|
||||||
package org.wiigee.filter;
|
package org.wiigee.filter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This filter removes a vector, if it doesn't differ enough from
|
||||||
|
* the previously retrieved filter.
|
||||||
|
*
|
||||||
|
* @author Benjamin 'BePo' Poppinga
|
||||||
|
*/
|
||||||
public class DirectionalEquivalenceFilter extends Filter {
|
public class DirectionalEquivalenceFilter extends Filter {
|
||||||
|
|
||||||
private double sensivity;
|
private double sensivity;
|
||||||
|
|||||||
@@ -24,6 +24,11 @@
|
|||||||
|
|
||||||
package org.wiigee.filter;
|
package org.wiigee.filter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Abstract class to give a definition for a general filter.
|
||||||
|
*
|
||||||
|
* @author Benjamin 'BePo' Poppinga
|
||||||
|
*/
|
||||||
public abstract class Filter {
|
public abstract class Filter {
|
||||||
|
|
||||||
/***
|
/***
|
||||||
|
|||||||
@@ -24,6 +24,12 @@
|
|||||||
|
|
||||||
package org.wiigee.filter;
|
package org.wiigee.filter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filters if the wiimote is not moved in any way. Be careful in using
|
||||||
|
* this filter together with a HighPassFilter.
|
||||||
|
*
|
||||||
|
* @author Benjamin 'BePo' Poppinga
|
||||||
|
*/
|
||||||
public class IdleStateFilter extends Filter {
|
public class IdleStateFilter extends Filter {
|
||||||
|
|
||||||
private double sensivity;
|
private double sensivity;
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ package org.wiigee.filter;
|
|||||||
|
|
||||||
import org.wiigee.device.Device;
|
import org.wiigee.device.Device;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This filter uses time to determine if the wiimote actually is in motion
|
||||||
|
* or not. This filter only works together with the IdleStateFilter.
|
||||||
|
*
|
||||||
|
* @author Benjamin 'BePo' Poppinga
|
||||||
|
*/
|
||||||
public class MotionDetectFilter extends Filter {
|
public class MotionDetectFilter extends Filter {
|
||||||
|
|
||||||
private int motionchangetime;
|
private int motionchangetime;
|
||||||
|
|||||||
Reference in New Issue
Block a user