Skip to content

Commit

Permalink
Merge pull request #12 from dyalab/feature/python-tutorial-fixes
Browse files Browse the repository at this point in the history
Feature/python tutorial fixes
  • Loading branch information
ndantam authored May 21, 2021
2 parents 3177ece + f5cf2e9 commit 4eb1661
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 59 deletions.
2 changes: 1 addition & 1 deletion demo/tutorial/python/t0.0-vector.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from amino import DVec

Expand Down
4 changes: 2 additions & 2 deletions demo/tutorial/python/t0.1-matrix.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from amino import DVec, DMat
from amino import DMat


# Helpers to print(headings)
Expand Down
4 changes: 2 additions & 2 deletions demo/tutorial/python/t0.2-lls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from amino import DVec, DMat
from amino import DMat


def h1(name):
Expand Down
4 changes: 2 additions & 2 deletions demo/tutorial/python/t1-rotation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from amino import Vec3, XAngle, YAngle, ZAngle, AxAng, EulerRPY, Quat, RotMat
from math import pi
from amino import Vec3, XAngle, YAngle, AxAng, Quat, RotMat


def h1(name):
Expand Down
4 changes: 2 additions & 2 deletions demo/tutorial/python/t2-tf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from amino import Vec3, XAngle, YAngle, ZAngle, AxAng, EulerRPY, Quat, RotMat, TfMat, DualQuat, QuatTrans
from math import pi
from amino import Vec3, YAngle, ZAngle, TfMat, DualQuat, QuatTrans


def h1(name):
Expand Down
4 changes: 2 additions & 2 deletions demo/tutorial/python/t3.0-scene.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# File: t3-scene.py
# =================
#
# Create a scene with a grid and three boxes. Display the scene in
# the viewer window.

from amino import SceneWin, SceneGraph, Geom, QuatTrans, GeomOpt
from amino import SceneWin, SceneGraph, Geom, QuatTrans

# Create a window
win = SceneWin(start=False)
Expand Down
4 changes: 2 additions & 2 deletions demo/tutorial/python/t3.1-robot.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# File: t3.1-robot.py
# ===================
#
# Procedural construction of a robot scene.

from amino import SceneWin, SceneGraph, Geom, GeomOpt, QuatTrans, Vec3, YAngle, XAngle
from math import pi, cos
from time import sleep
from amino import SceneWin, SceneGraph, Geom, GeomOpt, Vec3, YAngle, XAngle


def draw_robot(sg, parent):
Expand Down
8 changes: 3 additions & 5 deletions demo/tutorial/python/t3.2-scenefile.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# File: t3.2-scenefile.py
# =======================
#
# Load a compiled scene plugin

from amino import SceneWin, SceneGraph
from math import pi, cos
from time import sleep
import os
from amino import SceneWin, SceneGraph

# Scene Parameters
# Change scene_plugin based on your directory structure
scene_plugin = ("%s/git/amino/demo/tutorial/plugin/scenefile/libscene.so" %
os.environ['HOME'])
scene_plugin = ("{}/../plugin/scenefile/libscene.so".format(os.path.dirname(__file__)))
scene_name = "example"

# Create an (empty) scene graph
Expand Down
10 changes: 3 additions & 7 deletions demo/tutorial/python/t3.2-urdf.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# File: t3.2-urdf.py
# ===================
#
# Loading a compiled scene plugin

from amino import SceneWin, SceneGraph, Geom, GeomOpt, QuatTrans, Vec3, YAngle, XAngle
from math import pi, cos
from time import sleep
import os
from amino import SceneWin, SceneGraph, Geom

# Scene Parameters
# Change scene_plugin based on your directory structure
scene_plugin = ("%s/git/amino/demo/tutorial/plugin/urdf/libbaxter-model.so" %
os.environ['HOME'])
scene_plugin = ("{}/../plugin/urdf/libbaxter-model.so".format(os.path.dirname(__file__)))
scene_name = "baxter"

# Create an (empty) scene graph
Expand Down
8 changes: 3 additions & 5 deletions demo/tutorial/python/t4.1-fk.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# File: t4.1-fk.py
# =======================
#
# Compute Forward Kinematics

from amino import SceneWin, SceneGraph, SceneFK
from math import pi, cos
from time import sleep
import os
from amino import SceneWin, SceneGraph, SceneFK

# Scene Parameters
# Change scene_plugin based on your directory structure
scene_plugin = (
"%s/git/amino/demo/tutorial/plugin/7dof/libscene.so" % os.environ['HOME'])
scene_plugin = ("{}/../plugin/7dof/libscene.so".format(os.path.dirname(__file__)))
scene_name = "7dof"

# Create an (empty) scene graph
Expand Down
8 changes: 3 additions & 5 deletions demo/tutorial/python/t4.2-dk.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# File: t4.2-dk.py
# =======================
Expand All @@ -7,15 +7,13 @@
#
# Slide the end-effector forward and backward in the X-direction

from amino import SceneWin, SceneGraph, Geom, SceneFK, SceneDK, TfVel, QuatTrans, Vec3, YAngle
from math import pi, cos, sin
from time import sleep
import os
from amino import SceneWin, SceneGraph, Geom, SceneFK, SceneDK, TfVel, QuatTrans, YAngle

# Scene Parameters
# Change scene_plugin based on your directory structure
scene_plugin = (
"%s/git/amino/demo/tutorial/plugin/7dof/libscene.so" % os.environ['HOME'])
scene_plugin = ("{}/../plugin/7dof/libscene.so".format(os.path.dirname(__file__)))
scene_name = "7dof"

# Create an (empty) scene graph
Expand Down
8 changes: 3 additions & 5 deletions demo/tutorial/python/t4.3-ik.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# File: t4.3-ik.py
# =======================
Expand All @@ -7,15 +7,13 @@
#
# Slide the end-effector forward and backward in the X-direction

from amino import SceneWin, SceneGraph, SceneIK, QuatTrans, YAngle
from math import pi
from time import sleep
import os
from amino import SceneWin, SceneGraph, SceneIK, YAngle

# Scene Parameters
# Change scene_plugin based on your directory structure
scene_plugin = (
"%s/git/amino/demo/tutorial/plugin/7dof/libscene.so" % os.environ['HOME'])
scene_plugin = ("{}/../plugin/7dof/libscene.so".format(os.path.dirname(__file__)))
scene_name = "7dof"

# Create an (empty) scene graph
Expand Down
10 changes: 4 additions & 6 deletions demo/tutorial/python/t5.1-collision-check.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# File: t5.1-collision-check.py
# =======================
#
# Collision Checking

from amino import SceneWin, SceneGraph, SceneFK, SceneCollisionSet, SceneCollision
from math import pi, cos, sin
from math import pi, sin
from time import sleep
import os
from amino import SceneWin, SceneGraph, SceneFK, SceneCollisionSet, SceneCollision

# Scene Parameters
# Change scene_plugin based on your directory structure
scene_plugin = (
"%s/git/amino/demo/tutorial/plugin/7dof/libscene.so" % os.environ['HOME'])
scene_plugin = ("{}/../plugin/7dof/libscene.so".format(os.path.dirname(__file__)))
scene_name = "7dof"

# Create an (empty) scene graph
Expand Down
10 changes: 4 additions & 6 deletions demo/tutorial/python/t5.2-collision-dist.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# File: t5.2-collision-dist.py
# ============================
Expand All @@ -8,15 +8,13 @@
# Check collision distances and mark the closest points in the scene
# viewer window.

from amino import SceneWin, SceneGraph, SceneFK, SceneCollisionSet, SceneCollision, QuatTrans, Geom
from math import pi, cos, sin
from math import pi, sin
from time import sleep
import os
from amino import SceneWin, SceneGraph, SceneFK, SceneCollision, Geom

# Scene Parameters
# Change scene_plugin based on your directory structure
scene_plugin = (
"%s/git/amino/demo/tutorial/plugin/7dof/libscene.so" % os.environ['HOME'])
scene_plugin = ("{}/../plugin/7dof/libscene.so".format(os.path.dirname(__file__)))
scene_name = "7dof"

# We will mark the closest points in the scene with colored spheres.
Expand Down
11 changes: 4 additions & 7 deletions demo/tutorial/python/t6.1-motion-planning.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from amino import SceneGraph, SceneWin, SceneCollision, MotionPlan
from math import pi
import os
from amino import SceneGraph, SceneCollision, MotionPlan


# Compute Motion Plan


scene_plugin = (
"%s/git/amino/demo/tutorial/plugin/urdf/libbaxter-model.so" % os.environ['HOME'])
scene_plugin = ("{}/../plugin/urdf/libbaxter-model.so".format(os.path.dirname(__file__)))
scene_name = "baxter"


Expand Down Expand Up @@ -43,4 +40,4 @@
0 ]
path = mp.motion_plan(start, goal, 5)

[print(x) for x in path]
_ = [print(x) for x in path]

0 comments on commit 4eb1661

Please sign in to comment.