Comments (9)
Rather than creating a file, could you try to use the code example in in test_ShonanAvaerging.py? Here is a snippet:
measurements = []
unit3 = gtsam.noiseModel.Unit.Create(3)
m01 = BinaryMeasurementRot3(0, 1, Rot3.Yaw(math.radians(90)), unit3)
m12 = BinaryMeasurementRot3(1, 2, Rot3.Yaw(math.radians(90)), unit3)
measurements.append(m01)
measurements.append(m12)
obj = ShonanAveraging3(measurements)
self.assertIsInstance(obj, ShonanAveraging3)
initial = obj.initializeRandomly()
_, cost = obj.run(initial, min_p=3, max_p=5)
self.assertAlmostEqual(cost, 0)
from gtsam.
Thanks for the response! I have tried this. But I am getting the following error
I think it could be mismatch in gtsam version (I installed gtsam using pip as "pip install gtsam" )
from gtsam.
Yeah. Try uninstalling and pip install gtbook
from gtsam.
I created a new conda env (python 3.6.9) and installed gtbook (pip install gtbook).
I still get the same error:
![image](https://private-user-images.githubusercontent.com/23581858/256614258-724b57a8-bd28-4d30-97f8-ba1a3d755b40.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE2NTc1OTQsIm5iZiI6MTcyMTY1NzI5NCwicGF0aCI6Ii8yMzU4MTg1OC8yNTY2MTQyNTgtNzI0YjU3YTgtYmQyOC00ZDMwLTk3ZjgtYmExYTNkNzU1YjQwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIyVDE0MDgxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE3OGJjNGJkMzEwMTE3NDgzNjk3NTQ1MWNjM2MwOTZmOTUxZjE5NmEwNzQzNWQwYjE0Y2U3ZmYyNDViMWRlY2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.W3uA2ayl-Gk_f1Z0WqZcINh8wvveGGZWfvOYwxNAcOk)
from gtsam.
Dang,. Sorry this is happening to you. I will investigate but might need the 4.2 release.
from gtsam.
My bad! May I ask when the 4.2 release is planned? Otherwise, if I can somehow figure out how to set the measurements value in the input(g2o) file, perhaps I can run "ShonanAveragingCLI.py" script. Any help to set the 21 measurements values for a custom dataset would be a great help for my research.
Thank you very much for your precious time and effort!
from gtsam.
Actually, it is related to recent changes in the wrapper. There was an old way to do this, and I tried it in this notebook, and it works. Here is the code snippet:
%pip -q install gtbook
import math
import gtsam
from gtsam import BinaryMeasurementRot3, Rot3, ShonanAveraging3, BinaryMeasurementsRot3
measurements = BinaryMeasurementsRot3()
unit3 = gtsam.noiseModel.Unit.Create(3)
m01 = BinaryMeasurementRot3(0, 1, Rot3.Yaw(math.radians(90)), unit3)
m12 = BinaryMeasurementRot3(1, 2, Rot3.Yaw(math.radians(90)), unit3)
measurements.append(m01)
measurements.append(m12)
obj = ShonanAveraging3(measurements)
assert isinstance(obj, ShonanAveraging3)
initial = obj.initializeRandomly()
result, cost = obj.run(initial, min_p=3, max_p=5)
assert cost < 1e-4
print(result)
I will close this issue but try to make sure the "list" way works in 4.2.
from gtsam.
Great! It works now :) Thanks a lot!
from gtsam.
measurements = []
unit3 = gtsam.noiseModel.Unit.Create(3)
m01 = BinaryMeasurementRot3(0, 1, Rot3.Yaw(math.radians(90)), unit3)
m12 = BinaryMeasurementRot3(1, 2, Rot3.Yaw(math.radians(90)), unit3)
measurements.append(m01)
measurements.append(m12)
obj = ShonanAveraging3(measurements)
self.assertIsInstance(obj, ShonanAveraging3)
initial = obj.initializeRandomly()
_, cost = obj.run(initial, min_p=3, max_p=5)
self.assertAlmostEqual(cost, 0)
This snippet does not seem to work in 4.2 release.
Also how to select the noise model for the real-world dataset? Is there an example?
from gtsam.
Related Issues (20)
- Missing derivative of Similarity(3)
- 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
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.