Git Product home page Git Product logo

gtsam's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gtsam's Issues

GTSAM will not make check / make

$ make check
[ 12%] Built target metis
[ 14%] Building CXX object gtsam/CMakeFiles/gtsam.dir/symbolic/SymbolicBayesTree.cpp.o
/tmp/ccSXN3tH.s: Assembler messages:
/tmp/ccSXN3tH.s:3665: Error: thumb conditional instruction should be in IT block -- `strexeq r3,r0,[r4]'
/tmp/ccSXN3tH.s:4780: Error: thumb conditional instruction should be in IT block -- `strexeq r3,r5,[r4]'
/tmp/ccSXN3tH.s:7111: Error: thumb conditional instruction should be in IT block -- `strexeq r3,r6,[r4]'
/tmp/ccSXN3tH.s:8353: Error: thumb conditional instruction should be in IT block -- `strexeq r3,r6,[r5]'
/tmp/ccSXN3tH.s:8444: Error: thumb conditional instruction should be in IT block -- `strexeq r0,r1,[r3]'
/tmp/ccSXN3tH.s:9032: Error: thumb conditional instruction should be in IT block -- `strexeq r3,r0,[r4]'
make[3]: *** [gtsam/CMakeFiles/gtsam.dir/symbolic/SymbolicBayesTree.cpp.o] Error 1
make[2]: *** [gtsam/CMakeFiles/gtsam.dir/all] Error 2
make[1]: *** [CMakeFiles/check.dir/rule] Error 2
make: *** [check] Error 2

$ make
[  1%] Built target CppUnitLite
[  7%] Built target wrap_lib
[  9%] Built target wrap
[ 30%] Built target metis
[ 32%] Building CXX object gtsam/CMakeFiles/gtsam.dir/symbolic/SymbolicBayesTree.cpp.o
/tmp/ccRI8LEI.s: Assembler messages:
/tmp/ccRI8LEI.s:3665: Error: thumb conditional instruction should be in IT block -- `strexeq r3,r0,[r4]'
/tmp/ccRI8LEI.s:4780: Error: thumb conditional instruction should be in IT block -- `strexeq r3,r5,[r4]'
/tmp/ccRI8LEI.s:7111: Error: thumb conditional instruction should be in IT block -- `strexeq r3,r6,[r4]'
/tmp/ccRI8LEI.s:8353: Error: thumb conditional instruction should be in IT block -- `strexeq r3,r6,[r5]'
/tmp/ccRI8LEI.s:8444: Error: thumb conditional instruction should be in IT block -- `strexeq r0,r1,[r3]'
/tmp/ccRI8LEI.s:9032: Error: thumb conditional instruction should be in IT block -- `strexeq r3,r0,[r4]'
make[2]: *** [gtsam/CMakeFiles/gtsam.dir/symbolic/SymbolicBayesTree.cpp.o] Error 1
make[1]: *** [gtsam/CMakeFiles/gtsam.dir/all] Error 2
make: *** [all] Error 2

How to complie and run examples?

I follow the documentation to compile and run examples,when i run
make CameraResectioning.run
the output is make: *** No rule to make target 'CameraResectioning.run'. Stop.
how to fix this bug?

TimeTBB slower with more threads

Running the example TimeTBB I get the following results (faster using 1 thread). I'm currently looking into why but any insight in the meantime would be greatly appreciated.

numberOfProblems = 1000000
problemSize = 4
With 1 threads:
Without memory allocation, grain size = 1, time = 0.195355
Without memory allocation, grain size = 10, time = 0.194243
Without memory allocation, grain size = 100, time = 0.194409
Without memory allocation, grain size = 1000, time = 0.196936
With memory allocation, grain size = 1, time = 0.289234
With memory allocation, grain size = 10, time = 0.295508
With memory allocation, grain size = 100, time = 0.294618
With memory allocation, grain size = 1000, time = 0.29145

With 4 threads:
Without memory allocation, grain size = 1, time = 5.02581
Without memory allocation, grain size = 10, time = 4.9835
Without memory allocation, grain size = 100, time = 4.74276
Without memory allocation, grain size = 1000, time = 5.06713
With memory allocation, grain size = 1, time = 4.6808
With memory allocation, grain size = 10, time = 4.73614
With memory allocation, grain size = 100, time = 4.77174
With memory allocation, grain size = 1000, time = 4.75051

With 8 threads:
Without memory allocation, grain size = 1, time = 4.00496
Without memory allocation, grain size = 10, time = 4.06559
Without memory allocation, grain size = 100, time = 4.06971
Without memory allocation, grain size = 1000, time = 4.06233
With memory allocation, grain size = 1, time = 4.65368
With memory allocation, grain size = 10, time = 4.6617
With memory allocation, grain size = 100, time = 4.65855
With memory allocation, grain size = 1000, time = 4.65979

Summary of results:
4 threads, without allocation, grain size = 1, speedup = 0.0388704
4 threads, without allocation, grain size = 10, speedup = 0.0389772
4 threads, without allocation, grain size = 100, speedup = 0.0409907
4 threads, without allocation, grain size = 1000, speedup = 0.0388654
4 threads, with allocation, grain size = 1, speedup = 0.0617917
4 threads, with allocation, grain size = 10, speedup = 0.0623943
4 threads, with allocation, grain size = 100, speedup = 0.0617423
4 threads, with allocation, grain size = 1000, speedup = 0.0613514
8 threads, without allocation, grain size = 1, speedup = 0.0487782
8 threads, without allocation, grain size = 10, speedup = 0.0477773
8 threads, without allocation, grain size = 100, speedup = 0.0477697
8 threads, without allocation, grain size = 1000, speedup = 0.0484786
8 threads, with allocation, grain size = 1, speedup = 0.0621517
8 threads, with allocation, grain size = 10, speedup = 0.0633907
8 threads, with allocation, grain size = 100, speedup = 0.0632425
8 threads, with allocation, grain size = 1000, speedup = 0.0625457

BearingRangeFactor

Below I describe the issue we encounter when using BearingRangeFactor2D from the GTSAM pre-compiled toolbox to describe an inter-vehicle bearing/range measurement.

Within the current GTSAM structure I think the BearingRangeFactor2D is designed to construct factor graphs for landmarks-based SLAM i.e. to describe bearing/range measurements to a landmark to solve the SLAM problem.

The BearingRangeFactor2D constructor is defined as
BearingRangeFactor2D(size_t poseKey, size_t pointKey, Rot2 measuredBearing, double measuredRange, Base noiseModel)

As you will notice that the second argument is of type pointKey which is given by (x,y) -to describe the location of a landmark or feature- while a poseKey is defined by (x,y, theta). When using the BearingRangeFactor2D as shown in the attached pdf, it is required to provide an initial guess or estimate of the location of the landmark before executing the optimization routine. Below a piece of MATLAB script excerpt from GTSAM provided PlanarSLAMExample to describe a facotr graph for agent a and landmarks l1 and l2 as shown in the attached pdf

%-------------------------------------------------SingleAgent----------------------------------------------------------%
% Create keys for variables
% Create (instantiate) factor graph
% Add priors

%% Add odometry
graph.add(BetweenFactorPose2(x1, x2, odometry, odometryNoise));
graph.add(BetweenFactorPose2(x2, x3, odometry, odometryNoise));

%% Add bearing/range measurement factors
graph.add(BearingRangeFactor2D(x1, l1, Rot2(45_degrees),2, brNoise));
graph.add(BearingRangeFactor2D(x2, l1, Rot2(90_degrees), sqrt(8), brNoise));
graph.add(BearingRangeFactor2D(x3, l2, Rot2(90*degrees), 2, brNoise));

%% Initialize to noisy points
initialEstimate = Values;
initialEstimate.insert(x1, Pose2(0.5, 0.0, 0.2));
initialEstimate.insert(x2, Pose2(2.3, 0.1,-0.2));
initialEstimate.insert(x3, Pose2(4.1, 0.1, 0.1));
initialEstimate.insert(l1, Point2(0, 0)); % A required initial guess of landmark of type Point2
initialEstimate.insert(l2, Point2(0, 0)); % A required initial guess of landmark of type Point2
%% Optimize using Levenberg-Marquardt optimization
optimizer = LevenbergMarquardtOptimizer(graph, initialEstimate); % initialEstimate must include a guess of landmarks
result = optimizer.optimizeSafely(); % result returns an optimized solution that includes an estimate of the landmark locations as what an EKF-SLAM would do.

%--------------------------------------------------------------------------------------------------------------------------%

When using the BearingRangeFactor2D to describe an inter-vehicle bearing/range measurement as shown in the attached pdf between agent 1 and 2, we run into the problem of having a second guess of the vehicle been measured. The below MATLAB script describes this issue

%---------------------------------------MultipleAgents-----------------------------------------------------------------%

%% Add odometry
graph.add(BetweenFactorPose2(a1, a2, odometry, odometryNoise)); % odometry factors for agent a
graph.add(BetweenFactorPose2(a2, a3, odometry, odometryNoise));

graph.add(BetweenFactorPose2(a1, a2, odometry, odometryNoise)); % odometry factors for agent b
graph.add(BetweenFactorPose2(a2, a3, odometry, odometryNoise));

%% Add bearing/range measurement factors
graph.add(BearingRangeFactor2D(a2, b2, Rot2(90*degrees), 2, brNoise));

%% Initialize to noisy points
initialEstimate = Values;
initialEstimate.insert(a1, Pose2(0.5, 0.0, 0.2)); % initial guesses for agent's a
initialEstimate.insert(a2, Pose2(2.3, 0.1,-0.2));
initialEstimate.insert(a3, Pose2(4.1, 0.1, 0.1));

initialEstimate.insert(b1, Pose2(0.5, 0.0, 0.2)); % initial guesses for agent's b
initialEstimate.insert(b2, Pose2(0.3, 0.1,-0.2)); % <-------------------- 1st guess of type Pose
initialEstimate.insert(b3, Pose2(0.1, 0.1, 0.1));

initialEstimate.insert(a2, Point2(0, 0)); % <------------- 2nd guess of agent's b at b2 of type Point2

% ---------------------------------------------------------------------------------------------------------%

Work around (things we tried) & observations:

  1. I used the RangeFactorPose2 to describe range measurements between agents and it works fine, the optimizer does not require an initial guess. A look into the C++ source code, I noticed it is instantiated from the same base class as the BearingRangeFactor2D (C++ class). The second argument of the RangeFacotrPose2 is of type Point2 as that of BearingRangeFactor2D. Which tells me that I may need to look into the optimizer that is using them.

  2. A way to work around it, I have tried to create a virtual "landmark" that lies on the top of the agent i.e. by using a BetweenFactor between the agent say b at b2 and a virtual landmark say lb2 with odometry of zeros (0,0,0) and zero odometry noise. With that I have assumed when optimized the result location of lb2 will be on the top of b2 as defined by the ''BetweenFactor'', but that was not the case. lb2 has a separate location and I think it still considered as a landmark close to the agent b at b2.

bearingrangefactor2d

Regards,
Laith

Undefined function or variable 'NonlinearFactorGraph'

When I run gtsam matlab toolbox ,output error undefined function or variable 'NonlinearFactorGraph',I have added the gtsam/matlab to the matlab searching path,however,still can't fix this problem .Did I do something wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.