View Javadoc

1   package cz.cuni.amis.pogamut.usar2004.communication.messages.datatypes;
2   
3   import java.io.Serializable;
4   
5   /**
6    * Odometry pose is the estimated robot position relative to the start point in
7    * meters. ‘theta’ is the head angle in radians relative to the start
8    * orientation. This class is used for storing data from Odometry Sensor.
9    *
10   * @author vejmanm
11   */
12  public class OdometryPose implements Serializable, Cloneable
13  {
14      private double x = 0;
15      private double y = 0;
16      private double theta = 0;
17  
18      public OdometryPose()
19      {
20      }
21  
22      public OdometryPose(double x, double y, double theta)
23      {
24          this.x = x;
25          this.y = y;
26          this.theta = theta;
27      }
28  
29      public double getX()
30      {
31          return x;
32      }
33  
34      public double getY()
35      {
36          return y;
37      }
38  
39      public double getTheta()
40      {
41          return theta;
42      }
43  
44      public final void set(double x, double y, double theta)
45      {
46          this.x = x;
47          this.y = y;
48          this.theta = theta;
49  
50      }
51  
52      public final void set(OdometryPose tplOP)
53      {
54          this.x = tplOP.x;
55          this.y = tplOP.y;
56          this.theta = tplOP.theta;
57      }
58  
59      @Override
60      public Object clone()
61      {
62          return new OdometryPose(x, y, theta);
63      }
64  }