1 package com.neuronrobotics.sdk.addons.kinematics;
3 import java.io.InputStream;
4 import java.sql.Timestamp;
5 import java.util.ArrayList;
9 import org.w3c.dom.Document;
10 import org.w3c.dom.Element;
11 import org.w3c.dom.Node;
12 import org.w3c.dom.NodeList;
16 import com.neuronrobotics.sdk.addons.kinematics.imu.IMU;
17 import com.neuronrobotics.sdk.addons.kinematics.math.RotationNR;
18 import com.neuronrobotics.sdk.addons.kinematics.math.TransformNR;
19 import com.neuronrobotics.sdk.addons.kinematics.xml.XmlFactory;
20 import com.neuronrobotics.sdk.common.BowlerAbstractDevice;
21 import com.neuronrobotics.sdk.common.BowlerDatagram;
22 import com.neuronrobotics.sdk.common.IDeviceConnectionEventListener;
23 import com.neuronrobotics.sdk.common.InvalidConnectionException;
25 import com.neuronrobotics.sdk.common.Log;
26 import com.neuronrobotics.sdk.common.NonBowlerDevice;
27 import com.neuronrobotics.sdk.common.TickToc;
28 import com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace;
29 import com.neuronrobotics.sdk.pid.IPIDEventListener;
30 import com.neuronrobotics.sdk.pid.InterpolationEngine;
31 import com.neuronrobotics.sdk.pid.InterpolationType;
32 import com.neuronrobotics.sdk.pid.PIDChannel;
34 import com.neuronrobotics.sdk.pid.PIDConfiguration;
35 import com.neuronrobotics.sdk.pid.PIDEvent;
36 import com.neuronrobotics.sdk.pid.PIDLimitEvent;
37 import com.neuronrobotics.sdk.util.ThreadUtil;
46 @SuppressWarnings(
"restriction")
52 private ArrayList<PIDConfiguration> pidConfigurations =
new ArrayList<PIDConfiguration>();
55 private ArrayList<ITaskSpaceUpdateListenerNR> taskSpaceUpdateListeners =
new ArrayList<ITaskSpaceUpdateListenerNR>();
58 protected ArrayList<IJointSpaceUpdateListenerNR> jointSpaceUpdateListeners =
new ArrayList<IJointSpaceUpdateListenerNR>();
61 private ArrayList<IRegistrationListenerNR> regListeners =
new ArrayList<IRegistrationListenerNR>();
64 private ArrayList<MobileBase> mobileBases =
new ArrayList<MobileBase>();
67 private String[] dhEngine =
new String[] {
"https://github.com/madhephaestus/carl-the-hexapod.git",
68 "DefaultDhSolver.groovy" };
71 private String[] cadEngine =
new String[] {
"https://github.com/madhephaestus/carl-the-hexapod.git",
72 "ThreeDPrintCad.groovy" };
91 private boolean noFlush =
false;
94 private boolean noXmlConfig =
true;
108 private int retryNumberBeforeFail = 5;
115 private Runnable renderWrangler=
null;
132 this.root = listener;
157 ArrayList<String> back =
new ArrayList<String>();
158 back.add(
"bcs.cartesian.*");
168 getFactory().removeLinkListener(
this);
170 if (getFactory().getPid(lf) !=
null)
171 getFactory().getPid(lf).removePIDEventListener(
this);
182 return connectDevice();
198 setDhParametersChain(
new DHChain(
this));
209 if(configFile==
null||f==
null)
212 NodeList nodListofLinks = doc.getElementsByTagName(
"appendage");
213 for (
int i = 0; i < 1; i++) {
214 Node linkNode = nodListofLinks.item(i);
215 if (linkNode.getNodeType() == Node.ELEMENT_NODE) {
217 if (configFile !=
null && f !=
null) {
218 setDevice(f, loadConfig((Element) linkNode));
237 if (doc !=
null && f !=
null) {
238 setDevice(f, loadConfig(doc));
249 Timestamp t =
new Timestamp(System.currentTimeMillis());
250 return t.toString().split(
"\\ ")[0];
260 protected ArrayList<LinkConfiguration>
loadConfig(Element doc) {
261 ArrayList<LinkConfiguration> localConfigsFromXml =
new ArrayList<LinkConfiguration>();
263 NodeList nodListofLinks = doc.getChildNodes();
264 setGitCadEngine(getGitCodes(doc,
"cadEngine"));
265 setGitDhEngine(getGitCodes(doc,
"kinematics"));
266 for (
int i = 0; i < nodListofLinks.getLength(); i++) {
267 Node linkNode = nodListofLinks.item(i);
269 if (linkNode.getNodeType() == Node.ELEMENT_NODE && linkNode.getNodeName().contentEquals(
"link")) {
271 localConfigsFromXml.add(newLinkConf);
273 NodeList dHParameters = linkNode.getChildNodes();
276 for (
int x = 0; x < dHParameters.getLength(); x++) {
277 Node nNode = dHParameters.item(x);
278 if (nNode.getNodeType() == Node.ELEMENT_NODE && nNode.getNodeName().contentEquals(
"DHParameters")) {
279 Element dhNode = (Element) nNode;
281 getDhParametersChain().addLink(newLink);
282 NodeList mobileBasesNodeList = dhNode.getChildNodes();
283 for (
int j = 0; j < mobileBasesNodeList.getLength(); j++) {
284 Node mb = mobileBasesNodeList.item(j);
285 if (mb.getNodeType() == Node.ELEMENT_NODE && mb.getNodeName().contentEquals(
"mobilebase")) {
287 mobileBases.add(newMobileBase);
293 mobileBases.remove(newMobileBase);
303 if (nNode.getNodeType() == Node.ELEMENT_NODE
304 && nNode.getNodeName().contentEquals(
"slaveLink")) {
312 }
else if (linkNode.getNodeType() == Node.ELEMENT_NODE && linkNode.getNodeName().contentEquals(
"name")) {
315 }
catch (Exception E) {
318 }
else if (linkNode.getNodeType() == Node.ELEMENT_NODE
319 && linkNode.getNodeName().contentEquals(
"ZframeToRAS")) {
320 Element eElement = (Element) linkNode;
330 }
catch (Exception ex) {
331 ex.printStackTrace();
334 }
else if (linkNode.getNodeType() == Node.ELEMENT_NODE
335 && linkNode.getNodeName().contentEquals(
"baseToZframe")) {
336 Element eElement = (Element) linkNode;
345 }
catch (Exception ex) {
346 ex.printStackTrace();
355 return localConfigsFromXml;
368 String xml =
"<root>\n";
369 xml +=
"\n<appendage>";
370 xml +=
"\n<name>" + getScriptingName() +
"</name>\n";
371 for (
int i = 0; i < getLinkConfigurations().size(); i++) {
373 xml += getLinkConfiguration(i).getXml();
374 xml +=
"\n</link>\n";
376 xml +=
"\n<ZframeToRAS>\n";
377 xml += getFiducialToGlobalTransform().getXml();
378 xml +=
"\n</ZframeToRAS>\n";
380 xml +=
"\n<baseToZframe>\n";
381 xml += getRobotToFiducialTransform().getXml();
382 xml +=
"\n</baseToZframe>\n";
383 xml +=
"\n</appendage>";
395 return getLinkConfigurations().get(linkIndex);
405 return getFactory().getLinkConfigurations();
416 return getAxisPidConfiguration().get(chan);
426 getAxisPidConfiguration().set(chan, c);
445 return getFactory().getLink(getLinkConfiguration(index));
455 Log.
info(
"Loading device: " + f.getClass() +
" " + f);
458 for (
int i = 0; i < linkConfigs.size(); i++) {
461 getFactory().getLink(c);
462 Log.
info(
"\nAxis #" + i +
" Configuration:\n" + c);
479 Log.
info(
"\nAxis #" + i +
" " + tmpConf);
480 getAxisPidConfiguration().add(tmpConf);
484 }
catch (Exception ex) {
485 Log.
error(
"Configuration #" + i +
" failed!!");
486 ex.printStackTrace();
491 getCurrentTaskSpaceTransform();
492 getFactory().addLinkListener(
this);
493 getDhParametersChain().setFactory(getFactory());
496 while (getDhParametersChain().getLinks().size() < linkConfigs.size()) {
497 getDhParametersChain().addLink(
new DHLink(0, 0, 0, 0));
507 return getLinkConfigurations().size();
517 TransformNR fwd = forwardKinematics(getCurrentJointSpaceVector());
519 throw new RuntimeException(
"Implementations of the kinematics need to return a transform not null");
521 TransformNR taskSpaceTransform = forwardOffset(fwd);
523 return taskSpaceTransform;
526 return getFactory().getLink(getLinkConfiguration(index)).getCurrentEngineeringUnits();
529 return getFactory().getLink(getLinkConfiguration(index)).getTargetEngineeringUnits();
538 double[] jointSpaceVect =
new double[getNumberOfLinks()];
539 for (
int i = 0; i < getNumberOfLinks(); i++) {
544 jointSpaceVect[i] = readLinkValue(i);
545 }
catch(Exception e) {
550 return jointSpaceVect;
555 double[] currentJointSpaceTarget=
new double[getNumberOfLinks()];
556 for(
int i=0;i<currentJointSpaceTarget.length;i++) {
557 currentJointSpaceTarget[i]=readLinkTarget(i);
559 return currentJointSpaceTarget;
562 return getFactory().getLink(getLinkConfiguration(linkIndex)).getCurrentEngineeringUnits();
575 TickToc.
tic(
"setDesiredTaskSpaceTransform start");
576 Log.
info(
"Setting target pose: " + taskSpaceTransform);
577 setCurrentPoseTarget(taskSpaceTransform);
579 TransformNR inverseOffset = inverseOffset(taskSpaceTransform);
581 double[] jointSpaceVect = inverseKinematics(inverseOffset);
583 if(checkVector(
this,jointSpaceVect,seconds)) {
585 if (jointSpaceVect ==
null)
586 throw new RuntimeException(
"The kinematics model must return an array, not null");
588 _setDesiredJointSpaceVector(jointSpaceVect, seconds,
false);
589 TickToc.
tic(
"_setDesiredJointSpaceVector complete");
590 return jointSpaceVect;
594 double[] currentJointSpaceTarget2 = getCurrentJointSpaceTarget();
596 return currentJointSpaceTarget2;
608 return checkVector(dev, jointSpaceVect,seconds);
609 }
catch (Throwable ex) {
622 return checkTaskSpaceTransform(dev,taskSpaceTransform,0);
626 for (
int i = 0; i < jointSpaceVect.length; i++) {
628 double val = jointSpaceVect[i];
629 Double double1 =
new Double(val);
630 if(double1.isNaN() ||double1.isInfinite() ) {
644 double deltaPosition = Math.abs(current[i] - jointSpaceVect[i]);
645 double computedVelocity = deltaPosition/seconds;
646 if((computedVelocity-maxVel)>0.0001) {
647 Log.
error(
"Link "+i+
" can not move at rate of "+computedVelocity+
" capped at "+maxVel+
" requested position of "+jointSpaceVect[i]+
" from current position of "+current[i]+
" in "+seconds+
" seconds");
671 return checkTaskSpaceTransform(
this, taskSpaceTransform,0);
681 double[] jointSpaceVect;
684 jointSpaceVect = inverseKinematics(inverseOffset(currentTaskSpaceTransform));
685 best = getBestTime(jointSpaceVect);
686 }
catch (Exception e) {
699 double[] current = getCurrentJointSpaceTarget();
700 for (
int i = 0; i < current.length; i++) {
703 double deltaPosition = Math.abs(current[i] - jointSpaceVect[i]);
704 double seconds = deltaPosition / maxVel;
706 best = seconds + Double.MIN_VALUE;
722 return _setDesiredJointSpaceVector(jointSpaceVect,seconds,
true);
734 if (jointSpaceVect.length != getNumberOfLinks()) {
735 throw new IndexOutOfBoundsException(
"Vector must be " + getNumberOfLinks()
736 +
" links, actual number of links = " + jointSpaceVect.length);
749 factory.
flush(seconds);
750 TickToc.
tic(
"_setDesiredJointSpaceVector flush "+seconds);
755 }
catch (Exception ex) {
760 }
while (except > 0 && except < getRetryNumberBeforeFail());
762 throw new RuntimeException(
"Limit On "+getScriptingName()+
" "+e.getMessage());
765 TransformNR fwd = forwardKinematics(getCurrentJointSpaceTarget());
767 fireTargetJointsUpdate(getCurrentJointSpaceTarget(), fwd);
770 setCurrentPoseTarget(forwardOffset(fwd));
775 return jointSpaceVect;
784 return forwardOffset(forwardKinematics(jointSpaceVect));
793 double homevect[] =
new double[getNumberOfLinks()];
794 for (
int i = 0; i < homevect.length; i++) {
797 return forwardOffset(forwardKinematics(homevect));
813 Log.
info(
"Setting single target joint in mm/deg, axis=" + axis +
" value=" + value);
815 getFactory().getLink(c).setTargetEngineeringUnits(value);
816 }
catch (Exception ex) {
817 throw new Exception(
"Joint hit software bound, index " + axis +
" attempted: " + value +
" boundes: U="
825 getFactory().getLink(c).flush(seconds);
828 }
catch (Exception ex) {
832 }
while (except > 0 && except < getRetryNumberBeforeFail());
836 TransformNR fwd = forwardKinematics(getCurrentJointSpaceTarget());
837 fireTargetJointsUpdate(getCurrentJointSpaceTarget(), fwd);
838 setCurrentPoseTarget(forwardOffset(fwd));
849 for (
int i = 0; i < taskSpaceUpdateListeners.size(); i++) {
860 firePoseTransform(getCurrentTaskSpaceTransform());
862 double[] vect = getCurrentJointSpaceVector();
864 for (
int i = 0; i < jointSpaceUpdateListeners.size(); i++) {
880 p.onJointSpaceTargetUpdate(
this, getCurrentJointSpaceTarget());
892 p.onJointSpaceLimit(
this, axis, event);
915 if (baseToFiducial ==
null) {
916 Log.
error(
"Fiducial can not be null " + baseToFiducial);
917 new Exception().printStackTrace(System.out);
920 Log.
info(
"Setting Fiducial To base Transform " + baseToFiducial);
921 this.base2Fiducial = baseToFiducial;
923 r.onBaseToFiducialUpdate(
this, baseToFiducial);
944 return base2Fiducial;
953 if (frameToBase ==
null) {
954 Log.
error(
"Fiducial can not be null " + frameToBase);
955 new Exception(
"Fiducial can not be null ").printStackTrace(System.out);
958 this.fiducial2RAS = frameToBase;
961 for (
int i = 0; i < regListeners.size(); i++) {
975 setGlobalToFiducialTransform(frameToBase,
true);
987 Matrix globalToFeducialInverse = getFiducialToGlobalTransform().
getMatrixTransform().inverse();
988 Matrix feducialToLimbInverse = getRobotToFiducialTransform().getMatrixTransform().inverse();
991 Matrix limbSpaceTarget = feducialToLimbInverse.times(globalToFeducialInverse).times(NewGlobalSpaceTarget);
1004 Matrix globaltoFeducial = getFiducialToGlobalTransform().getMatrixTransform();
1006 Matrix mForward = globaltoFeducial.times(feducialToLimb).times(fkOfLimb);
1016 if (jointSpaceUpdateListeners.contains(l) || l ==
null)
1018 jointSpaceUpdateListeners.add(l);
1027 if (jointSpaceUpdateListeners.contains(l))
1028 jointSpaceUpdateListeners.remove(l);
1037 if (regListeners.contains(l) || l ==
null)
1039 regListeners.add(l);
1049 if (regListeners.contains(l))
1050 regListeners.remove(l);
1059 if (taskSpaceUpdateListeners.contains(l) || l ==
null) {
1063 taskSpaceUpdateListeners.add(l);
1072 if (taskSpaceUpdateListeners.contains(l)) {
1074 taskSpaceUpdateListeners.remove(l);
1089 if (tmp == source) {
1106 Log.
error(
"Got UKNOWN PID event " + source);
1131 for (
int i = 0; i < getNumberOfLinks(); i++) {
1132 if (getLinkConfiguration(i).getHardwareIndex() == e.
getGroup())
1133 fireJointSpaceLimitUpdate(i,
new JointLimit(i, e, getLinkConfiguration(i)));
1152 for (
int i = 0; i < getNumberOfLinks(); i++) {
1176 public void onPIDReset(
int group,
float currentValue) {
1182 Log.
debug(
"Homing PID Limit event " + e);
1186 public void onPIDEvent(
PIDEvent e) {
1187 homeTime = System.currentTimeMillis();
1191 homeTime = System.currentTimeMillis();
1194 Log.
info(
"Homing output to value: " + tps);
1195 while ((System.currentTimeMillis() < homeTime + 3000)) {
1207 if (link < 0 || link >= getNumberOfLinks()) {
1208 throw new IndexOutOfBoundsException(
1209 "There are only " + getNumberOfLinks() +
" known links, requested:" + link);
1213 getFactory().getPid(conf).removePIDEventListener(
this);
1228 runHome(joint, (
int) (range));
1236 runHome(joint, (
int) (range * -1));
1244 setDesiredJointAxisValue(link, 0, 0);
1245 }
catch (Exception e) {
1246 e.printStackTrace();
1248 getFactory().getPid(conf).addPIDEventListener(
this);
1250 getFactory().getLink(getLinkConfiguration(link)).Home();
1251 getFactory().flush(1000);
1260 if (getFactory().getPid(lf) !=
null)
1261 getFactory().getPid(lf).killAllPidGroups();
1274 return pidConfigurations;
1300 if (currentPoseTarget ==
null)
1301 currentPoseTarget = calcHome();
1302 return currentPoseTarget;
1311 this.currentPoseTarget = currentPoseTarget;
1313 p.onTargetTaskSpaceUpdate(
this, currentPoseTarget);
1323 this.factory = factory;
1332 if (factory ==
null)
1343 this.noFlush = noFlush;
1361 return retryNumberBeforeFail;
1370 this.retryNumberBeforeFail = retryNumberBeforeFail;
1382 for (
int i = 0; i < getNumberOfLinks(); i++) {
1395 return dhParametersChain;
1404 this.dhParametersChain = dhParametersChain;
1422 if (dhEngine !=
null && dhEngine[0] !=
null && dhEngine[1] !=
null)
1423 this.dhEngine = dhEngine;
1441 if (cadEngine !=
null && cadEngine[0] !=
null && cadEngine[1] !=
null)
1442 this.cadEngine = cadEngine;
1454 NodeList nodListofLinks = e.getChildNodes();
1456 for (
int i = 0; i < nodListofLinks.getLength(); i++) {
1457 Node linkNode = nodListofLinks.item(i);
1458 if (linkNode.getNodeType() == Node.ELEMENT_NODE && linkNode.getNodeName().contentEquals(tag)) {
1462 }
catch (Exception ex) {
1463 ex.printStackTrace();
1465 throw new RuntimeException(
"No tag " + tag +
" found");
1476 String[] content =
new String[3];
1478 NodeList nodListofLinks = doc.getChildNodes();
1479 for (
int i = 0; i < nodListofLinks.getLength(); i++) {
1480 Node linkNode = nodListofLinks.item(i);
1481 if (linkNode.getNodeType() == Node.ELEMENT_NODE && linkNode.getNodeName().contentEquals(tag)) {
1482 Element e = (Element) linkNode;
1484 if (getCode(e,
"gist") !=
null)
1485 content[0] =
"https://gist.github.com/" + getCode(e,
"gist") +
".git";
1486 }
catch (Exception ex) {
1490 if (getCode(e,
"git") !=
null)
1491 content[0] = getCode(e,
"git");
1492 }
catch (Exception ex) {
1496 if (getCode(e,
"parallelGroup") !=
null)
1497 content[2] = getCode(e,
"parallelGroup");
1498 }
catch (Exception ex) {
1501 content[1] = getCode(e,
"file");
1505 }
catch (Exception e) {
1506 e.printStackTrace();
1518 value = boundToLinkLimits(index, value);
1519 double[] vect = getCurrentJointSpaceVector();
1520 vect[index] = value;
1521 setDesiredJointSpaceVector(vect, 0);
1536 return getLinkConfiguration(linkIndex).getMassKg();
1545 return getAbstractLink(linkIndex).getMaxEngineeringUnits();
1555 return getAbstractLink(linkIndex).getMinEngineeringUnits();
1564 getAbstractLink(linkIndex).setMaxEngineeringUnits(maxLimit);
1574 getAbstractLink(linkIndex).setMinEngineeringUnits(minLimit);
1577 return getLinkConfiguration(linkIndex).getElectroMechanicalType() ;
1581 getLinkConfiguration(linkIndex).setElectroMechanicalType(electroMechanicalType);
1585 return getLinkConfiguration(linkIndex).getElectroMechanicalSize() ;
1589 getLinkConfiguration(linkIndex).setElectroMechanicalSize(electroMechanicalSize);
1593 return getLinkConfiguration(linkIndex).getShaftType();
1597 getLinkConfiguration(linkIndex).setShaftType(shaftType);
1601 return getLinkConfiguration(linkIndex).getShaftSize();
1607 getLinkConfiguration(linkIndex).setDeviceTheoreticalMax(max);
1614 getLinkConfiguration(linkIndex).setDeviceTheoreticalMin(min);
1621 return getLinkConfiguration(linkIndex).getDeviceTheoreticalMax();
1628 return getLinkConfiguration(linkIndex).getDeviceTheoreticalMin();
1631 getLinkConfiguration(linkIndex).addChangeListener(l);
1634 getLinkConfiguration(linkIndex).removeChangeListener(l);
1637 getLinkConfiguration(linkIndex).clearChangeListener();
1644 if(renderWrangler!=
null)
1646 renderWrangler.run();
1647 }
catch(Throwable t) {
1648 t.printStackTrace();
1653 this.renderWrangler = renderWrangler;
1657 TransformNR startingPoint = getCurrentPoseTarget();
1663 return startingPoint.
times(deltaToTarget.
scale(unitIncrement));
1670 }
catch(Throwable t) {
1671 t.printStackTrace();
1680 long currentTimeMillis = System.currentTimeMillis();
1682 TransformNR startingPoint = getCurrentPoseTarget();
1683 if (checkTaskSpaceTransform(target)) {
1684 if (!checkTaskSpaceTransform(target, seconds)) {
1686 double bestTime = getBestTime(target);
1688 if (bestTime > seconds) {
1694 double ms = seconds * 1000;
1695 double msPerStep = 10;
1696 double steps = ms / msPerStep;
1697 double unitIncrement = 1.0 / steps;
1699 for (
double i = 0; i < (1 + unitIncrement); i += unitIncrement) {
1707 double bestTime = getBestTime(nextPoint);
1709 if (bestTime > msPerStep / 1000.0) {
1713 if (checkTaskSpaceTransform(nextPoint, bestTime)) {
1716 setDesiredTaskSpaceTransform(nextPoint, bestTime);
1717 }
catch (Exception e) {
double getMinEngineeringUnits(int linkIndex)
void disconnectDeviceImp()
String[] getGitCodes(Element doc, String tag)
static boolean checkTaskSpaceTransform(AbstractKinematicsNR dev, TransformNR taskSpaceTransform, double seconds)
AbstractLink getAbstractLink(int index)
void setCurrentPoseTarget(TransformNR currentPoseTarget)
double readLinkTarget(int index)
TransformNR getFiducialToGlobalTransform()
void onPIDReset(int group, float currentValue)
InterpolationMoveState blockingInterpolatedMove(TransformNR target, double seconds, InterpolationType type, double ...conf)
void setGlobalToFiducialTransform(TransformNR frameToBase)
AbstractKinematicsNR(Element doc, LinkFactory f)
double getDeviceMinimumValue(int linkIndex)
String getShaftType(int linkIndex)
ArrayList< LinkConfiguration > getLinkConfigurations()
void addChangeListener(int linkIndex, ILinkConfigurationChangeListener l)
ArrayList< PIDConfiguration > getAxisPidConfiguration()
LinkConfiguration getLinkConfiguration(int linkIndex)
void addJointSpaceListener(IJointSpaceUpdateListenerNR l)
void addRegistrationListener(IRegistrationListenerNR l)
TransformNR getCurrentPoseTarget()
String getElectroMechanicalSize(int linkIndex)
void setElectroMechanicalType(int linkIndex, String electroMechanicalType)
void removeRegestrationUpdateListener(IRegistrationListenerNR l)
void setShaftType(int linkIndex, String shaftType)
abstract TransformNR forwardKinematics(double[] jointSpaceVector)
void removePoseUpdateListener(ITaskSpaceUpdateListenerNR l)
double[] getCurrentJointSpaceVector()
double[] getCurrentJointSpaceTarget()
void setLinkCurrentConfiguration(int chan, PIDConfiguration c)
void onLinkPositionUpdate(AbstractLink source, double engineeringUnitsValue)
boolean checkTaskSpaceTransform(TransformNR taskSpaceTransform, double seconds)
TransformNR getRobotToFiducialTransform()
double getCurrentLinkEngineeringUnits(int linkIndex)
double readLinkValue(int index)
void setDeviceMinimumValue(int linkIndex, double min)
void onPIDEvent(PIDEvent e)
PIDConfiguration getLinkCurrentConfiguration(int chan)
void setGlobalToFiducialTransform(TransformNR frameToBase, boolean fireUpdate)
AbstractKinematicsNR(InputStream configFile, LinkFactory f)
void fireTargetJointsUpdate(double[] jointSpaceVector, TransformNR fwd)
String getElectroMechanicalType(int linkIndex)
double getMaxEngineeringUnits(int linkIndex)
void setNoFlush(boolean noFlush)
void setRenderWrangler(Runnable renderWrangler)
void runHome(PIDChannel joint, int tps)
String[] getGitDhEngine()
double getBestTime(double[] jointSpaceVect)
abstract void disconnectDevice()
void setElectroMechanicalSize(int linkIndex, String electroMechanicalSize)
void setFactory(LinkFactory factory)
void setGitCadEngine(String[] cadEngine)
DHChain getDhParametersChain()
double[] _setDesiredJointSpaceVector(double[] jointSpaceVect, double seconds, boolean fireTaskUpdate)
void setRootListener(Object listener)
void onLinkLimit(AbstractLink arg0, PIDLimitEvent arg1)
double getBestTime(TransformNR currentTaskSpaceTransform)
void asyncInterpolatedMove(TransformNR target, double seconds, InterpolationType type, IOnInterpolationDone listener, double ...conf)
void setDesiredJointAxisValue(int axis, double value, double seconds)
void setMaxEngineeringUnits(int linkIndex, double maxLimit)
boolean connectDeviceImp()
void clearChangeListener(int linkIndex)
void setDeviceMaximumValue(int linkIndex, double max)
String getShaftSize(int linkIndex)
void setDevice(LinkFactory f, ArrayList< LinkConfiguration > linkConfigs)
void setDhParametersChain(DHChain dhParametersChain)
ArrayList< LinkConfiguration > loadConfig(Element doc)
static boolean checkVector(AbstractKinematicsNR dev, double[] jointSpaceVect, double seconds)
TransformNR getTipAlongTrajectory(TransformNR startingPoint, TransformNR deltaToTarget, double unitIncrement)
void boundedLinkValueSet(int index, double value)
double getDeviceMaximumValue(int linkIndex)
void removeJointSpaceUpdateListener(IJointSpaceUpdateListenerNR l)
double linkMass(int linkIndex)
void setRobotToFiducialTransform(TransformNR baseToFiducial)
double[] setDesiredJointSpaceVector(double[] jointSpaceVect, double seconds)
TransformNR getCurrentTaskSpaceTransform()
String[] getGitCadEngine()
abstract double[] inverseKinematics(TransformNR taskSpaceTransform)
TransformNR forwardOffset(TransformNR t)
TransformNR inverseOffset(TransformNR t)
ArrayList< String > getNamespacesImp()
TransformNR getDeltaToTarget(TransformNR target)
double boundToLinkLimits(int index, double value)
abstract boolean connectDevice()
TransformNR calcForward(double[] jointSpaceVect)
void onPIDLimitEvent(PIDLimitEvent e)
String getCode(Element e, String tag)
void fireJointSpaceLimitUpdate(int axis, JointLimit event)
void addPoseUpdateListener(ITaskSpaceUpdateListenerNR l)
boolean checkTaskSpaceTransform(TransformNR taskSpaceTransform)
void firePoseTransform(TransformNR transform)
void removeChangeListener(int linkIndex, ILinkConfigurationChangeListener l)
void setRetryNumberBeforeFail(int retryNumberBeforeFail)
void setGitDhEngine(String[] dhEngine)
double[] setDesiredTaskSpaceTransform(TransformNR taskSpaceTransform, double seconds)
int getRetryNumberBeforeFail()
void setMinEngineeringUnits(int linkIndex, double minLimit)
static boolean checkTaskSpaceTransform(AbstractKinematicsNR dev, TransformNR taskSpaceTransform)
double getMinEngineeringUnits()
double getMaxEngineeringUnits()
LinkConfiguration getLinkConfiguration()
double getMaxVelocityEngineeringUnits()
void setMobileBaseXml(MobileBase embedableXml)
ArrayList< LinkConfiguration > getSlaveLinks()
void setLinkIndex(int linkIndex)
AbstractLink getLink(String name)
void flush(final double seconds)
void setCachedTargets(double[] jointSpaceVect)
static String getTagValue(String sTag, Element eElement)
static Document getAllNodesDocument(InputStream config)
String getScriptingName()
static void info(String message)
static void error(String message)
static void debug(String message)
static void tic(String message)
void setSetpointWithTime(long startTimeMs, double setpoint, double seconds, InterpolationType mode, double ...conf)
double getInterpolationUnitIncrement(long time)
boolean SetPIDSetPoint(float setpoint, double seconds)
void removePIDEventListener(IPIDEventListener l)
void addPIDEventListener(IPIDEventListener l)
boolean ConfigurePIDController(PIDConfiguration config)
IPidControlNamespace getPid()
void setInverted(boolean inverted)
void setAsync(boolean async)
void setUseLatch(boolean useLatch)
void setIndexLatch(double latch)
void setEnabled(boolean enabled)
void setStopOnIndex(boolean stopOnIndex)
static void wait(int time)
void onJointSpaceUpdate(AbstractKinematicsNR source, double[] joints)
void done(InterpolationMoveState state)
void onBaseToFiducialUpdate(AbstractKinematicsNR source, TransformNR regestration)
void onFiducialToGlobalUpdate(AbstractKinematicsNR source, TransformNR regestration)
void onTaskSpaceUpdate(AbstractKinematicsNR source, TransformNR pose)
boolean ConfigurePIDController(PIDConfiguration config)
PIDChannel getPIDChannel(int group)
void addPIDEventListener(IPIDEventListener l)
PIDConfiguration getPIDConfiguration(int group)