View Javadoc

1   package cz.cuni.amis.pogamut.usar2004.communication.messages.datatypes;
2   
3   import java.io.Serializable;
4   
5   /**
6    * VALUE parameter has two possible meanings. If the link being described is a
7    * prismatic joint, double gives the distance (in meters) from the original
8    * position of the link. If the link being described is a revolute joint, it
9    * gives a sector(probably).
10   *
11   * The TORQUE parameter gives the current torque of the link being described. *
12   * All of the above are collected into one data structure below this text.
13   *
14   * @author vejmanm
15   */
16  public class LinkState implements Serializable, Cloneable
17  {
18      private int link = 0;
19      private double value = 0;
20      private double torque = 0;
21  
22      public LinkState()
23      {
24      }
25  
26      public LinkState(int link, double value, double torque)
27      {
28          this.link = link;
29          this.value = value;
30          this.torque = torque;
31      }
32  
33      @Override
34      public Object clone()
35      {
36          return new LinkState(link, value, torque);
37      }
38  
39      public final void set(int link, double value, double torque)
40      {
41          this.link = link;
42          this.value = value;
43          this.torque = torque;
44  
45      }
46  
47      public final void set(LinkState tplLS)
48      {
49          link = tplLS.link;
50          value = tplLS.value;
51          torque = tplLS.torque;
52      }
53  
54  //            public final void get(LinkState tplLS) {
55  //                
56  //                tplLS.link=link;
57  //                tplLS.value=value;
58  //                tplLS.torque=torque;
59  //            }
60      public final int getLink()
61      {
62          return link;
63      }
64  
65      public final double getValue()
66      {
67          return value;
68      }
69  
70      public final double getTorque()
71      {
72          return torque;
73      }
74  }