Velodyne 32 support
Hello,
I would like to get my Velodyne 32 layers LiDAR to work with Apollo. I am trying to modify the Velodyne 64 driver to get it to run with the 32.
I have modified the calibration file and the packet_rate in driver64.cpp.
I am capable to build the driver with ./apollo.sh build_velodyne and launch it with ./script/velodyne.sh.
I can see data packets when echoing /apollo/sensor/velodyne64/VelodyneScanUnified but nothing is published on /apollo/sensor/velodyne64/PointCloud2 and
/apollo/sensor/velodyne64/compensator/PointCloud2. I believe the conversion of the data packets to a pointcloud is failing.
In the log file data/log/velodyne.out I see the following error,
/apollo/modules/drivers/velodyne/velodyne_pointcloud/src/lib/online_calibration.cpp:41 drivers::velodyne::OnlineCalibration::decode() [ERROR] [1519243003.123877622]: unit count less than 2, maybe lost packets
1. Would you know what my problem is here ? Do I need to modify velodyne_pointcloud/src/lib/online_calibration.cpp ?
2. Could you give me directions to help me get a driver that work for the Velodyne 32.
$ git status
On branch r2.0.0
Your branch is up-to-date with 'origin/r2.0.0'.
Please feel free to ask for details if my question is not clear enough. Thank you.
Hi, I've also build apollo with branch r2.0.0, but I got an error messages when bash apollo.sh build_velodyne.
/apollo/modules/drivers/velodyne/velodyne_driver/src/driver/driver16.cpp: In constructor 'apollo::drivers::velodyne::Velodyne16Driver::Velodyne16Driver(apollo::drivers::velodyne::Config)':
/apollo/modules/drivers/velodyne/velodyne_driver/src/driver/driver16.cpp:29:53: error: class 'apollo::drivers::velodyne::Velodyne16Driver' does not have any field named 'config_'
Velodyne16Driver::Velodyne16Driver(Config config) : config_(config) {}
^
/apollo/modules/drivers/velodyne/velodyne_driver/src/driver/driver16.cpp: In constructor 'apollo::drivers::velodyne::Velodyne16Driver::Velodyne16Driver(apollo::drivers::velodyne::Config)':
/apollo/modules/drivers/velodyne/velodyne_driver/src/driver/driver16.cpp:29:53: error: class 'apollo::drivers::velodyne::Velodyne16Driver' does not have any field named 'config_'
Velodyne16Driver::Velodyne16Driver(Config config) : config_(config) {}
^
make[2]: *** [src/driver/CMakeFiles/driver_node.dir/driver16.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [src/driver/CMakeFiles/driver_nodelet.dir/driver16.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [src/driver/CMakeFiles/driver_node.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [src/driver/CMakeFiles/driver_nodelet.dir/all] Error 2
make: *** [all] Error 2
Thank you apollo smart engineers!
@ytzhao I answered your question in the issue you posted (#3039).
Is there anyone that can help me with my original issue ? @fengqikai1414 ?
When I try to set velodyne64_calibration_online to false, all I get is this info message,
/apollo/modules/drivers/velodyne/velodyne_pointcloud/src/lib/velodyne64_parser.cpp:92 drivers::velodyne::Velodyne64Parser::set_base_time_from_packets() [ INFO] [1519759273.211043898]: Get base time from packets. Obtained (-1.-1.-1 -1:-1:-1)
I have managed to solve my issue by setting the year, month, day, hour, minute and second to values superior to 0, and removing the condition status_type == GPS_STATUS from the if line 102 of file velodyne64_parser.cpp.
I am now capable to receive PointCloud2 data and visualize it with rviz. Although, I would be curious to know more about the potential impact of my modifications and the reason the condition line 102 is necessary. Thank you.
Since you removed the GPS timestamps. The point cloud will not be properly compensated for the motion of the vehicle. We don't recommend doing this.
Ok, I will try to find a workaround. Thank you for your answer.