Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print/cout the object #80

Closed
lz89 opened this issue Mar 8, 2017 · 3 comments
Closed

print/cout the object #80

lz89 opened this issue Mar 8, 2017 · 3 comments

Comments

@lz89
Copy link

lz89 commented Mar 8, 2017

I wonder is we could still have something like:
inline std::ostream& operator <<(std::ostream & out_str,
const SO3 & so3)
{

out_str << so3.log().transpose() << std::endl;
return out_str;
}

@strasdat
Copy link
Owner

Hi, I prefer not to include insertion operators ostream operator<< in Sophus, because there are so many options, especially for SO3 (rotation matrix, quaternion, angle-axis, so3.log() ...), and it is really a matter of taste which one to use.

Note that you can already do

std::cout << so3.matrix() << std::cout;
std::cout << so3.unit_quaternion() << std::cout;
std::cout << so3.log() << std::cout;

@apesIITM
Copy link

apesIITM commented Apr 18, 2017

Hello @strasdat ,
I am trying to print the values of variable newRefToFrame_poseUpdate which is of type SE3 in https://github.com/tum-vision/lsd_slam/blob/master/lsd_slam_core/src/SlamSystem.cpp#L932
I want to read the values from it and modify. But when I try to print its value using following command, I receive an error.
std::cout << newRefToFrame_poseUpdate << std::endl;
Please provide a correct way to read and modify SE3 types.
Thanks.

@Mechazo11
Copy link

@apesIITM
I know this is kinda very late buy maybe try the following

std::cout << "SE3 matrix --> " <<newRefToFrame_poseUpdate.matrix() <<std::endl;

A variant of this line worked for me to see the 4x4 transformation matrices of keyframes produced by ORB_SLAM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants