Skip to content

Commit

Permalink
Merge pull request #291 from tier4/feature/rgl-hesai-xt32-raw-packets
Browse files Browse the repository at this point in the history
Add raw packets support for Hesai Pandar XT32
  • Loading branch information
mackierx111 authored May 8, 2024
2 parents b3f34da + 2112b69 commit f275dae
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
33 changes: 33 additions & 0 deletions Assets/RGLUnityPlugin/NebulaCalibrations/PandarXT32.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Channel,Elevation,Azimuth
1,15.0,0.0
2,14.0,0.0
3,13.0,0.0
4,12.0,0.0
5,11.0,0.0
6,10.0,0.0
7,9.0,0.0
8,8.0,0.0
9,7.0,0.0
10,6.0,0.0
11,5.0,0.0
12,4.0,0.0
13,3.0,0.0
14,2.0,0.0
15,1.0,0.0
16,0.0,0.0
17,-1.0,0.0
18,-2.0,0.0
19,-3.0,0.0
20,-4.0,0.0
21,-5.0,0.0
22,-6.0,0.0
23,-7.0,0.0
24,-8.0,0.0
25,-9.0,0.0
26,-10.0,0.0
27,-11.0,0.0
28,-12.0,0.0
29,-13.0,0.0
30,-14.0,0.0
31,-15.0,0.0
32,-16.0,0.0
3 changes: 3 additions & 0 deletions Assets/RGLUnityPlugin/NebulaCalibrations/PandarXT32.csv.meta

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

14 changes: 11 additions & 3 deletions Assets/RGLUnityPlugin/Scripts/LidarUdpPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public class LidarUdpPublisher : MonoBehaviour
{ LidarModel.HesaiPandar40P, RGLLidarModel.RGL_HESAI_PANDAR_40P },
{ LidarModel.HesaiPandarQT, RGLLidarModel.RGL_HESAI_PANDAR_QT64 },
{ LidarModel.HesaiQT128C2X, RGLLidarModel.RGL_HESAI_QT128C2X },
{ LidarModel.HesaiPandar128E4X, RGLLidarModel.RGL_HESAI_PANDAR_128E4X }
{ LidarModel.HesaiPandar128E4X, RGLLidarModel.RGL_HESAI_PANDAR_128E4X },
{ LidarModel.HesaiPandarXT32, RGLLidarModel.RGL_HESAI_PANDAR_XT32 }
};

// Note: When selecting dual return mode, there will be still single return data but packed in the dual return packet format
Expand All @@ -88,7 +89,9 @@ public class LidarUdpPublisher : MonoBehaviour
RGLReturnMode.DualReturnStrongestSecondStrongest, RGLReturnMode.DualReturnFirstSecond } },
{ LidarModel.HesaiPandar128E4X, new List<RGLReturnMode>()
{ RGLReturnMode.SingleReturnFirst, RGLReturnMode.SingleReturnStrongest, RGLReturnMode.SingleReturnLast,
RGLReturnMode.DualReturnLastStrongest, RGLReturnMode.DualReturnFirstLast, RGLReturnMode.DualReturnFirstStrongest } }
RGLReturnMode.DualReturnLastStrongest, RGLReturnMode.DualReturnFirstLast, RGLReturnMode.DualReturnFirstStrongest } },
{ LidarModel.HesaiPandarXT32, new List<RGLReturnMode>()
{ RGLReturnMode.SingleReturnStrongest, RGLReturnMode.SingleReturnLast, RGLReturnMode.DualReturnLastStrongest } },
};

private bool IsVelodyne(LidarModel model)
Expand All @@ -102,6 +105,7 @@ private bool IsHesai(LidarModel model)
{
return model == LidarModel.HesaiPandar40P ||
model == LidarModel.HesaiPandarQT ||
model == LidarModel.HesaiPandarXT32 ||
model == LidarModel.HesaiQT128C2X ||
model == LidarModel.HesaiPandar128E4X;
}
Expand Down Expand Up @@ -276,7 +280,11 @@ private RGLUdpOptions GetUdpOptions(LidarModel currentLidarModel)
enableHesaiUdpSequence = false;
Debug.LogWarning($"{name}: enableHesaiUdpSequence option is not available for selected LiDAR model. Disabling option...");
}
if ((currentLidarModel == LidarModel.HesaiQT128C2X || currentLidarModel == LidarModel.HesaiPandar128E4X) && !enableHesaiUdpSequence)
// LiDARs that need udp sequence flag to be set
if ((currentLidarModel == LidarModel.HesaiQT128C2X
|| currentLidarModel == LidarModel.HesaiPandar128E4X
|| currentLidarModel == LidarModel.HesaiPandarXT32)
&& !enableHesaiUdpSequence)
{
enableHesaiUdpSequence = true;
Debug.LogWarning($"{name}: enableHesaiUdpSequence option must be enabled for selected LiDAR model. Enabling option...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public enum RGLLidarModel : Int32
RGL_HESAI_PANDAR_QT64 = 5,
RGL_HESAI_QT128C2X = 6,
RGL_HESAI_PANDAR_128E4X = 7,
RGL_HESAI_PANDAR_XT32 = 8,
};

// Items have been renamed to be displayed in Unity nicer.
Expand Down

0 comments on commit f275dae

Please sign in to comment.