1 package cz.cuni.amis.pogamut.usar2004.agent.module.sensor; 2 3 import cz.cuni.amis.pogamut.base3d.worldview.object.Location; 4 import cz.cuni.amis.pogamut.base3d.worldview.object.Rotation; 5 import cz.cuni.amis.pogamut.usar2004.agent.module.datatypes.SensorType; 6 7 /** 8 * Sensor message representative for INS sensor. 9 * 10 * @author vejmanm 11 */ 12 public class SensorINS extends SuperSensor 13 { 14 //public static final String type="INS"; 15 public static final SensorType type = SensorType.INS_SENSOR; 16 17 /** 18 * Ctor. Sensor type describes particular subject about which we want to 19 * know about. It is used to distinguish incoming message from the server. 20 */ 21 public SensorINS() 22 { 23 super(type); 24 } 25 26 /** 27 * Location used by INS sensor to determine robots location. 28 * 29 * @return Returns Location from INS sensor. 30 */ 31 public Location getLocation() 32 { 33 return lastMessage.getLocations().get(0); 34 } 35 36 /** 37 * INS sensor entry in USARSim manual v3.1.3 suggests that it should need 38 * more than one record of Orienation, but the experience was different. 39 * Still we use list of Rotations to support multiple entry. Mainly used for 40 * determination of robots Orientation. Here we offer only the first Record. 41 * 42 * @return Returns Rotation from INS sensor. 43 */ 44 public Rotation getOrientation() 45 { 46 return lastMessage.getOrientations().get(0); 47 } 48 }