All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lejos.robotics.localization.CompassPoseProvider Maven / Gradle / Ivy

Go to download

leJOS (pronounced like the Spanish word "lejos" for "far") is a tiny Java Virtual Machine. In 2013 it was ported to the LEGO EV3 brick.

The newest version!
package lejos.robotics.localization;

import lejos.robotics.DirectionFinder;
import lejos.robotics.navigation.MoveProvider;
import lejos.robotics.navigation.Pose;

/**
 * Pose Provider using a compass (or other direction finder) to provide 
 * location and heading data.
 * 
 * Note: This is a temporary class to allow access compass data until we have
 * a more encompassing solution for data from multiple instrumentation.
 * @author BB
 *
 */
public class CompassPoseProvider extends OdometryPoseProvider {

	private DirectionFinder compass;
	
	public CompassPoseProvider(MoveProvider mp, DirectionFinder compass) {
		super(mp);
		this.compass = compass;
	}

	public Pose getPose() {
		Pose temp = super.getPose();
		temp.setHeading(compass.getDegreesCartesian());
		return temp;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy