circlePose3.py
Go to the documentation of this file.
1 import gtsam
2 import math
3 import numpy as np
4 from math import pi
5 
6 
7 def circlePose3(numPoses=8, radius=1.0, symbolChar='\0'):
8  """
9  circlePose3 generates a set of poses in a circle. This function
10  returns those poses inside a gtsam.Values object, with sequential
11  keys starting from 0. An optional character may be provided, which
12  will be stored in the msb of each key (i.e. gtsam.Symbol).
13 
14  We use aerospace/navlab convention, X forward, Y right, Z down
15  First pose will be at (R,0,0)
16  ^y ^ X
17  | |
18  z-->xZ--> Y (z pointing towards viewer, Z pointing away from viewer)
19  Vehicle at p0 is looking towards y axis (X-axis points towards world y)
20  """
21 
22  values = gtsam.Values()
23  theta = 0.0
24  dtheta = 2 * pi / numPoses
25  gRo = gtsam.Rot3(
26  np.array([[0., 1., 0.], [1., 0., 0.], [0., 0., -1.]], order='F'))
27  for i in range(numPoses):
28  key = gtsam.symbol(symbolChar, i)
29  gti = gtsam.Point3(radius * math.cos(theta), radius * math.sin(theta), 0)
30  oRi = gtsam.Rot3.Yaw(
31  -theta) # negative yaw goes counterclockwise, with Z down !
32  gTi = gtsam.Pose3(gRo.compose(oRi), gti)
33  values.insert(key, gTi)
34  theta = theta + dtheta
35  return values
def circlePose3(numPoses=8, radius=1.0, symbolChar='\0')
Definition: circlePose3.py:7
static Rot3 Yaw(double t)
Positive yaw is to right (as in aircraft heading). See ypr.
Definition: Rot3.h:177
Key symbol(unsigned char c, std::uint64_t j)
Vector3 Point3
Definition: Point3.h:35


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:41:47