Closed elemoine closed 7 years ago
I reverted #55 on my local setup and the trajectory looks like this:
It's not correct either but at least the heading angle changes along the trajectory. This suggests to me that the new way of calculating the quaternion is wrong.
https://github.com/LI3DS/api-li3ds/pull/57 fixes a bug where theta1 and theta3 were exchanged. It also removes the heading correction. With both changes the trajectory looks like this:
That looks much better!
If I keep the heading correction I get this:
So I am going to merge #57 and drop the heading correction for now, until we understand why it does not work.
Reopening… Let's discuss why the heading correction causes issues.
You are currently imaging the X axis of the INS using "(0 0 0,2 0 0) in INS coordinates". can you try transforming and imaging the Y and Z axes as well with different colors to ease the debugging ?
I will do that tomorrow. I will add the heading correction again and will display (2 0 0), (0 2 0) and (0 0 2) with different colors.
@mbredif
With the heading correction:
line_y is the one tangent to the trajectory. line_x is orthogonal (or close to orthogonal) to the trajectory.
Without the heading correction:
It's the opposite. line_x is tangent to the trajectory, and line_y is orthogonal to the trajectory.
And contrary to "with the heading correction", line_x and line_y are really tangent and orthogonal to the trajectory, respectively. With the heading correction, there's a small angle.
The SQL query to create the table:
create table trajectory_axis as
select row_number()
over () id
, st_setsrid(st_makeline(st_makepoint(point_0[1], point_0[2], point_0[3]), st_makepoint(point_x[1], point_x[2], point_x[3])), 2154) line_x
, st_setsrid(st_makeline(st_makepoint(point_0[1], point_0[2], point_0[3]), st_makepoint(point_y[1], point_y[2], point_y[3])), 2154) line_y
, st_setsrid(st_makeline(st_makepoint(point_0[1], point_0[2], point_0[3]), st_makepoint(point_z[1], point_z[2], point_z[3])), 2154) line_z
from (
select li3ds.Transform(array[0, 0, 0], 2, pc_get(pc_pointn(points, 50), 'time')) point_0
, li3ds.transform(array[2, 0, 0], 2, pc_get(pc_pointn(points, 50), 'time')) point_x
, li3ds.transform(array[0, 2, 0], 2, pc_get(pc_pointn(points, 50), 'time')) point_y
, li3ds.transform(array[0, 0, 2], 2, pc_get(pc_pointn(points, 50), 'time')) point_z
from "LANDINS_20170516_075157_PP_view"
) t;
Now using the angles provided by Julien N-Haridon.
Without the heading correction:
line_x is still tangent to the trajectory, and line_y is still orthogonal to the trajectory, as previously without the heading correction. But line_y goes in the other direction!
With the heading correction:
line_y is tangent to the trajectory, and line_x is orthogonal to the trajectory, as previously with the heading correction. But again, line_x goes in the other direction.
So with Julien's angles we get different results, but it looks like there's still something wrong with the heading correction.
@mbredif, thoughts?
Sorry, I lost track of which branches are doing/not doing heading correction. Can you point me to both ?
Maybe I just need to convert the heading correction into radians???
radians(0.72537437089 * (pc_get(point, 'x') - 0.0523598775598))
if so, my guess is 0.72537437089 * (radians(pc_get(point, 'x')) - 0.0523598775598)
Yep, that was my final conclusion too. I'll test this.
With https://github.com/LI3DS/api-li3ds/pull/55 merged I am trying to verify the trajectory transfo (ins<->world). For this I created this PostGIS table:
This query creates lines with just two vertices. The line is (0 0 0,2 0 0) in INS coordinates, and it is transformed into the world referential for display.
The issue is that I only get vertical lines in QGIS. I am trying to debug this, with no luck for the moment.
I need another pair of eyes on this.