Ask Your Question

gtsam prints pointers instead of values

asked 2021-02-25 09:01:50 -0600

Spyros gravatar image

updated 2021-02-25 09:33:20 -0600

Hello. I'm trying to run some of the gtsam library examples in one of my nodes. When one of the print function is called (i.e. result.print("Final Result:\n");) instead of printing values as shown in the tutorial, it prints pointers.

Final Result:

Values with 5 values:
Value 1: (gtsam::Pose2)

Value 2: (gtsam::Pose2)

Value 3: (gtsam::Pose2)

Value 4: (gtsam::Pose2)

Value 5: (gtsam::Pose2)

What can be the problem here? I installed the library with the procedure described here. Is it useful to uninstall and reinstall the library? and if it is, how can I do it without messing up with my nodes that already use gtsam?

Any kind of feedback is appreciated. Thanks in advance.

I use Ubuntu 18, ROS melodic and I have C++ nodes.

edit retag flag offensive close merge delete


I'm sorry to have to do this for something so seemingly unimportant, but please don't post screenshots of terminal text in question on ROS Answers. It's all text, so there is no need. Just copy-paste the text from the terminal into your question text. Do make sure to format it properly by selecting the text and pressing ctrl+k (or clicking the Preformatted Text button (the one with 101010 on it)).

You don't need to post a new question, just edit your curent one. You can use the edit button/link for this.

After you replace the screenshot with the error message itself, we can re-open your question.

gvdhoorn gravatar image gvdhoorn  ( 2021-02-25 09:23:29 -0600 )edit

@gvdhoorn it requires more than 200 points to reopen a question

Spyros gravatar image Spyros  ( 2021-02-25 09:35:13 -0600 )edit

that's why I wrote:

we can re-open your question.

gvdhoorn gravatar image gvdhoorn  ( 2021-02-25 09:44:33 -0600 )edit

Sorry, i didn't notice. Thanks.

Spyros gravatar image Spyros  ( 2021-02-25 11:30:40 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-02-26 06:43:46 -0600

Spyros gravatar image

I don't know what was causing the problem, but I managed to solve it like this:

  • I uninstalled gtsam by executing xargs rm -rf < install_manifest.txt from the build directory of the gtsam package, as described here.
  • I deleted the whole gtsam package directory with sudo rm -r gtsam/
  • I downloaded again the gtsam package by cloning the repository from here: git clone
  • I reinstalled the package from source, as described here. Note: I changed the make check and make install commands to sudo make check and sudo make install respectively.

Now the values are displayed as expected:

Final Result:

Values with 5 values:
Value 1: (gtsam::Pose2)
(-3.62586e-13, -1.35991e-12, -5.28358e-13)

Value 2: (gtsam::Pose2)
(2, -3.02085e-12, -7.54546e-13)

Value 3: (gtsam::Pose2)
(4, -3.9288e-11, 1.5708)

Value 4: (gtsam::Pose2)
(4, 2, 3.14159)

Value 5: (gtsam::Pose2)
(2, 2, -1.5708)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2021-02-25 09:01:50 -0600

Seen: 75 times

Last updated: Feb 26 '21