BowlerKernel
PidRotoryLink.java
Go to the documentation of this file.
1 package com.neuronrobotics.sdk.addons.kinematics;
2 
3 import com.neuronrobotics.sdk.pid.IPIDEventListener;
4 import com.neuronrobotics.sdk.pid.PIDChannel;
5 import com.neuronrobotics.sdk.pid.PIDEvent;
6 import com.neuronrobotics.sdk.pid.PIDLimitEvent;
7 
8 // TODO: Auto-generated Javadoc
12 public class PidRotoryLink extends AbstractRotoryLink{
13 
16 
25  super(conf);
26  if(!b) {
27  conf.setPauseEvents(true);
28  conf.setDeviceTheoreticalMax(Integer.MAX_VALUE);
29  conf.setDeviceTheoreticalMin(Integer.MIN_VALUE);
30  conf.setPauseEvents(false);
31  }else {
32 // conf.setDeviceTheoreticalMax(conf.getUpperLimit());
33 // conf.setDeviceTheoreticalMin(conf.getLowerLimit());
34  }
35  setPIDChannel(c);
36  }
37 
38  /* (non-Javadoc)
39  * @see com.neuronrobotics.sdk.addons.kinematics.AbstractLink#cacheTargetValueDevice()
40  */
41  @Override
42  public void cacheTargetValueDevice() {
44  }
45 
46  /* (non-Javadoc)
47  * @see com.neuronrobotics.sdk.addons.kinematics.AbstractLink#flush(double)
48  */
49  @Override
50  public void flushDevice(double time) {
51  channel.flush(time);
53  }
54 
55  /* (non-Javadoc)
56  * @see com.neuronrobotics.sdk.addons.kinematics.AbstractLink#flushAll(double)
57  */
58  @Override
59  public void flushAllDevice(double time) {
62  }
63 
64  /* (non-Javadoc)
65  * @see com.neuronrobotics.sdk.addons.kinematics.AbstractLink#getCurrentPosition()
66  */
67  @Override
68  public double getCurrentPosition() {
69  float val=channel.GetPIDPosition();
70 
71  return val;
72  }
73 
81  @Override
82  public void onPIDReset(int group, float currentValue) {
83  fireLinkListener(currentValue);
84  }
85 
86  @Override
87  public void onPIDLimitEvent(PIDLimitEvent e) {
89  }
90 
91  @Override
92  public void onPIDEvent(PIDEvent e) {
93  //Log.debug("\nRotory Link Async<<"+e);
95  }
96  });
97  this.channel = channel;
98  }
99 
106  return channel;
107  }
108 
109 }
void setCachedTargetValue(float targetValue)
void addPIDEventListener(IPIDEventListener l)