Go to the documentation of this file.
22 #ifndef OV_TYPE_TYPE_POSEJPL_H
23 #define OV_TYPE_TYPE_POSEJPL_H
43 _q = std::shared_ptr<JPLQuat>(
new JPLQuat());
44 _p = std::shared_ptr<Vec>(
new Vec(3));
47 Eigen::Matrix<double, 7, 1> pose0;
65 _q->set_local_id(new_id);
66 _p->set_local_id(new_id + ((new_id != -1) ?
_q->size() : 0));
74 void update(
const Eigen::VectorXd &dx)
override {
76 assert(dx.rows() ==
_size);
78 Eigen::Matrix<double, 7, 1> newX =
_value;
80 Eigen::Matrix<double, 4, 1> dq;
81 dq << .5 * dx.block(0, 0, 3, 1), 1.0;
88 newX.block(4, 0, 3, 1) += dx.block(3, 0, 3, 1);
105 std::shared_ptr<Type>
clone()
override {
106 auto Clone = std::shared_ptr<PoseJPL>(
new PoseJPL());
107 Clone->set_value(
value());
108 Clone->set_fej(
fej());
122 Eigen::Matrix<double, 3, 3>
Rot()
const {
return _q->Rot(); }
125 Eigen::Matrix<double, 3, 3>
Rot_fej()
const {
return _q->Rot_fej(); }
128 Eigen::Matrix<double, 4, 1>
quat()
const {
return _q->value(); }
131 Eigen::Matrix<double, 4, 1>
quat_fej()
const {
return _q->fej(); }
134 Eigen::Matrix<double, 3, 1>
pos()
const {
return _p->value(); }
137 Eigen::Matrix<double, 3, 1>
pos_fej()
const {
return _p->fej(); }
140 std::shared_ptr<JPLQuat>
q() {
return _q; }
143 std::shared_ptr<Vec>
p() {
return _p; }
147 std::shared_ptr<JPLQuat>
_q;
150 std::shared_ptr<Vec>
_p;
158 assert(new_value.rows() == 7);
159 assert(new_value.cols() == 1);
162 _q->set_value(new_value.block(0, 0, 4, 1));
165 _p->set_value(new_value.block(4, 0, 3, 1));
176 assert(new_value.rows() == 7);
177 assert(new_value.cols() == 1);
180 _q->set_fej(new_value.block(0, 0, 4, 1));
183 _p->set_fej(new_value.block(4, 0, 3, 1));
191 #endif // OV_TYPE_TYPE_POSEJPL_H
std::shared_ptr< Type > check_if_subvariable(const std::shared_ptr< Type > check) override
Determine if pass variable is a sub-variable.
int _size
Dimension of error state.
Eigen::Matrix< double, 4, 1 > quat_multiply(const Eigen::Matrix< double, 4, 1 > &q, const Eigen::Matrix< double, 4, 1 > &p)
Multiply two JPL quaternions.
std::shared_ptr< Type > clone() override
Create a clone of this variable.
void update(const Eigen::VectorXd &dx) override
Update q and p using a the JPLQuat update for orientation and vector update for position.
Eigen::Matrix< double, 3, 1 > pos_fej() const
void set_fej_internal(const Eigen::MatrixXd &new_value)
Sets the value of the first estimate.
Eigen::Matrix< double, 4, 1 > quat() const
Rotation access as quaternion.
std::shared_ptr< Vec > _p
Subvariable containing position.
int _id
Location of error state in covariance.
virtual const Eigen::MatrixXd & value() const
Access variable's estimate.
void set_local_id(int new_id) override
Sets id used to track location of variable in the filter covariance.
Derived Type class that implements JPL quaternion.
void set_value(const Eigen::MatrixXd &new_value) override
Sets the value of the estimate.
void set_value_internal(const Eigen::MatrixXd &new_value)
Sets the value of the estimate.
Eigen::Matrix< double, 3, 3 > Rot_fej() const
FEJ Rotation access.
Eigen::Matrix< double, 3, 3 > Rot() const
Rotation access.
Eigen::Matrix< double, 4, 1 > quat_fej() const
FEJ Rotation access as quaternion.
void set_fej(const Eigen::MatrixXd &new_value) override
Sets the value of the first estimate.
std::shared_ptr< Vec > p()
Dynamic type system types.
Eigen::Matrix< double, 4, 1 > quatnorm(Eigen::Matrix< double, 4, 1 > q_t)
Normalizes a quaternion to make sure it is unit norm.
std::shared_ptr< JPLQuat > q()
Derived Type class that implements a 6 d.o.f pose.
Eigen::Matrix< double, 3, 1 > pos() const
Position access.
virtual const Eigen::MatrixXd & fej() const
Access variable's first-estimate.
Eigen::MatrixXd _fej
First-estimate.
Eigen::MatrixXd _value
Current best estimate.
std::shared_ptr< JPLQuat > _q
Subvariable containing orientation.
Derived Type class that implements vector variables.
Base class for estimated variables.
ov_core
Author(s): Patrick Geneva
, Kevin Eckenhoff , Guoquan Huang
autogenerated on Mon Dec 16 2024 03:06:46