Skip to content

Commit c14db70

Browse files
committed
adding return statement
1 parent 9540be6 commit c14db70

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

FullHardwareLaunch.groovy

+9-10
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,12 @@ public class PhysicicsDevice extends NonBowlerDevice{
8989
def hidEventEngine;
9090
def physicsSource ;
9191
int count = 0;
92-
Closure event = {
92+
Runnable run={
9393

9494

9595
count ++
9696
if(count >10){
9797
count =0
98-
//Get the DHChain object
99-
DHChain chain = physicsSource.getChain()
10098
// Setup of variables done, next perfoem one compute cycle
10199

102100
//get the current FK pose to update the data used by the jacobian computation
@@ -106,36 +104,37 @@ public class PhysicicsDevice extends NonBowlerDevice{
106104
// get the position of all the joints in engineering units
107105
double[] jointSpaceVector = physicsSource.getCurrentJointSpaceVector()
108106
// compute the Jacobian using Jama matrix library
109-
Matrix jacobian = physicsSource.getJacobian(chain,jointSpaceVector,jointSpaceVector.length-1);
107+
Matrix jacobian = physicsSource.getJacobian();
110108
Matrix[] massMatrix = new Matrix[jointSpaceVector.length]
111109
Matrix[] incrementalJacobian = new Matrix[jointSpaceVector.length]
112110
double [] masses = new double [jointSpaceVector.length]
113111
//TODO LoadMasses and mass Matrix here
114112

115113
for (int i=0;i<jointSpaceVector.length;i++){
116-
incrementalJacobian[i] = getJacobian(chain,jointSpaceVector,i);
114+
incrementalJacobian[i] = physicsSource.getJacobian(jointSpaceVector,i);
117115

118-
println "Increment "+i+" "+ TransformNR.getMatrixString(incrementalJacobian[i])
116+
//println "Increment "+i+" "+ TransformNR.getMatrixString(incrementalJacobian[i])
119117
}
120-
println "Total "+ TransformNR.getMatrixString(jacobian)
118+
//println "Total "+ TransformNR.getMatrixString(jacobian)
121119

122120
}
123121
}
124122
public PhysicicsDevice(def c,def d){
125123
hidEventEngine=c;
126124
physicsSource=d;
127-
hidEventEngine.addEvent(37,event)
125+
hidEventEngine.arm.addEvent(37,run)
128126

129127
}
130128
@Override
131129
public void disconnectDeviceImp(){
132130
println "Physics Termination signel shutdown"
133-
hidEventEngine.removeEvent(37,event)
131+
hidEventEngine.arm.removeEvent(37,run)
134132
}
135133

136134
@Override
137135
public boolean connectDeviceImp(){
138136
println "Physics Startup signel "
137+
return true
139138
}
140139
public ArrayList<String> getNamespacesImp(){
141140
// no namespaces on dummy
@@ -171,7 +170,7 @@ def base =DeviceManager.getSpecificDevice( "HephaestusArm",{
171170
return m
172171
})
173172

174-
return base
173+
//return base
175174

176175
def physics =DeviceManager.getSpecificDevice( "HephaestusPhysics",{
177176
PhysicicsDevice pd = new PhysicicsDevice(dev,base.getAllDHChains().get(0))

0 commit comments

Comments
 (0)