1 package com.neuronrobotics.sdk.addons.kinematics;
3 import java.util.ArrayList;
6 import com.neuronrobotics.sdk.addons.kinematics.gcodebridge.IGcodeExecuter;
7 import com.neuronrobotics.sdk.addons.kinematics.imu.IMU;
8 import com.neuronrobotics.sdk.addons.kinematics.math.TransformNR;
9 import com.neuronrobotics.sdk.common.IFlushable;
10 import com.neuronrobotics.sdk.common.Log;
11 import com.neuronrobotics.sdk.common.TickToc;
12 import com.neuronrobotics.sdk.pid.PIDLimitEvent;
13 import com.neuronrobotics.sdk.pid.PIDLimitEventType;
15 import javafx.scene.transform.Affine;
31 private ArrayList<ILinkListener>
links =
new ArrayList<ILinkListener>();
234 ArrayList<ILinkListener> links2 =
getLinks();
235 for (
int i = 0; i < links2.size(); i++) {
240 }
catch( Throwable t) {
241 t.printStackTrace(System.out);
254 l.onLinkLimit(
this, e);
282 if(
new Double(pos).isNaN()) {
283 new RuntimeException(
"Setpopint in setTargetEngineeringUnits can not be set to nan").printStackTrace();
311 if(
new Double(link).isNaN())
444 if(
new Double(val).isNaN()) {
445 new RuntimeException(
"Setpopint in virtual device can not be set to nan").printStackTrace();
449 Log.
info(
"Setting cached value :"+val);
450 this.targetValue = val;
464 +
" \nUpper Bound="+ub+
" (engineering units) Device Units="+
getUpperLimit()
465 +
"\nLower Bound="+lb+
" (engineering units) Device Units="+
getLowerLimit();
466 if(flip?belowLower:aboveUpper){
479 System.currentTimeMillis()
482 if(
isUseLimits())
throw new RuntimeException(
"Joint hit Upper software bound\n"+execpt);
484 if(flip?aboveUpper:belowLower) {
497 System.currentTimeMillis()
500 if(
isUseLimits())
throw new RuntimeException(
"Joint hit Lower software bound\n"+execpt);
503 Log.
info(
"Abstract Link: limits disabled");
670 this.linksLocation = Object;
double getCurrentEngineeringUnits()
void setUpperLimit(int upperLimit)
double getDeviceMinimumValue()
void setTargetValue(double val)
abstract void cacheTargetValueDevice()
void flushAll(double time)
void addChangeListener(ILinkConfigurationChangeListener l)
void setLinkConfiguration(LinkConfiguration conf)
void setUseLimits(boolean useLimits)
void clearChangeListener()
double getDeviceMaximumValue()
void setCurrentEngineeringUnits(double angle)
abstract double getCurrentPosition()
void setSlaveFactory(LinkFactory slaveFactory)
ArrayList< LinkConfiguration > slaveLinks
ArrayList< ILinkListener > getLinks()
void setLowerLimit(int lowerLimit)
double getDeviceMaxEngineeringUnits()
void removeAllLinkListener()
void setMaxEngineeringUnits(double maxLimit)
double toEngineeringUnits(double value)
abstract void flushDevice(double time)
double getMinEngineeringUnits()
AbstractLink(LinkConfiguration conf)
double toLinkUnits(double euValue)
void setMaxVelocityEngineeringUnits(double max)
void setMinEngineeringUnits(double minLimit)
double getMaxEngineeringUnits()
void setDeviceMaximumValue(double max)
LinkFactory getSlaveFactory()
void setCurrentAsLowerLimit()
void setDeviceMinimumValue(double min)
void setGlobalPositionListener(Object Object)
double getTargetEngineeringUnits()
void addLinkListener(ILinkListener l)
void incrementEngineeringUnits(double inc)
LinkConfiguration getLinkConfiguration()
void removeChangeListener(ILinkConfigurationChangeListener l)
void setLinks(ArrayList< ILinkListener > links)
abstract void flushAllDevice(double time)
void fireLinkListener(double linkUnitsValue)
boolean isMaxEngineeringUnits()
double targetEngineeringUnits
void fireLinkLimitEvent(PIDLimitEvent e)
void setTargetEngineeringUnits(double pos)
void removeLinkListener(ILinkListener l)
double getMaxVelocityEngineeringUnits()
boolean isMinEngineeringUnits()
Object getGlobalPositionListener()
ArrayList< ILinkListener > links
double getDeviceMinEngineeringUnits()
void setCurrentAsUpperLimit()
void setPosition(double val)
double getDeviceTheoreticalMax()
void setUpperLimit(double upperLimit)
void setDeviceTheoreticalMin(double deviceTheoreticalMin)
void addChangeListener(ILinkConfigurationChangeListener l)
double getDeviceTheoreticalMin()
void setScale(double scale)
void setStaticOffset(double staticOffset)
void setUpperVelocity(double upperVelocity)
double getUpperVelocity()
void setLowerLimit(double lowerLimit)
void setDeviceTheoreticalMax(double deviceTheoreticalMax)
void clearChangeListener()
ArrayList< LinkConfiguration > getSlaveLinks()
void removeChangeListener(ILinkConfigurationChangeListener l)
AbstractLink getLink(String name)
static void info(String message)
void onLinkPositionUpdate(AbstractLink source, double engineeringUnitsValue)