Skip to content

Commit df0f9bf

Browse files
committed
adding some functionalities, results not totally working, needs review. WIP
1 parent 512dad8 commit df0f9bf

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed

src/geometry/SE3tc.cpp

+22
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,28 @@ Mat61 SE3tc::Ln_position() const
164164
return result;
165165
}
166166

167+
Mat6 SE3tc::adj() const
168+
{
169+
Mat6 res(Mat6::Zero());
170+
Mat3 tx = hat3( this->p() );
171+
res.topLeftCorner<3,3>() << R();
172+
res.bottomRightCorner<3,3>() << R();
173+
res.bottomLeftCorner<3,3>() << tx*R();// what is this? TODO
174+
return res;
175+
}
176+
177+
SE3tc SE3tc::inv(void) const
178+
{
179+
Mat5 inv;
180+
Mat3 R = this->R();
181+
R.transposeInPlace();
182+
inv << R, -R * (this->p() - this->t()*this->v()), -R*this->v(),
183+
0,0,0,1,0,
184+
0,0,0,-this->t(),0;
185+
return SE3tc(inv);
186+
187+
}
188+
167189
void SE3tc::regenerate()
168190
{
169191
Mat61 xi = this->Ln_position();

src/geometry/mrob/SE3tc.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ class SE3tc{
6969
Mat<3,5> T_compact() const;
7070

7171

72-
//Mat6 adj() const;//TODO necesary here?
72+
Mat6 adj() const;
73+
74+
SE3tc inv(void) const;
7375

7476
void Exp(const Mat61& xi, const matData_t &t);
7577
Mat61 Ln_position(void) const;

src/pybind/FGraphPy.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,11 @@ void init_FGraph(py::module &m)
477477
"Input are poses in 3D, as Lie Algebra of RBT around the Identity",
478478
py::arg("x"),
479479
py::arg("mode") = Node::nodeMode::STANDARD)
480-
.def("add_factor_1pose_3d", &FGraphPy::add_factor_1pose_3d)
480+
.def("add_factor_1pose_3d", &FGraphPy::add_factor_1pose_3d,
481+
"Adds a factor observing one pose, a GPS-like factor",
482+
py::arg("obs"),
483+
py::arg("nodePoseId"),
484+
py::arg("obsInvCov"))
481485
.def("add_factor_2poses_3d", &FGraphPy::add_factor_2poses_3d,
482486
"Factors connecting 2 poses. If last input set to true (by default false), also updates the value of the target Node according to the new obs + origin node",
483487
py::arg("obs"),

src/pybind/FGraphTimePy.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,12 @@ void init_FGraphTime(py::module &m)
167167
"Ladmarks are 3D points, in [x,y,z]",
168168
py::arg("x"),
169169
py::arg("mode") = Node::nodeMode::STANDARD)
170-
.def("add_factor_1pose_3d", &FGraphTimePy::add_factor_1pose_3d)
170+
.def("add_factor_1pose_3d", &FGraphTimePy::add_factor_1pose_3d,
171+
"Adds a factor observing one pose, a GPS-like factor",
172+
py::arg("obs"),
173+
py::arg("nodeId"),
174+
py::arg("time_stamp"),
175+
py::arg("obsInvCov"))
171176
.def("add_factor_camera_proj_3d_point", &FGraphTimePy::add_factor_camera_proj_3d_point,
172177
"\n Factor for the reprojection error from a point in the image plane",
173178
py::arg("obs"),

0 commit comments

Comments
 (0)