-
Notifications
You must be signed in to change notification settings - Fork 330
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
feat: added Reset initial pose through ros service #241
feat: added Reset initial pose through ros service #241
Conversation
- clears local map - clears path (trajectory)
Please fix the ci! Install ore commit and run it locally. You can also check the email you got about the error |
cpp/kiss_icp/pipeline/KissICP.cpp
Outdated
@@ -107,4 +107,11 @@ bool KissICP::HasMoved() { | |||
return motion > 5.0 * config_.min_motion_th; | |||
} | |||
|
|||
void KissICP::Reset(Eigen::Quaterniond quaternion, Eigen::Vector3d translation) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method does not reset the poses but instead injects a new one... I'd split this into two methods. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, My understanding from your comment,
1 . Reset to be done when we Reset to the origin position.
2 . Since This feature is setting the starting position, we need to have a method SetPose.
Is that what you are referring to?
@RamanaBotta , I'm adding @benemer and @tizianoGuadagnino to join the review party. As a general comment, the draft looks ok. But it's far from our standards. KISS-ICP is a multi-framework project. This PR is only affecting the ROS 1 side; what you would be missing is the following:
I know it's too much to ask, but we will never merge this in the current state. We spend a lot of time and effort to make the system what it is right now. I hope you understand 😃 What do you think? Would you be able to do the extra effort and complete the integration? |
Hello @nachovizzo, Thank you for assigning reviewers. @nachovizzo, I can add support for ROS2 API. But I need some support on Python API. |
cpp/kiss_icp/pipeline/KissICP.hpp
Outdated
@@ -67,6 +67,7 @@ class KissICP { | |||
double GetAdaptiveThreshold(); | |||
Sophus::SE3d GetPredictionModel() const; | |||
bool HasMoved(); | |||
void Reset(Eigen::Quaterniond, Eigen::Vector3d); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Sophus::SE3d as argument. Quaternion&Vector is more of a ROS thing and I will like to keep the cpp API Sophus only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solved
poses_.clear(); | ||
Sophus::SE3d predpred(quaternion, translation); | ||
poses_.push_back(predpred); | ||
local_map_.Clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of resetting the local map here, would in make more sense to transformed it the new reference frame so that KISS can continue his "job" with the old map points?
What do you think ? @nachovizzo @benemer @RamanaBotta
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, we shold transform the local map and the poses to the new frame. Otherwise, every time Reset
is called, the constant velocity model can not be applied and the map is empty. So you lose a lot of the nice properties of KISS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of resetting the local map here, would in make more sense to transformed it the new reference frame so that KISS can continue his "job" with the old map points?
What do you think ? @nachovizzo @benemer @RamanaBotta
I agree, It makes sense to transform the local map to the new reference frame.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @tizianoGuadagnino @benemer and @nachovizzo ,
I have tried transforming the local map to the new reference frame. Please look here for implementation.
Issue
After resetting to the new frame, the Local map is not looking good, It has previous ref frame points too.
Help
Please consider looking into implementation here, please let me know any corrections or suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are applying the wrong transformation, because `local_cloud is not expressed in the sensor frame. We need to keep track of the frame of the map since this will change when it is reset. Initially, this frame is the first pose of the sensor which is assumed to be identity.
Therefore, you have to apply first the inverse of the current map's frame and then transform it using the desired new reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please push your changes to this branch? This makes it easier to discuss it.
For example, you are still clearing the poses when resetting the map. This will prevent the system from de-skewing and using a constant velocity model because the velocity can not be estimated without prior pose information. If it is desired to reset the list of estimated poses, I would at least transform and keep the last two.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @benemer @tizianoGuadagnino, Can you Please reiterate this suggestion on transforming the local map, without this also things are working fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @RamanaBotta, for us it is not just important that it works but it also needs to be correct from the theoretical perspective. Once the pose has been reset, it just makes sense to transform the local map in the new reference frame, so that KISS can use the previous map. Please fix this.
…-frame chore : attempt to local-map-transform-to-new-ref-frame
Hello, thanks for the amazing work. This branch got a bit outdated and the PR is getting a bit bigger than expected. I'm closing the PR now in favor of opening a new one. But please try to do so once the code has been tested, and it's in a final state. Otherwise, the collaboration from our side turns to be a bit challenging since we none of us is working full-time in this project. |
Okay @nachovizzo , |
Issue
#237
What?
kiss-icp is not consistent for global localization, so we need to have a reset_pose feature when working with GPS or other global localization systems.
So this pull request adds such feature to provide such a feature to the ros1 version of kiss-icp.
Why?
Since kiss-icp is prone to accumulation of positional errors over time, having something like a service call to reset odometry would really help when working with other sensors, especially sensors like GPS (globally consistent).
How?
Testing?
roslaunch kiss_icp odometry.launch
rosservice call /reset_pose "{x: 0.0, y: 0.0, z: 0.0, R: 0.0, P: 0.0, Y: 0.0}"
Repository:
https://github.com/RamanaBotta/kiss-icp
Branch to be tested:
Reset-initial-pose-through-ros-service
Observations
Expected Results
Screenshots (optional)
Changelog (anytopics changed/major changes)
Anything Else?