Go to the documentation of this file.
34 R_(
Rot3::Rodrigues(0, 0,
pose2.theta())), t_(
41 if (
HR) *
HR << I_3x3, Z_3x3;
42 if (Ht) *Ht << Z_3x3,
R.transpose();
47 static const Matrix63
Hpose2 = (Matrix63() <<
53 0., 0., 0.).finished();
73 adj <<
R, Z_3x3,
A,
R;
90 if (H_xib) *H_xib = Ad;
100 const Vector6 AdTx = Ad.transpose() *
x;
107 *H_pose << w_T_hat, v_T_hat,
111 *H_x = Ad.transpose();
122 adj << w_hat, Z_3x3, v_hat, w_hat;
132 for (
int i = 0;
i < 6; ++
i) {
137 Hxi->col(
i) = Gi *
y;
141 if (H_y) *H_y = ad_xi;
150 for (
int i = 0;
i < 6; ++
i) {
155 Hxi->col(
i) = GTi *
y;
159 if (H_y) *H_y = adT_xi;
166 const double wx =
xi(0), wy =
xi(1), wz =
xi(2),
vx =
xi(3),
vy =
xi(4), vz =
xi(5);
167 X << 0., -wz, wy,
vx, wz, 0., -wx,
vy, -wy, wx, 0., vz, 0., 0., 0., 0.;
174 xi << Xi(2, 1), Xi(0, 2), Xi(1, 0), Xi(0, 3), Xi(1, 3), Xi(2, 3);
180 std::cout << (
s.empty() ?
s :
s +
" ") << *
this << std::endl;
193 if(Hself || Harg || Ht){
199 Rot3 Rint = interpolate<Rot3>(
R_,
T.R_,
t, HselfRot, HargRot, HtRot);
200 Point3 Pint = interpolate<Point3>(
t_,
T.t_,
t, HselfPoint, HargPoint, HtPoint);
203 if(Hself) *Hself << HselfRot, Z_3x3, Z_3x3, Rint.
transpose() *
R_.
matrix() * HselfPoint;
204 if(Harg) *Harg << HargRot, Z_3x3, Z_3x3, Rint.
transpose() *
T.R_.matrix() * HargPoint;
205 if(Ht) *Ht << HtRot, Rint.
transpose() * HtPoint;
209 return Pose3(interpolate<Rot3>(
R_,
T.R_,
t),
210 interpolate<Point3>(
t_,
T.t_,
t));
225 #ifdef GTSAM_USE_QUATERNIONS
228 const Rot3 R(local.expmap());
241 const Vector3 t = local.applyLeftJacobian(
v, Hxi ? &
H :
nullptr);
245 const Matrix3 Jr = local.rightJacobian();
248 const Matrix3
Q =
R.matrix().transpose() *
H;
264 const Vector3 u = local.applyLeftJacobianInverse(
t);
273 #ifdef GTSAM_POSE3_EXPMAP
280 Hxi->topLeftCorner<3, 3>() = DR;
288 #ifdef GTSAM_POSE3_EXPMAP
295 Hpose->topLeftCorner<3, 3>() = DR;
320 local.applyLeftJacobian(
v, H_t_w);
323 const Matrix3
R = local.expmap();
324 const Matrix3 Qt =
R.transpose() * H_t_w;
328 const Matrix3 Qt2 = -Jw * Qt * Jw;
331 J << Jw, Z_3x3, Qt2, Jw;
350 *Hself << I_3x3, Z_3x3;
357 static const auto A14 = Eigen::RowVector4d(0,0,0,1);
366 const Pose3& wTa = *
this;
374 if (HwTb) *HwTb = I_6x6;
375 const Pose3& wTa = *
this;
387 Hself->rightCols<3>() =
R;
396 if (points.rows() != 3) {
397 throw std::invalid_argument(
"Pose3:transformFrom expects 3*N matrix.");
400 return (
R * points).colwise() +
t_;
411 const double wx =
q.x(), wy =
q.y(), wz =
q.z();
413 0.0, -wz, +wy,-1.0, 0.0, 0.0,
414 +wz, 0.0, -wx, 0.0,-1.0, 0.0,
415 -wy, +wx, 0.0, 0.0, 0.0,-1.0;
424 if (points.rows() != 3) {
425 throw std::invalid_argument(
"Pose3:transformTo expects 3*N matrix.");
428 return Rt * (points.colwise() -
t_);
434 Matrix36 D_local_pose;
435 Matrix3 D_local_point;
437 if (!Hself && !Hpoint) {
441 const double r =
norm3(local, D_r_local);
442 if (Hself) *Hself = D_r_local * D_local_pose;
443 if (Hpoint) *Hpoint = D_r_local * D_local_point;
451 Matrix36 D_point_pose;
452 Matrix13 D_local_point;
454 double r =
range(
point, Hself, Hpose ? &D_local_point : 0);
455 if (Hpose) *Hpose = D_local_point * D_point_pose;
462 Matrix36 D_local_pose;
463 Matrix3 D_local_point;
465 if (!Hself && !Hpoint) {
470 if (Hself) *Hself = D_b_local * D_local_pose;
471 if (Hpoint) *Hpoint = D_b_local * D_local_point;
479 Matrix36 D_point_pose;
480 Matrix23 D_local_point;
483 if (Hpose) *Hpose = D_local_point * D_point_pose;
489 const size_t n = abPointPairs.size();
495 const auto centroids =
means(abPointPairs);
499 for (
const Point3Pair &abPair : abPointPairs) {
500 const Point3 da = abPair.first - centroids.first;
501 const Point3 db = abPair.second - centroids.second;
502 H += da * db.transpose();
507 const Point3 aTb = centroids.first -
aRb * centroids.second;
512 if (
a.rows() != 3 ||
b.rows() != 3 ||
a.cols() !=
b.cols()) {
513 throw std::invalid_argument(
514 "Pose3:Align expects 3*N matrices of equal shape.");
518 abPointPairs.emplace_back(
a.col(
j),
b.col(
j));
534 for (
size_t j = 0;
j < 6;
j++) {
549 for (
size_t i = 0;
i < 4;
i++)
559 os <<
"R: " <<
pose.rotation() <<
"\n";
560 os <<
"t: " <<
pose.translation().transpose();
Pose3 slerp(double t, const Pose3 &other, OptionalJacobian< 6, 6 > Hx={}, OptionalJacobian< 6, 6 > Hy={}) const
Spherical Linear interpolation between *this and other.
constexpr static auto dimension
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange[*:*] noreverse nowriteback set trange[*:*] noreverse nowriteback set urange[*:*] noreverse nowriteback set vrange[*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
static Matrix93 VectorizedGenerators()
std::pair< Point3, Point3 > Point3Pair
Rot3 R_
Rotation gRp, between global and pose frame.
static Matrix4 Hat(const Vector6 &xi)
std::vector< Point3Pair > Point3Pairs
static Matrix6 LogmapDerivative(const Vector6 &xi)
Derivative of Logmap.
static const Pose3 pose(Rot3(Vector3(1, -1, -1).asDiagonal()), Point3(0, 0, 0.5))
Point3 transformTo(const Point3 &point, OptionalJacobian< 3, 6 > Hself={}, OptionalJacobian< 3, 3 > Hpoint={}) const
takes point in world coordinates and transforms it to Pose coordinates
Concept-checking macros for geometric objects Each macro instantiates a concept check structure,...
Vector vec(OptionalJacobian< 16, 6 > H={}) const
Return vectorized SE(3) matrix in column order.
static Pose3 FromPose2(const Pose2 &p, OptionalJacobian< 6, 3 > H={})
static Vector6 Vee(const Matrix4 &X)
Vee maps from Lie algebra to tangent vector.
static Vector6 adjointTranspose(const Vector6 &xi, const Vector6 &y, OptionalJacobian< 6, 6 > Hxi={}, OptionalJacobian< 6, 6 > H_y={})
static Rot3 ClosestTo(const Matrix3 &M)
Class compose(const Class &g) const
static Vector6 Logmap(const Pose3 &pose, OptionalJacobian< 6, 6 > Hpose={})
Log map at identity - return the canonical coordinates of this rotation.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
static Pose3 Expmap(const Vector6 &xi, OptionalJacobian< 6, 6 > Hxi={})
Exponential map at identity - create a rotation from canonical coordinates .
ofstream os("timeSchurFactors.csv")
Point3 t_
Translation gPp, from global origin to pose frame origin.
Point2Pair means(const std::vector< Point2Pair > &abPointPairs)
Calculate the two means of a set of Point2 pairs.
Matrix3 skewSymmetric(double wx, double wy, double wz)
static Matrix3 LogmapDerivative(const Vector3 &x)
Derivative of Logmap.
double range(const Point3 &point, OptionalJacobian< 1, 6 > Hself={}, OptionalJacobian< 1, 3 > Hpoint={}) const
3D rotation represented as a rotation matrix or quaternion
Pose3 transformPoseFrom(const Pose3 &aTb, OptionalJacobian< 6, 6 > Hself={}, OptionalJacobian< 6, 6 > HaTb={}) const
Vector6 AdjointTranspose(const Vector6 &x, OptionalJacobian< 6, 6 > H_this={}, OptionalJacobian< 6, 6 > H_x={}) const
The dual version of Adjoint.
void print(const std::string &s="") const
print with optional string
Pose3 transformPoseTo(const Pose3 &wTb, OptionalJacobian< 6, 6 > Hself={}, OptionalJacobian< 6, 6 > HwTb={}) const
Pose2_ Expmap(const Vector3_ &xi)
Vector6 Adjoint(const Vector6 &xi_b, OptionalJacobian< 6, 6 > H_this={}, OptionalJacobian< 6, 6 > H_xib={}) const
static Rot3 Retract(const TangentVector &v)
Retract at origin: possible in Lie group because it has an identity.
JacobiRotation< float > J
StridedVectorType vy(make_vector(y, *n, std::abs(*incy)))
static Pose3 Create(const Rot3 &R, const Point3 &t, OptionalJacobian< 6, 3 > HR={}, OptionalJacobian< 6, 3 > Ht={})
Named constructor with derivatives.
EIGEN_DEVICE_FUNC const Scalar & q
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
Pose3 inverse() const
inverse transformation with derivatives
Pose3 interpolateRt(const Pose3 &T, double t, OptionalJacobian< 6, 6 > Hself={}, OptionalJacobian< 6, 6 > Harg={}, OptionalJacobian< 6, 1 > Ht={}) const
static Matrix6 ExpmapDerivative(const Vector6 &xi)
Derivative of Expmap.
bool equals(const Pose3 &pose, double tol=1e-9) const
assert equality up to a tolerance
const Point3 & translation(OptionalJacobian< 3, 6 > Hself={}) const
get translation
Matrix6 AdjointMap() const
GTSAM_EXPORT friend std::ostream & operator<<(std::ostream &os, const Pose3 &p)
Output stream operator.
static Pose3 Retract(const Vector6 &xi, ChartJacobian Hxi={})
A matrix or vector expression mapping an existing array of data.
Rot3 inverse() const
inverse of a rotation
Unit3 bearing(const Point3 &point, OptionalJacobian< 2, 6 > Hself={}, OptionalJacobian< 2, 3 > Hpoint={}) const
T interpolate(const T &X, const T &Y, double t, typename MakeOptionalJacobian< T, T >::type Hx={}, typename MakeOptionalJacobian< T, T >::type Hy={}, typename MakeOptionalJacobian< T, double >::type Ht={})
static Vector6 Local(const Pose3 &pose, ChartJacobian Hpose={})
const Rot3 & rotation(OptionalJacobian< 3, 6 > Hself={}) const
get rotation
The quaternion class used to represent 3D orientations and rotations.
static Vector6 adjoint(const Vector6 &xi, const Vector6 &y, OptionalJacobian< 6, 6 > Hxi={}, OptionalJacobian< 6, 6 > H_y={})
double norm3(const Point3 &p, OptionalJacobian< 1, 3 > H)
Distance of the point from the origin, with Jacobian.
#define GTSAM_CONCEPT_POSE_INST(T)
Point3 transformFrom(const Point3 &point, OptionalJacobian< 3, 6 > Hself={}, OptionalJacobian< 3, 3 > Hpoint={}) const
takes point in Pose coordinates and transforms it to world coordinates
JacobiRotation< float > G
Array< int, Dynamic, 1 > v
Matrix3 transpose() const
static Vector3 Logmap(const Rot3 &R, OptionalJacobian< 3, 3 > H={})
Represents a 3D point on a unit sphere.
static TangentVector LocalCoordinates(const Rot3 &g)
LocalCoordinates at origin: possible in Lie group because it has an identity.
static Matrix6 adjointMap(const Vector6 &xi)
static const Matrix63 Hpose2
bool equals(const Rot3 &p, double tol=1e-9) const
static std::optional< Pose3 > Align(const Point3Pairs &abPointPairs)
static Unit3 FromPoint3(const Point3 &point, OptionalJacobian< 2, 3 > H={})
Named constructor from Point3 with optional Jacobian.
Rot2 R(Rot2::fromAngle(0.1))
3D Pose manifold SO(3) x R^3 and group SE(3)
StridedVectorType vx(make_vector(x, *n, std::abs(*incx)))
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Matrix< RealScalar, Dynamic, Dynamic > M
gtsam
Author(s):
autogenerated on Fri Apr 25 2025 03:02:34