Skip to content

Instantly share code, notes, and snippets.

@NotOctogonapus
Forked from madhephaestus/.gitignore
Created December 13, 2018 21:14
Show Gist options
  • Save NotOctogonapus/fa69d0e277ebdd43d186035c26b534b7 to your computer and use it in GitHub Desktop.
Save NotOctogonapus/fa69d0e277ebdd43d186035c26b534b7 to your computer and use it in GitHub Desktop.
Move a limb attached to a MobileBase
import org.apache.commons.io.IOUtils;
import com.neuronrobotics.bowlerstudio.physics.*;
import com.neuronrobotics.bowlerstudio.threed.*;
def base = ScriptingEngine.gitScriptRun(
"https://gist.github.com/NotOctogonapus/c3fc39308a506d4cb1cd7297193c41e7",
"InputArmBase_copy.xml",
null
)
//base.appendages[0].setDesiredTaskSpaceTransform()
println "Now we will move just one leg"
DHParameterKinematics leg0 = base.getAllDHChains().get(0)
println "Move home"
leg0.setDesiredTaskSpaceTransform(leg0.calcHome(), 2.0)
ThreadUtil.wait(5000);
println "Start from where the arm already is and move it from there with absolute location"
TransformNR current = leg0.getCurrentPoseTarget();
current.translateX(10);
leg0.setDesiredTaskSpaceTransform(current, 2.0);
ThreadUtil.wait(50000)// wait for the legs to fully arrive
println "and reset it"
current.translateX(-10);
leg0.setDesiredTaskSpaceTransform(current, 2.0);
ThreadUtil.wait(5000)// wait for the legs to fully arrive
current.translateX(-10);
leg0.setDesiredTaskSpaceTransform(current, 2.0);
ThreadUtil.wait(5000)
println "wait for the legs to fully arrive"
println "and reset it"
current.translateX(10);
leg0.setDesiredTaskSpaceTransform(current, 2.0);
ThreadUtil.wait(2000)
println " wait for the legs to fully arrive"
return null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment