Comments (1)
I tried the code in gtsam_unstable, the FixedLagIncrementalSmoother. But I don't know how to use it. In the examples file, the timestamp changes. I don't understand how the fixed lag worked.
double deltaT = 0.25;
for(double time = deltaT; time <= 3.0; time += deltaT)
{
// Define the keys related to this timestamp
Key previousKey(1000 * (time-deltaT));
Key currentKey(1000 * (time));
// Assign the current key to the current timestamp
newTimestamps[currentKey] = time;
// Add a guess for this pose to the new values
// Since the robot moves forward at 2 m/s, then the position is simply: time[s]*2.0[m/s]
// {This is not a particularly good way to guess, but this is just an example}
Pose2 currentPose(time * 2.0, 0.0, 0.0);
newValues.insert(currentKey, currentPose);
// Add odometry factors from two different sources with different error stats
Pose2 odometryMeasurement1 = Pose2(0.61, -0.08, 0.02);
noiseModel::Diagonal::shared_ptr odometryNoise1 = noiseModel::Diagonal::Sigmas(Vector3(0.1, 0.1, 0.05));
newFactors.push_back(BetweenFactor<Pose2>(previousKey, currentKey, odometryMeasurement1, odometryNoise1));
Pose2 odometryMeasurement2 = Pose2(0.47, 0.03, 0.01);
noiseModel::Diagonal::shared_ptr odometryNoise2 = noiseModel::Diagonal::Sigmas(Vector3(0.05, 0.05, 0.05));
newFactors.push_back(BetweenFactor<Pose2>(previousKey, currentKey, odometryMeasurement2, odometryNoise2));
// Update the smoothers with the new factors. In this example, batch smoother needs one iteration
// to accurately converge. The ISAM smoother doesn't, but we only start getting estiates when
// both are ready for simplicity.
if (time >= 0.50)
{
smootherBatch.update(newFactors, newValues, newTimestamps);
smootherISAM2.update(newFactors, newValues, newTimestamps);
for(size_t i = 1; i < 2; ++i)
{ // Optionally perform multiple iSAM2 iterations
smootherISAM2.update();
}
// Print the optimized current pose
cout << setprecision(5) << "Timestamp = " << time << endl;
smootherBatch.calculateEstimate<Pose2>(currentKey).print("Batch Estimate:");
smootherISAM2.calculateEstimate<Pose2>(currentKey).print("iSAM2 Estimate:");
cout << endl;
// Clear contains for the next iteration
newTimestamps.clear();
newValues.clear();
newFactors.resize(0);
}
}
In this code, according to my understanding, only keys with timestamps within lag seconds will be optimized? Is this correct to understand?
from gtsam.
Related Issues (20)
- Cannot find the Jacobian of Pose3 HOT 1
- Requested to eliminate a key that is not in the factors HOT 1
- LocalizationExample impossible porting to Python
- Add ExpressionFactor to Python Wrapper. HOT 3
- TriangulationFactor Python HOT 1
- ROS2 Jazzy binaries not using GTSAM_USE_SYSTEM_EIGEN=ON HOT 7
- Directed factors HOT 3
- GeographicLib not found Cmake fix HOT 1
- localCoordinates gives incorret Jacobian matrix?
- installation failed HOT 1
- tbb/scalable_allocator.h: No such file or directory (RHEL) HOT 5
- Building error when compiling examples with boost-1.82.0 HOT 3
- Numpy 2.0 arrays cause segfaults in many GTSAM constructors HOT 3
- Unary Factor Usage Error
- Optmization Failed by using Unary Factor HOT 2
- Modernize GTSAM containers HOT 4
- Failed to import after compiling with build type `Timing`
- Add "point" method to Python realization of SmartProjectionPose3Factor HOT 1
- Convergence analysis of factor graph HOT 1
- ROS2 Lookup error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtsam.