Package ca.teamdave.caruso.sensor

Examples of ca.teamdave.caruso.sensor.Sensor


        this.actuators = new Hashtable(actuators.size());

        String key;
        Object value;

        Sensor sensor;
        Enumeration keys = sensors.keys();
        while (keys.hasMoreElements()) {
            key = (String) keys.nextElement();
            sensor = (Sensor) sensors.get(key);

            value = sensor.getValue();
            this.sensors.put(key, value);
        }

        Actuator actuator;
        keys = actuators.keys();
View Full Code Here


    public Hashtable createSensors() {
        final SimpleFRCBotSimulated me = this;
        Hashtable res = new Hashtable();

        // Create sensor objects
        res.put(SimpleFRCIO.ARM_DOWN_BUTTON, new Sensor(Boolean.class) {
            protected Object retrieveValue() {
                return me.armPosition <= me.lowSensor;
            }
        });
        res.put(SimpleFRCIO.ARM_UP_BUTTON, new Sensor(Boolean.class) {
            protected Object retrieveValue() {
                return me.armPosition >= me.highSensor;
            }
        });
        res.put(SimpleFRCIO.MOTION_STATE, new Sensor(String.class) {
            protected Object retrieveValue() {
                if (me.lowSensor == me.armPosition) {
                    return "At low limit";
                } else if (me.highSensor == me.armPosition) {
                    return "At high limit";
View Full Code Here

    public Hashtable createSensors() {
        final LinearRobotSimulated me = this;
        Hashtable res = new Hashtable();

        res.put(LrNames.POSITION_SENSOR, new Sensor(Double.class){
            protected Object retrieveValue() {
                return new Double(me.pos);
            }
        });

        res.put(LrNames.ROBOT_SPEED, new Sensor(Double.class){
            protected Object retrieveValue() {
                return new Double(me.speed);
            }
        });

        res.put(LrNames.ROBOT_ACCEL, new Sensor(Double.class){
            protected Object retrieveValue() {
                return new Double(me.accel);
            }
        });
View Full Code Here

     */
    public Hashtable createSensors() {
        final SimpleFRCBotPhysical me = this;

        Hashtable res = new Hashtable();
        res.put(SimpleFRCIO.ARM_UP_BUTTON, new Sensor(Boolean.class) {
            protected Object retrieveValue() {
                return (me.armUpButton.get() ? Boolean.TRUE : Boolean.FALSE);
            }
        });
        res.put(SimpleFRCIO.ARM_DOWN_BUTTON, new Sensor(Boolean.class){
            protected Object retrieveValue() {
                return (me.armDownButton.get() ? Boolean.TRUE : Boolean.FALSE);
            }
        });

View Full Code Here

TOP

Related Classes of ca.teamdave.caruso.sensor.Sensor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.