How to obtain the Pose2 object?
Issue #455
resolved
I am writing a graph slam in C++ and I saw this python code example which gets the estimate values of the poses:
current_estimate = self.isam.calculateEstimate()
for i in range(current_estimate.keys().size()):
k = current_estimate.keys().at(i)
pose = current_estimate.atPose2(k)
result.append([pose.x(), pose.y(), pose.theta()])
self.initial_poses = result
self.isam is an ISAM2 object and from the header files, its function calculateEstimate()
returns Values object but how can I extract the Pose2 object from the Values?
The function atPose2(Key key) does not exist in Values header file.
Comments (2)
-
reporter -
reporter - changed status to resolved
Okay I have figured this out. Turns out the at() function is a template function and I have passed at<gtsam::Pose2>() to retireve the Pose2 object.
- Log in to comment
Okay I have figured this out. Turns out the at() function is a template function and I have passed at<gtsam::Pose2>() to retireve the Pose2 object.