-
Notifications
You must be signed in to change notification settings - Fork 99
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
Updating MATLAB Toolbox Wrapping + Integration #54
Comments
Segmentation Fault Update: After looking at some previously closed issues and comments, (#29 (comment)) I ended up needing to add Although these changes seemed to have fixed running commands like
Note that adding print statements into the |
I have successfully wrapped GPMP2 into the MATLAB environment. I was able achieve this by looking at the tag number of the repository which I had originally successfully wrapped the GPMP2 library into on my currently working development computer. I found that the gpmp2.h file had changed between tags 0.3.0 and 0.2.1. So by reverting to the gpmp2.h from tag 0.2.1 to tage 0.2.0 and updating some .m and .h files (which are given in the most recent PR) I am running GPMP2 segmentation free. |
I know that reverting to gpmp2.h from tag 0.2.0 is undesirable, so perhaps we could work together to figure out why gpmp2.h from 0.3.0 is causing the segmentation faults @mhmukadam @dongjing3309 @kalyanvasudev. |
This may be more suitable for a new issue, but I do want to note that the Python wrapper procedure seems to be broken in a similar way, after updates on GTSAM's end. |
@wbthomason It is difficult to say if the issue is related or not without opening a new issue. |
Description
I have been working on using the current GTSAM wrap repository for integrating this toolbox into MATLAB for research purposes. I was able to successfully do this some time ago on another development computer, but the wrap repository has changed since then, and I am now facing a segmentation fault errors in the MATLAB environment, when running a few of the examples, post toolbox wrapping.
Additionally, I hope this issue provides information for new documentation on an up-to-date MATLAB + GPMP2 toolbox wrapping procedure on the README.md.
Steps to reproduce current wrapping method
Wrapping GTSAM to MATLAB Toolbox
make install
Wrapping GPMP2 to MATLAB Toolbox
wrap
folder within the gpmp2 folder.gpmp2/CMakeLists.txt
Lines 65 to 74 in 48c41c1
to
sudo make install
in the command prompt resulted initially in the following errors:which I believe is an error related to an open pull request.
Specifically, it appears that Eigen and Pose Tranform have changed in GTSAM and those changes need to be updated in a few key header files. Without specifically without naming all of the header files I changed here in this issues, as I will open a pull request after this issue submission, note that I had to remove the functions
.vector()
and.print()
in order to successfully compile and wrap..vector()
and.print()
from key header files, again runsudo make install
in the command prompt.which should be sufficient for running the toolbox with both GTSAM + GPMP2.
Outstanding Issues
Currently I am able to successfully run a handful of examples without issue, like PointRobot2DFactorGraphExample.m, but I am getting a segmentation fault in one crucial function,
arm.forwardKinematicsPosition()
(which is called in many plotting functions likes PlotPlanarArm.m), is possibly related to the altering of the header files necessary for building, as I was mentioning previously.For instance, if I run
>> Arm3FactorGraphExample
in the MATLAB command prompt, I get the following segmentation error:The
forwardKinematicsPosition()
is defined in the ForwardKinematics-inl.h, where we can see.vector()
is used as follows:gpmp2/gpmp2/kinematics/ForwardKinematics-inl.h
Line 25 in 48c41c1
gpmp2/gpmp2/kinematics/ForwardKinematics-inl.h
Line 39 in 48c41c1
So in my code, I explicitly removed
.vector()
from each of these lines in order to successfully compile and wrap. However now whenever MATLAB tries to executearm.forwardKinematicsPosition()
I get a segmentation faults when I get the program gets to a custom wrapper definition generated in the toolbox:I am sure this is result of editing ForwardKinematics-inl.h](https://github.com/gtrll/gpmp2/blob/main/gpmp2/kinematics/ForwardKinematics-inl.h), but I am not sure what edits need to made to allow me to compile + wrap and work in MATLAB.
Any suggestions or edits on this matter would be greatly appreciated.
Also if someone could verify this install method, that would be beneficial too.
Environment
Linux OS: Ubuntu 20.04
MATLAB version: 2021a
Standard GTSAM + GPMP2 + MATLAB Toolbox build procedure.
Additional information
I do current have a fully working (i.e. no segmentation faults on any GPMP2 example) development computer which has successfully wrapped and working GTSAM + GPMP2 for the MATLAB environment, but that was done some time ago and that code is out of sync with GPMP2. Hence I have not pulled the current repositories onto the development computer and have been testing this MATLAB toolbox integration on a different computer.
The text was updated successfully, but these errors were encountered: