Copy constructor and return const &

release/4.3a0
dellaert 2014-03-06 21:07:54 -05:00
parent 691e9884d7
commit 9007d1ca72
1 changed files with 11 additions and 5 deletions

View File

@ -34,14 +34,20 @@ public:
bRn_(initial_bRn), x_g_(initial_x_g), x_a_(initial_x_a) {
}
Vector b_g(double g_e) {
Vector n_g = (Vector(3) << 0.0, 0.0, g_e);
/// Copy constructor
Mechanization_bRn2(const Mechanization_bRn2& other) :
bRn_(other.bRn_), x_g_(other.x_g_), x_a_(other.x_a_) {
}
/// gravity in the body frame
Vector b_g(double g_e) const {
Vector n_g = (Vector(3) << 0, 0, g_e);
return (bRn_ * n_g).vector();
}
Rot3 bRn() const {return bRn_; }
Vector x_g() const { return x_g_; }
Vector x_a() const { return x_a_; }
const Rot3& bRn() const {return bRn_; }
const Vector& x_g() const { return x_g_; }
const Vector& x_a() const { return x_a_; }
/**
* Initialize the first Mechanization state