Package com.grt192.benchtest.mechanism

Source Code of com.grt192.benchtest.mechanism.BenchCameraAssembly

package com.grt192.benchtest.mechanism;

import com.grt192.actuator.GRTServo;
import com.grt192.core.Mechanism;
import com.grt192.sensor.GRTAxisCamera;

/**
*
* @author anand
*/
public class BenchCameraAssembly extends Mechanism {

    private GRTServo servo;
    private GRTAxisCamera camera;
    private boolean debug;

    public BenchCameraAssembly(int port, boolean debug) {
        camera = new GRTAxisCamera("Camera");
        camera.start();
        addSensor("camera", camera);
        servo = new GRTServo(port);
        addActuator("servo", servo);
        servo.start();
        this.debug = debug;
    }

    public void rotateCamera(double angle) {
        if (debug) {
            System.out.println("C " + angle);
        }
        servo.enqueueCommand(angle);
    }
}
TOP

Related Classes of com.grt192.benchtest.mechanism.BenchCameraAssembly

TOP
Copyright © 2018 www.massapi.com. 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.