-
Notifications
You must be signed in to change notification settings - Fork 134
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
Regarding state access and update timeline #57
Comments
As I get into the implementation details, I realize I missed an important detail regarding the current implementation: the current lidar pipeline does not use But then, I'm wondering whether this mixed state (GICP pose + IMU integrated velocity) really makes any sense. Why not use preintegrated state directly? Of course, a snapshot at ~ In other words, instead of keeping only the latest estimated state, all the states computed by the IMU pipeline would be stored in a queue. Then, when a new point cloud is received, the queued state with the closest timestamp (< current scan stamp) would be used as start point of the IMU integration instead of Finally, back propagation ( Note there are not necessarily that many states to update, since all the states up to Also note this new approach is way more deterministic than the current implementation: order of processing of IMU and lidar scan messages almost does not matter (still does a little because of |
It took me a while, but I think I have now a working implementation of this approach, including #58. With a pure discrete integration based implementation and without much tuning on the geometric observer parameters, I have measured significant improvement on the predicted pose accuracy compared to the current implementation. There are too many changes for me to make a PR, but if anyone is interested, here are the significant changes I have made to the code:
The reason I run a single integration with correction is because the estimated and true poses correspond to scan time I think this approach is already more robust than the original design. AFAIK, this approach is also 100% deterministic (processing order does not matter) |
Thanks for the extensive analysis and work @VRichardJP. A PR would certainly be appreciated if possible! |
At runtime, the robot
state
is estimated and corrected continuously by the IMU and pointcloud callback pipeline, both running in parallel.IMU pipeline
The IMU callback gets new IMU measurement, transforms the data using IMU->robot extrinsics and IMU intrinsics.
Then the linear acceleration and angular velocity are corrected using the last known biases:
this->state.b.accel
andthis->state.b.gyro
. The data is then pushed to the IMU data buffer.Then, the robot
state
is updated by integrating the current measurement overdt
(time difference since the last IMU measurement)Lidar pipeline
The pointcloud callback gets a new lidar scan, transform the data using LIDAR-> robot extrinsics.
Then it uses measurements from the IMU data buffer to estimate the robot pose at the time of each point in the scan (starting from the last GICP-aligned state).
The estimated robot pose at the middle of the scan is used as initial guess for GICP alignment.
After GICP alignment, the robot estimated biases/velocity are corrected based on the error between the current state and GICP-aligned state.
Problems
Let's note
t_k
the start timestamp of scank
,Dt_k
(e.g. 10ms) the total duration of the scan andl_k
(e.g. 10~100ms, hopefully faster than lidar sensor frequency) the total latency of the lidar pipeline (including data transfer, processing, etc.).The state accel/gyro biases, velocity and orientation are updated at the end of the Lidar pipeline. In other words, these values are updated at time
t_k + Dt_k + l_k
. However, these new bias values are meant to be applied from current scan timet_k
. Since the IMU pipeline is running in parallel, all IMU measurements betweent_k
andt_k + Dt_k + l_k
have already been integrated with the previous bias. Basically, the bias update is "lagging" by approximately 1~2 lidar scan. Obviously, such approximation is necessary if we want to publish a real-time estimate of the robot state, for example the one published bypublishToROS
. However I think this lag has to impact the data in theimu_buffer
(used during the lidar pipeline IMU integration). For example, while the IMU pipeline would use lastest known biases to produce the current state estimate, all IMU measurements would be stored uncorrected in theimu_buffer
and only corrected in the lidar pipeline during the IMU integration (using a buffer of the last few known biases).I think there is a bigger problem with the way backpropagation is implemented, as
updateState
seems to mix 2 totally different states. On one hand, there is the GICP-optimized state fromt_(k-1)
, which goes through the IMU integration to produce an estimated state att_k
, which is then corrected using GICP. On the other hand, there is the globalthis->state
which is synchronized with IMU data. So by the time the lidar pipeline reaches theupdateState
function, the currentstate
estimate is already ahead of time (approximatelyt_k + Dt_k + l_k
). Then I find 2 problems with theupdateState
function:2.1. it compares a pose estimate at time
t_k
with a pose estimate at timet_k + Dt_k + l_k
to compute a correction.2.2. the correction is applied on the current
state
, by doing as if the time difference between the two states was the lidar scan frequency (=Dt_k
). Thus ignoringl_k
may be actually big.I think 2.1 can be the source of many problems. The geometric observer should rather compare poses with the same timestamp: the initial guess from IMU integration with the GICP-aligned state. Then the correction should be applied to the current
state
by using the time difference between the previous lidar scant_(k-1)
and the lateststate
stamp (=latest IMU measurement, approx.t_k + Dt_k + l_k
). Indeed, the incorrected biases/velocity/orientation used fromt_(k-1)
tot_k
have also been used aftert_k
. Note that if we do so, the problem 1 described above does not exist anymore.The text was updated successfully, but these errors were encountered: