gtsam
Loading...
Searching...
No Matches
DynamicsPriors.h
Go to the documentation of this file.
1
10
11#pragma once
12
13#include <gtsam/config.h>
14
15#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V43
16
19
20#include <cassert>
21
22namespace gtsam {
23
24// Indices of relevant variables in the PoseRTV tangent vector:
25// [ rx ry rz tx ty tz vx vy vz ]
26static const size_t kRollIndex = 0;
27static const size_t kPitchIndex = 1;
28static const size_t kHeightIndex = 5;
29static const size_t kVelocityZIndex = 8;
30static const std::vector<size_t> kVelocityIndices = { 6, 7, 8 };
31
36struct DHeightPrior : public gtsam::PartialPriorFactor<PoseRTV> {
37 typedef gtsam::PartialPriorFactor<PoseRTV> Base;
38
39 DHeightPrior(Key key, double height, const gtsam::SharedNoiseModel& model)
40 : Base(key, kHeightIndex, height, model) {}
41};
42
48struct DRollPrior : public gtsam::PartialPriorFactor<PoseRTV> {
49 typedef gtsam::PartialPriorFactor<PoseRTV> Base;
50
52 DRollPrior(Key key, double wx, const gtsam::SharedNoiseModel& model)
53 : Base(key, kRollIndex, wx, model) { }
54
56 DRollPrior(Key key, const gtsam::SharedNoiseModel& model)
57 : Base(key, kRollIndex, 0.0, model) { }
58};
59
65struct VelocityPrior : public gtsam::PartialPriorFactor<PoseRTV> {
66 typedef gtsam::PartialPriorFactor<PoseRTV> Base;
67
68 VelocityPrior(Key key, const gtsam::Vector& vel, const gtsam::SharedNoiseModel& model)
69 : Base(key, kVelocityIndices, vel, model) {}
70};
71
77struct DGroundConstraint : public gtsam::PartialPriorFactor<PoseRTV> {
78 typedef gtsam::PartialPriorFactor<PoseRTV> Base;
79
83 DGroundConstraint(Key key, double height, const gtsam::SharedNoiseModel& model)
84 : Base(key, { kHeightIndex, kVelocityZIndex, kRollIndex, kPitchIndex },
85 Vector::Unit(4, 0)*height, model) {}
86
90 DGroundConstraint(Key key, const Vector& constraint, const gtsam::SharedNoiseModel& model)
91 : Base(key, { kHeightIndex, kVelocityZIndex, kRollIndex, kPitchIndex }, constraint, model) {
92 assert(constraint.size() == 4);
93 }
94};
95
96} // \namespace gtsam
97
98#endif // GTSAM_ALLOW_DEPRECATED_SINCE_V43
Pose3 with translational velocity.
A deprecated prior factor on selected tangent-space coordinates.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
noiseModel::Base::shared_ptr SharedNoiseModel
Aliases.
Definition NoiseModel.h:846