0
$\begingroup$

Rosanswers logo

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)
0x558a39e0fef0

Value 2: (gtsam::Pose2)
0x558a39e0ff50

Value 3: (gtsam::Pose2)
0x558a39e0cf10

Value 4: (gtsam::Pose2)
0x558a39e0cf70

Value 5: (gtsam::Pose2)
0x558a39e0cfd0

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.


Originally posted by Spyros on ROS Answers with karma: 51 on 2021-02-25

Post score: 0


Original comments

Comment by gvdhoorn on 2021-02-25:
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.

Comment by Spyros on 2021-02-25:
@gvdhoorn it requires more than 200 points to reopen a question

Comment by gvdhoorn on 2021-02-25:
that's why I wrote:

we can re-open your question.

Comment by Spyros on 2021-02-25:
Sorry, i didn't notice. Thanks.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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 https://github.com/borglab/gtsam.git
  • 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)

Originally posted by Spyros with karma: 51 on 2021-02-26

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by hunterlineage1 on 2023-07-21:
Is there a way to send gtsam::Values object, in your case the variable result, as a ROS message between nodes? I looked at creating custom ROS messages but I am confused on how to do this with gtsam::Values object and gtsam::NonlinearFactorGraph objects.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.