Skip to content

Commit

Permalink
Use Vector2 for storing values
Browse files Browse the repository at this point in the history
  • Loading branch information
RainerKuemmerle committed Jul 20, 2024
1 parent 135f490 commit 0c8fc30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions g2o/types/slam2d_addons/line_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
namespace g2o {

Line2D::Line2D() { setZero(); }
Line2D::Line2D(const Vector2& v) {
(*this)[0] = v(0);
(*this)[1] = v(1);
}
Line2D::Line2D(const Vector2& v) : values_{v[0], v[1]} {}

void Line2D::setZero() {
values_[0] = 0.;
Expand Down
2 changes: 1 addition & 1 deletion g2o/types/slam2d_addons/line_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class G2O_TYPES_SLAM2D_ADDONS_API Line2D {
double& operator[](int idx) { return values_[idx]; }

protected:
double values_[2];
Vector2 values_;
};

G2O_TYPES_SLAM2D_ADDONS_API Line2D operator*(const SE2& t, const Line2D& l);
Expand Down

0 comments on commit 0c8fc30

Please sign in to comment.