Skip to content

Instantly share code, notes, and snippets.

@pvazteixeira
Created September 13, 2018 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pvazteixeira/f5048be0206b78f6334221493c2a94d7 to your computer and use it in GitHub Desktop.
Save pvazteixeira/f5048be0206b78f6334221493c2a94d7 to your computer and use it in GitHub Desktop.
use of composition operator
using CoordinateTransformations
wTp1 = Translation(1.0, 0.0, 0.0);
wRp1 = LinearMap(RotXYZ(0.0, 0.0, 0.0))
wPp1 = compose(wTp1, wRp1)
To = Translation(1.0, 0.0, 0.0)
Ro = LinearMap(RotXYZ(0.0,0.0,pi/6.0))
odom = compose(To, Ro)
# expected odom ∘ wPp1 (odom after wPp1), but syntax is like oplus...
wPp2 = compose(wPp1, odom)
# visualize results
using MeshCat
vis = Visualizer()
open(vis)
setobject!(vis[:x1],Triad(0.5))
settransform!(vis[:x1],wPp1)
setobject!(vis[:x2],Triad(0.5))
settransform!(vis[:x2],wPp2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment