Merge pull request #502 from borglab/feature/vector-printing

Update NavState Printing
release/4.3a0
Varun Agrawal 2020-08-31 23:28:31 -04:00 committed by GitHub
commit 02cc96de01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -89,8 +89,8 @@ Matrix7 NavState::matrix() const {
//------------------------------------------------------------------------------
ostream& operator<<(ostream& os, const NavState& state) {
os << "R: " << state.attitude() << "\n";
os << "p: " << state.position() << "\n";
os << "v: " << Point3(state.velocity());
os << "p: " << state.position().transpose() << "\n";
os << "v: " << state.velocity().transpose();
return os;
}

View File

@ -215,7 +215,7 @@ TEST(NavState, Stream)
os << state;
string expected;
expected = "R: [\n\t1, 0, 0;\n\t0, 1, 0;\n\t0, 0, 1\n]\np: 0\n0\n0\nv: 0\n0\n0";
expected = "R: [\n\t1, 0, 0;\n\t0, 1, 0;\n\t0, 0, 1\n]\np: 0 0 0\nv: 0 0 0";
EXPECT(os.str() == expected);
}