Skip to content

Instantly share code, notes, and snippets.

@madhephaestus
Last active January 9, 2021 22:14
Show Gist options
  • Save madhephaestus/e4b0d8e95d6b3dc83c334a9950753a53 to your computer and use it in GitHub Desktop.
Save madhephaestus/e4b0d8e95d6b3dc83c334a9950753a53 to your computer and use it in GitHub Desktop.
jabber.groovy
/.project
/.classpath
/cache/
/*.class/.project
/.classpath
/.cproject
/cache/
/*.class
//Your code here
import org.apache.commons.io.IOUtils;
import com.neuronrobotics.bowlerstudio.physics.*;
import com.neuronrobotics.bowlerstudio.scripting.ScriptingEngine
import com.neuronrobotics.bowlerstudio.threed.*;
import com.neuronrobotics.sdk.addons.kinematics.DHLink
import com.neuronrobotics.sdk.addons.kinematics.DHParameterKinematics
import com.neuronrobotics.sdk.addons.kinematics.MobileBase
import com.neuronrobotics.sdk.common.DeviceManager
import com.neuronrobotics.sdk.util.ThreadUtil
MobileBase base;
//Check if the device already exists in the device Manager
if(args==null){
base=DeviceManager.getSpecificDevice( "HephaestusArmV2",{ScriptingEngine.gitScriptRun( "https://github.com/Hephaestus-Arm/HephaestusArm2.git",
"hephaestus.xml", null )})
}else
base=args.get(0)
DHParameterKinematics leg0 = base.getAllDHChains().get(0)
DHParameterKinematics jaw = leg0.getDhLink(2).getSlaveMobileBase().getAllDHChains().get(0)
println "Now move just one link"
for(int i=0;i<leg0.getNumberOfLinks();i++){
jaw.setDesiredJointAxisValue(0,// link index
35, //target angle
2.0) // 2 seconds
leg0.setDesiredJointAxisValue(i,// link index
15, //target angle
2.0) // 2 seconds
ThreadUtil.wait(200)// wait for the link to fully arrive
leg0.setDesiredJointAxisValue(i,// link index
0, //target angle
2.0) // 2 seconds
jaw.setDesiredJointAxisValue(0,// link index
0, //target angle
2.0) // 2 seconds
ThreadUtil.wait(200)// wait for the link to fully arrive
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment