-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add support pcl::PointXYZRGBA to pcl::VLPGrabber #1738
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
Changes from all commits
0dc4b89
3890526
01a0580
9a1fd94
247b9a7
b2c6171
6356cdd
e1b1ffd
7ee3a46
d1f83af
6f8d29b
3cec989
8781bf2
a1812b8
9e30f2b
c9fcf03
a7ae658
b92b889
a7dc6c1
306d52e
c6cb00a
083d773
fab466a
c0b57c4
25d7410
49846a8
9c3e885
dee716b
d96dadf
ec343f3
efd185a
604fed2
3d290f4
c73e3bc
b21089e
b10cbf7
d1c5d61
9cdb13c
feb9aed
e6dc203
02ea42f
fb81ea7
30f1d1e
1b99600
f8e393c
85aafed
d41eb78
b554eb1
d3ef467
37770bc
d7cace0
ce16c96
b5ea7ab
8ee6906
58450b6
c48bc41
4a8289f
f6a386c
3467a07
fa61870
bc0a1f9
3c61343
d087575
3c49a12
a4348ba
8421caa
fddb045
8172e1b
3b6863c
bc88ccf
cb71ee0
d0ba6b8
b6c2a56
d0ab51a
60285f4
dd1f578
00ad593
358e529
757f7cf
f3c4267
6284a2f
a1c711a
00eba31
1241584
6e5b869
a288b0f
1eda467
5206199
52d4b33
15e630f
559cb48
43a521f
ddaecd4
ac9bda3
fe9e2a6
d272f34
b3ca468
2b3cec8
7122a95
7a7b2ab
98d7616
2cc0504
9a214ff
4342798
08db9e7
3c85ce1
7043ce9
10f050f
ccffcf0
b86e8aa
1f747ea
41f769e
ec497fc
3c351d0
58da629
2f5b46f
41f6478
47909ea
93cf404
20ffd71
d19a432
5a1d189
0f8de92
61bc4bb
3379479
a62bfb5
27597c0
ad7ee0d
a66279d
8c6076a
b087384
916a726
4ea1492
da477c3
762da26
1af9c8a
c72ff75
ce648bb
fdad51c
5b6bdbf
7680abc
1afb02c
5cc132e
4849510
d57415c
48939b8
b984f8a
188805a
7569afe
7220bd1
6074c44
0d7de23
b576145
1d5ef3d
15ccf4b
d5b88e0
4356ff5
2c60389
c75d3cf
c6cde56
ebbd3a3
4417b58
c2267a1
73fc141
644cfe0
a4ade39
bb6f625
0c3a292
2e5b5bb
c0c7375
c70fcec
ad74950
5b0ad59
f5d3ee5
90aba59
8c784c7
74d6745
846d5a4
4088d72
9792a9e
4c67d81
8c73bb7
d85e31c
d2da0f3
508f200
a587697
e4cc743
28345dd
8b027d9
3fe2dd5
fb39b13
664bd29
57a26df
de00778
2dc19fc
59fcebd
83b8dfe
04e26cb
0dd1d06
3739b90
b1be693
51cadfe
a836751
956c468
b0c5e01
280259f
3fe588d
9ab6359
1a399eb
4a700f3
870f6ed
2e0b9fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,38 +67,49 @@ namespace pcl | |
(sig_cb_velodyne_hdl_scan_point_cloud_xyz) (const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >&, | ||
float, | ||
float); | ||
|
||
/** \brief Signal used for a single sector | ||
* Represents 1 corrected packet from the HDL Velodyne. Each laser has a different RGB | ||
*/ | ||
typedef void | ||
(sig_cb_velodyne_hdl_scan_point_cloud_xyzrgb) (const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZRGBA> >&, | ||
float, | ||
float); | ||
(sig_cb_velodyne_hdl_scan_point_cloud_xyzrgba) (const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZRGBA> >&, | ||
float, | ||
float); | ||
|
||
typedef PCL_DEPRECATED ("Use 'sig_cb_velodyne_hdl_scan_point_cloud_xyzrgba' instead") | ||
sig_cb_velodyne_hdl_scan_point_cloud_xyzrgba sig_cb_velodyne_hdl_scan_point_cloud_xyzrgb; | ||
|
||
/** \brief Signal used for a single sector | ||
* Represents 1 corrected packet from the HDL Velodyne with the returned intensity. | ||
*/ | ||
typedef void | ||
(sig_cb_velodyne_hdl_scan_point_cloud_xyzi) (const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZI> >&, | ||
float startAngle, | ||
float); | ||
|
||
/** \brief Signal used for a 360 degree sweep | ||
* Represents multiple corrected packets from the HDL Velodyne | ||
* This signal is sent when the Velodyne passes angle "0" | ||
*/ | ||
typedef void | ||
(sig_cb_velodyne_hdl_sweep_point_cloud_xyz) (const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >&); | ||
|
||
/** \brief Signal used for a 360 degree sweep | ||
* Represents multiple corrected packets from the HDL Velodyne with the returned intensity | ||
* This signal is sent when the Velodyne passes angle "0" | ||
*/ | ||
typedef void | ||
(sig_cb_velodyne_hdl_sweep_point_cloud_xyzi) (const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZI> >&); | ||
|
||
/** \brief Signal used for a 360 degree sweep | ||
* Represents multiple corrected packets from the HDL Velodyne | ||
* This signal is sent when the Velodyne passes angle "0". Each laser has a different RGB | ||
*/ | ||
typedef void | ||
(sig_cb_velodyne_hdl_sweep_point_cloud_xyzrgb) (const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZRGBA> >&); | ||
(sig_cb_velodyne_hdl_sweep_point_cloud_xyzrgba) (const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZRGBA> >&); | ||
|
||
typedef PCL_DEPRECATED ("Use 'sig_cb_velodyne_hdl_sweep_point_cloud_xyzrgba' instead") | ||
sig_cb_velodyne_hdl_sweep_point_cloud_xyzrgba sig_cb_velodyne_hdl_sweep_point_cloud_xyzrgb; | ||
|
||
/** \brief Constructor taking an optional path to an HDL corrections file. The Grabber will listen on the default IP/port for data packets [192.168.3.255/2368] | ||
* \param[in] correctionsFile Path to a file which contains the correction parameters for the HDL. This parameter is mandatory for the HDL-64, optional for the HDL-32 | ||
|
@@ -113,7 +124,7 @@ namespace pcl | |
* \param[in] correctionsFile Path to a file which contains the correction parameters for the HDL. This field is mandatory for the HDL-64, optional for the HDL-32 | ||
*/ | ||
HDLGrabber (const boost::asio::ip::address& ipAddress, | ||
const unsigned short port, | ||
const uint16_t port, | ||
const std::string& correctionsFile = ""); | ||
|
||
/** \brief virtual Destructor inherited from the Grabber interface. It never throws. */ | ||
|
@@ -150,13 +161,25 @@ namespace pcl | |
*/ | ||
void | ||
filterPackets (const boost::asio::ip::address& ipAddress, | ||
const unsigned short port = 443); | ||
const uint16_t port = 443); | ||
|
||
/** \brief Allows one to customize the colors used for each of the lasers. | ||
/** \brief Allows one to customize the colors used by each laser. | ||
* \param[in] color RGB color to set | ||
* \param[in] laserNumber Number of laser to set color | ||
*/ | ||
void | ||
setLaserColorRGB (const pcl::RGB& color, | ||
unsigned int laserNumber); | ||
const uint8_t laserNumber); | ||
|
||
/** \brief Allows one to customize the colors used for each of the lasers. | ||
* \param[in] begin begin iterator of RGB color array | ||
* \param[in] end end iterator of RGB color array | ||
*/ | ||
template<typename IterT> void | ||
setLaserColorRGB (const IterT& begin, const IterT& end) | ||
{ | ||
std::copy (begin, end, laser_rgb_mapping_); | ||
} | ||
|
||
/** \brief Any returns from the HDL with a distance less than this are discarded. | ||
* This value is in meters | ||
|
@@ -183,12 +206,17 @@ namespace pcl | |
float | ||
getMaximumDistanceThreshold (); | ||
|
||
/** \brief Returns the maximum number of lasers | ||
*/ | ||
static uint8_t | ||
getMaximumNumberOfLasers (); | ||
|
||
protected: | ||
static const int HDL_DATA_PORT = 2368; | ||
static const int HDL_NUM_ROT_ANGLES = 36001; | ||
static const int HDL_LASER_PER_FIRING = 32; | ||
static const int HDL_MAX_NUM_LASERS = 64; | ||
static const int HDL_FIRING_PER_PKT = 12; | ||
static const uint16_t HDL_DATA_PORT = 2368; | ||
static const uint16_t HDL_NUM_ROT_ANGLES = 36001; | ||
static const uint8_t HDL_LASER_PER_FIRING = 32; | ||
static const uint8_t HDL_MAX_NUM_LASERS = 64; | ||
static const uint8_t HDL_FIRING_PER_PKT = 12; | ||
|
||
enum HDLBlock | ||
{ | ||
|
@@ -198,24 +226,24 @@ namespace pcl | |
#pragma pack(push, 1) | ||
typedef struct HDLLaserReturn | ||
{ | ||
unsigned short distance; | ||
unsigned char intensity; | ||
uint16_t distance; | ||
uint8_t intensity; | ||
} HDLLaserReturn; | ||
#pragma pack(pop) | ||
|
||
struct HDLFiringData | ||
{ | ||
unsigned short blockIdentifier; | ||
unsigned short rotationalPosition; | ||
uint16_t blockIdentifier; | ||
uint16_t rotationalPosition; | ||
HDLLaserReturn laserReturns[HDL_LASER_PER_FIRING]; | ||
}; | ||
|
||
struct HDLDataPacket | ||
{ | ||
HDLFiringData firingData[HDL_FIRING_PER_PKT]; | ||
unsigned int gpsTimestamp; | ||
unsigned char mode; | ||
unsigned char sensorType; | ||
uint32_t gpsTimestamp; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be better to bump this to 64 bits. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the manual, GPS time stamp is 4 bytes (32 bits). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just assumed it was gonna be a big number. 32 bits it is then. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will adopt 32 bits according to the manual. (It is the same bit width as before.) |
||
uint8_t mode; | ||
uint8_t sensorType; | ||
}; | ||
|
||
struct HDLLaserCorrection | ||
|
@@ -232,37 +260,37 @@ namespace pcl | |
}; | ||
|
||
HDLLaserCorrection laser_corrections_[HDL_MAX_NUM_LASERS]; | ||
unsigned int last_azimuth_; | ||
uint16_t last_azimuth_; | ||
boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> > current_scan_xyz_, current_sweep_xyz_; | ||
boost::shared_ptr<pcl::PointCloud<pcl::PointXYZI> > current_scan_xyzi_, current_sweep_xyzi_; | ||
boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBA> > current_scan_xyzrgb_, current_sweep_xyzrgb_; | ||
boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBA> > current_scan_xyzrgba_, current_sweep_xyzrgba_; | ||
boost::signals2::signal<sig_cb_velodyne_hdl_sweep_point_cloud_xyz>* sweep_xyz_signal_; | ||
boost::signals2::signal<sig_cb_velodyne_hdl_sweep_point_cloud_xyzrgb>* sweep_xyzrgb_signal_; | ||
boost::signals2::signal<sig_cb_velodyne_hdl_sweep_point_cloud_xyzrgba>* sweep_xyzrgba_signal_; | ||
boost::signals2::signal<sig_cb_velodyne_hdl_sweep_point_cloud_xyzi>* sweep_xyzi_signal_; | ||
boost::signals2::signal<sig_cb_velodyne_hdl_scan_point_cloud_xyz>* scan_xyz_signal_; | ||
boost::signals2::signal<sig_cb_velodyne_hdl_scan_point_cloud_xyzrgb>* scan_xyzrgb_signal_; | ||
boost::signals2::signal<sig_cb_velodyne_hdl_scan_point_cloud_xyzrgba>* scan_xyzrgba_signal_; | ||
boost::signals2::signal<sig_cb_velodyne_hdl_scan_point_cloud_xyzi>* scan_xyzi_signal_; | ||
|
||
void | ||
fireCurrentSweep (); | ||
|
||
void | ||
fireCurrentScan (const unsigned short startAngle, | ||
const unsigned short endAngle); | ||
fireCurrentScan (const uint16_t startAngle, | ||
const uint16_t endAngle); | ||
void | ||
computeXYZI (pcl::PointXYZI& pointXYZI, | ||
int azimuth, | ||
uint16_t azimuth, | ||
HDLLaserReturn laserReturn, | ||
HDLLaserCorrection correction); | ||
|
||
|
||
private: | ||
static double *cos_lookup_table_; | ||
static double *sin_lookup_table_; | ||
pcl::SynchronizedQueue<unsigned char *> hdl_data_; | ||
pcl::SynchronizedQueue<uint8_t *> hdl_data_; | ||
boost::asio::ip::udp::endpoint udp_listener_endpoint_; | ||
boost::asio::ip::address source_address_filter_; | ||
unsigned short source_port_filter_; | ||
uint16_t source_port_filter_; | ||
boost::asio::io_service hdl_read_socket_service_; | ||
boost::asio::ip::udp::socket *hdl_read_socket_; | ||
std::string pcap_file_name_; | ||
|
@@ -286,7 +314,7 @@ namespace pcl | |
processVelodynePackets (); | ||
|
||
void | ||
enqueueHDLPacket (const unsigned char *data, | ||
enqueueHDLPacket (const uint8_t *data, | ||
std::size_t bytesReceived); | ||
|
||
void | ||
|
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.
Same comment as above.
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.
Add PCL_DEPRECATED