Skip to content

Commit

Permalink
Merge pull request #268 from tier4/feature/lidars-qt128-ot128-raw-pac…
Browse files Browse the repository at this point in the history
…kets

Add raw packets support for Hesai QT128 & Hesai Pandar128E4X
  • Loading branch information
mackierx111 authored Mar 12, 2024
2 parents df3845e + 1a3ff95 commit eeb69ed
Show file tree
Hide file tree
Showing 11 changed files with 442 additions and 120 deletions.
8 changes: 8 additions & 0 deletions Assets/RGLUnityPlugin/NebulaCalibrations.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

129 changes: 129 additions & 0 deletions Assets/RGLUnityPlugin/NebulaCalibrations/Pandar128E4X.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
Laser id,Elevation,Azimuth
1,14.985,0.186
2,13.283,0.185
3,11.758,1.335
4,10.483,1.343
5,9.836,0.148
6,9.171,0.147
7,8.496,0.146
8,7.812,0.146
9,7.462,1.335
10,7.115,1.336
11,6.767,1.337
12,6.416,1.338
13,6.064,1.339
14,5.71,1.34
15,5.355,1.341
16,4.998,1.342
17,4.643,0.128
18,4.282,0.128
19,3.921,0.127
20,3.558,0.127
21,3.194,0.107
22,2.829,0.106
23,2.463,0.105
24,2.095,0.105
25,1.974,-3.118
26,1.854,1.315
27,1.729,4.529
28,1.609,-3.121
29,1.487,1.316
30,1.362,4.532
31,1.242,-3.124
32,1.12,1.317
33,0.995,4.536
34,0.875,-3.127
35,0.75,1.317
36,0.625,4.539
37,0.5,-3.13
38,0.375,1.318
39,0.25,4.542
40,0.125,-3.133
41,0,0.103
42,-0.125,2.935
43,-0.25,-1.517
44,-0.375,0.103
45,-0.5,2.937
46,-0.626,-1.519
47,-0.751,0.103
48,-0.876,2.939
49,-1.001,-1.52
50,-1.126,0.103
51,-1.251,2.941
52,-1.377,-1.521
53,-1.502,0.102
54,-1.627,2.943
55,-1.751,-1.523
56,-1.876,0.102
57,-2.001,2.945
58,-2.126,-1.524
59,-2.251,0.102
60,-2.376,2.946
61,-2.501,-1.526
62,-2.626,0.102
63,-2.751,2.948
64,-2.876,-1.526
65,-3.001,1.324
66,-3.126,4.57
67,-3.251,-3.155
68,-3.376,1.325
69,-3.501,4.573
70,-3.626,-3.157
71,-3.751,1.326
72,-3.876,4.575
73,-4.001,-3.159
74,-4.126,1.326
75,-4.25,4.578
76,-4.375,-3.161
77,-4.501,1.327
78,-4.626,4.581
79,-4.751,-3.163
80,-4.876,1.328
81,-5.001,4.583
82,-5.126,-3.165
83,-5.252,1.329
84,-5.377,4.586
85,-5.502,-3.167
86,-5.626,1.329
87,-5.752,4.588
88,-5.877,-3.168
89,-6.002,0.102
90,-6.378,0.103
91,-6.754,0.103
92,-7.13,0.103
93,-7.507,0.104
94,-7.882,0.104
95,-8.257,0.104
96,-8.632,0.104
97,-9.003,1.337
98,-9.376,1.337
99,-9.749,1.338
100,-10.121,1.339
101,-10.493,1.34
102,-10.864,1.341
103,-11.234,1.341
104,-11.603,1.342
105,-11.975,0.108
106,-12.343,0.108
107,-12.709,0.109
108,-13.075,0.109
109,-13.439,0.13
110,-13.803,0.131
111,-14.164,0.131
112,-14.525,0.132
113,-14.879,1.384
114,-15.237,1.384
115,-15.593,1.385
116,-15.948,1.385
117,-16.299,1.386
118,-16.651,1.386
119,-17,1.387
120,-17.347,1.387
121,-17.701,0.151
122,-18.386,0.153
123,-19.063,0.154
124,-19.73,0.156
125,-20.376,1.388
126,-21.653,1.408
127,-23.044,0.196
128,-24.765,0.286

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

129 changes: 129 additions & 0 deletions Assets/RGLUnityPlugin/NebulaCalibrations/PandarQT128.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
Laser id,Elevation,Azimuth
1,-52.62676282,10.10830596
2,-51.0280939,9.719503673
3,-49.51495392,9.384265827
4,-48.07394795,9.091433335
5,-46.69466297,8.832899657
6,-45.36882812,8.602605729
7,-44.08974439,8.395920495
8,-42.85190128,8.209210679
9,-41.65069769,8.03961095
10,-40.48225401,7.8848012
11,-39.34326358,7.742887867
12,-38.23088092,7.612311759
13,-37.14263654,7.491771683
14,-36.07637316,7.380164213
15,-35.03019446,7.276562397
16,-34.00242585,7.180171603
17,-32.99157758,7.090302002
18,-31.99631045,7.006369095
19,-31.01543179,6.927848973
20,-30.04786472,6.854295551
21,-29.09262707,6.785306938
22,-28.14883195,6.720536921
23,-27.21566989,6.659666871
24,-26.29240356,6.602428464
25,-25.37835081,6.548569874
26,-24.47288318,6.497872808
27,-23.57542315,6.450129948
28,-22.68544071,6.405178951
29,-21.80243688,6.362840261
30,-20.92594329,6.32298504
31,-20.05553602,6.285467298
32,-19.19081372,6.25017485
33,-18.33139172,-6.21699538
34,-17.47691901,-6.18583344
35,-16.62705442,-6.156599148
36,-15.78149317,-6.129208192
37,-14.93993032,-6.103581848
38,-14.10208035,-6.079663981
39,-13.26767188,-6.057381402
40,-12.43645574,-6.036683527
41,-11.60818201,-6.017519726
42,-10.78261371,-5.999833659
43,-9.959523504,-5.983597281
44,-9.138697037,-5.968771181
45,-8.319929599,-5.955310246
46,-7.503005408,-5.943192006
47,-6.687807162,-5.926719867
48,-5.873926875,-5.922876604
49,-5.061393513,-5.914628713
50,-4.249948322,-5.907639071
51,-3.43941536,-5.901885097
52,-2.629617595,-5.897355529
53,-1.820378325,-5.894039091
54,-1.011522452,-5.891935825
55,-0.202883525,-5.89103442
56,0.605717878,-5.89132922
57,1.414444374,-5.892831558
58,2.223469054,-5.895541414
59,3.032962884,-5.899458754
60,3.8431104,-5.904600534
61,4.654074511,-5.910966684
62,5.466034723,-5.918579795
63,6.279180222,-5.927451101
64,7.093696848,-5.937608821
65,7.909760474,5.949064148
66,8.727579858,5.961845258
67,9.54735011,5.97598597
68,10.36927364,5.99150874
69,11.19356846,6.008464331
70,12.0204614,6.026875139
71,12.85016831,6.046797524
72,13.68294669,6.068282136
73,14.51903314,6.091373918
74,15.35869922,6.116134758
75,16.20222125,6.142626487
76,17.04988688,6.170927865
77,17.90200196,6.201111915
78,18.75890049,6.233268566
79,19.62091911,6.267487655
80,20.48842178,6.303870236
81,21.36180725,6.342539884
82,22.24149217,6.383614369
83,23.12791172,6.427233938
84,24.02155359,6.473555624
85,24.92293181,6.52274755
86,25.83260224,6.574994555
87,26.75116558,6.63050945
88,27.67927338,6.689521655
89,28.61763387,6.752299732
90,29.56702472,6.819128697
91,30.52828971,6.890343815
92,31.50236238,6.966319159
93,32.49026442,7.0474731
94,33.49313666,7.134285032
95,34.51223682,7.227334588
96,35.54897914,7.327222327
97,19.19081372,-6.25017485
98,20.05553602,-6.285467298
99,20.92594329,-6.32298504
100,21.80243688,-6.362840261
101,22.68544071,-6.405178951
102,23.57542315,-6.450129948
103,24.47288318,-6.497872808
104,25.37835081,-6.548569874
105,26.29240356,-6.602428464
106,27.21566989,-6.659666871
107,28.14883195,-6.720536921
108,29.09262707,-6.785306938
109,30.04786472,-6.854295551
110,31.01543179,-6.927848973
111,31.99631045,-7.006369095
112,32.99157758,-7.090302002
113,34.00242585,-7.180171603
114,35.03019446,-7.276562397
115,36.07637316,-7.380164213
116,37.14263654,-7.491771683
117,38.23088092,-7.612311759
118,39.34326358,-7.742887867
119,40.48225401,-7.8848012
120,41.65069769,-8.03961095
121,42.85190128,-8.209210679
122,44.08974439,-8.395920495
123,45.36882812,-8.602605729
124,46.69466297,-8.832899657
125,48.07394795,-9.091433335
126,49.51495392,-9.384265827
127,51.0280939,-9.719503673
128,52.62676282,-10.10830596
7 changes: 7 additions & 0 deletions Assets/RGLUnityPlugin/NebulaCalibrations/PandarQT128.csv.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 1 addition & 22 deletions Assets/RGLUnityPlugin/Scripts/LidarModels/Laser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using System;

namespace RGLUnityPlugin
{
/// <summary>
Expand All @@ -22,7 +20,7 @@ namespace RGLUnityPlugin
/// Numbers are expressed in terms of Unity axes convention.
/// </summary>
[System.Serializable]
public struct Laser : IEquatable<Laser>
public struct Laser
{
/// <summary>
/// Rotation around Y-axis.
Expand Down Expand Up @@ -63,24 +61,5 @@ public struct Laser : IEquatable<Laser>
/// Note: May be ignored for some `LidarConfiguration`s (e.g. `UniformRangeLidarConfiguration`)
/// </summary>
public float maxRange;

//// IEquatable interface
public bool Equals(Laser other)
{
return this.horizontalAngularOffsetDeg == other.horizontalAngularOffsetDeg &&
this.verticalAngularOffsetDeg == other.verticalAngularOffsetDeg &&
this.verticalLinearOffsetMm == other.verticalLinearOffsetMm &&
this.ringId == other.ringId &&
this.timeOffset == other.timeOffset &&
this.minRange == other.minRange &&
this.maxRange == other.maxRange;
}

public override bool Equals(object obj)
{
return obj is Laser equatable && Equals(equatable);
}

public override int GetHashCode() => (horizontalAngularOffsetDeg, verticalAngularOffsetDeg, verticalLinearOffsetMm, ringId, timeOffset, minRange, maxRange).GetHashCode();
}
}
3 changes: 1 addition & 2 deletions Assets/RGLUnityPlugin/Scripts/LidarSensor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public void OnValidate()
}
ApplyConfiguration(configuration);
validatedPreset = modelPreset;
onLidarModelChange?.Invoke();
}

private void ApplyConfiguration(BaseLidarConfiguration newConfig)
Expand All @@ -169,8 +170,6 @@ private void ApplyConfiguration(BaseLidarConfiguration newConfig)
return;
}

onLidarModelChange?.Invoke();

rglGraphLidar.UpdateNodeRaysFromMat3x4f(lidarRaysNodeId, newConfig.GetRayPoses())
.UpdateNodeRaysSetRange(lidarRangeNodeId, newConfig.GetRayRanges())
.UpdateNodeRaysSetRingIds(lidarRingsNodeId, newConfig.GetRayRingIds())
Expand Down
Loading

0 comments on commit eeb69ed

Please sign in to comment.