Skip to content
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

Nebula Hesai, beta version. #1

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# Modified from https://github.com/ament/ament_lint/blob/master/ament_clang_format/ament_clang_format/configuration/.clang-format
Language: Cpp
BasedOnStyle: Google

AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
BraceWrapping:
AfterClass: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
BreakBeforeBraces: Custom
ColumnLimit: 100
ConstructorInitializerIndentWidth: 0
ContinuationIndentWidth: 2
DerivePointerAlignment: false
PointerAlignment: Middle
ReflowComments: true
IncludeCategories:
# C++ system headers
- Regex: "<[a-z_]*>"
Priority: 6
CaseSensitive: true
# C system headers
- Regex: '<.*\.h>'
Priority: 5
CaseSensitive: true
# Boost headers
- Regex: "boost/.*"
Priority: 4
CaseSensitive: true
# Message headers
- Regex: ".*_msgs/.*"
Priority: 3
CaseSensitive: true
# Other Package headers
- Regex: "<.*>"
Priority: 2
CaseSensitive: true
# Local package headers
- Regex: '".*"'
Priority: 1
CaseSensitive: true
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# ros2-project-template
Project template for ROS2
# Nebula Lidar Driver

![DriverOrganization](doc/diagram.png)


1 change: 1 addition & 0 deletions build_depends.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repositories:
Binary file added doc/diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions messages/hesai_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
cmake_minimum_required(VERSION 3.5)
project(pandar_msgs)

if (NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif ()

if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif ()

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

rosidl_generate_interfaces(${PROJECT_NAME}
"msg/PandarPacket.msg"
"msg/PandarScan.msg"
"msg/PandarJumboPacket.msg"
DEPENDENCIES
std_msgs
)

if (BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif ()

ament_package()
3 changes: 3 additions & 0 deletions messages/hesai_msgs/msg/PandarJumboPacket.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
builtin_interfaces/Time stamp
uint8[] data
uint32 size
3 changes: 3 additions & 0 deletions messages/hesai_msgs/msg/PandarPacket.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
builtin_interfaces/Time stamp
uint8[1500] data
uint32 size
2 changes: 2 additions & 0 deletions messages/hesai_msgs/msg/PandarScan.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
std_msgs/Header header
PandarPacket[] packets
25 changes: 25 additions & 0 deletions messages/hesai_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0"?>
<package format="3">
<name>pandar_msgs</name>
<version>0.0.0</version>
<description>ROS message definition for the Heisai PandarQT/Pandar64/Pandar40P/Pandar20A/Pandar20B/Pandar40M LiDAR
sensor.
</description>
<maintainer email="shinnosuke.hirakawa@tier4.jp">hirakawa</maintainer>
<license>Apache 2</license>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>

<depend>std_msgs</depend>
<exec_depend>rosidl_default_runti)me</exec_depend>
<member_of_group>rosidl_interface_packages</member_of_group>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>

</package>
31 changes: 31 additions & 0 deletions messages/livox_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
cmake_minimum_required(VERSION 3.5)
project(livox_msgs)

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
"msg/LidarPacket.msg"
"msg/LidarScan.msg"
DEPENDENCIES std_msgs
DEPENDENCIES builtin_interfaces
#ADD_LINTER_TESTS
)

#if(BUILD_TESTING)
# find_package(ament_lint_auto REQUIRED)
# ament_lint_auto_find_test_dependencies()
#endif()

ament_package()
8 changes: 8 additions & 0 deletions messages/livox_msgs/msg/LidarPacket.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Raw LIDAR packet.

#time stamp
builtin_interfaces/Time stamp
uint8[] data # support for Jumbo frames
uint32 size # data[] size
uint64 time_stamp
int32 point_num
4 changes: 4 additions & 0 deletions messages/livox_msgs/msg/LidarScan.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Raw LIDAR scan.

std_msgs/Header header
LidarPacket[] packets
20 changes: 20 additions & 0 deletions messages/livox_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>livox_msgs</name>
<version>0.1.0</version>
<description>ROS message definitions for Livox Horizon.</description>
<maintainer email="sample@example.com">sample.test</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>

<exec_depend>rosidl_default_runtime</exec_depend>

<member_of_group>rosidl_interface_packages</member_of_group>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
61 changes: 61 additions & 0 deletions nebula_drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
cmake_minimum_required(VERSION 3.5)
project(nebula_lidar_driver)

# Default to C++14
if (NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif ()

if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -Wunused-function)
endif ()

find_package(ament_cmake_auto REQUIRED)
find_package(PCL REQUIRED COMPONENTS common)
find_package(PCL REQUIRED)
find_package(pcl_conversions REQUIRED)

ament_auto_find_build_dependencies()

include_directories(
include
${PCL_INCLUDE_DIRS}
${PCL_COMMON_INCLUDE_DIRS}
)

# HwInterfaces Lib
ament_auto_add_library(hesai_hw_interface SHARED
${CMAKE_CURRENT_SOURCE_DIR}/src/hesai/hesai_hw_interface.cpp
)
# RosHWInterface
ament_auto_add_library(hesai_hw_ros_wrapper SHARED
${CMAKE_CURRENT_SOURCE_DIR}/src/hesai/hesai_hw_interface_ros_wrapper.cpp
)
ament_auto_add_executable(hesai_hw_ros_wrapper_node
${CMAKE_CURRENT_SOURCE_DIR}/src/hesai/hesai_hw_interface_ros_main.cpp
)

# RosDriver Lib
ament_auto_add_library(hesai_driver SHARED
${CMAKE_CURRENT_SOURCE_DIR}/src/hesai/hesai_driver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/hesai/decoders/pandar_40_decoder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/hesai/decoders/pandar_64_decoder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/hesai/decoders/pandar_qt_decoder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/hesai/decoders/pandar_xt_decoder.cpp
)

# RosDriverNode
ament_auto_add_library(hesai_driver_ros_wrapper SHARED
${CMAKE_CURRENT_SOURCE_DIR}/src/hesai/hesai_driver_ros_wrapper.cpp
)
ament_auto_add_executable(hesai_driver_ros_wrapper_node
${CMAKE_CURRENT_SOURCE_DIR}/src/hesai/hesai_driver_ros_main.cpp
)

ament_auto_package(
INSTALL_TO_SHARE
launch
calibration
config
)

41 changes: 41 additions & 0 deletions nebula_drivers/calibration/hesai/Pandar40P.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Laser id,Elevation,Azimuth
1,14.794,-1.042
2,10.944,-1.042
3,7.971,-1.042
4,4.969,-1.042
5,2.952,-1.042
6,1.94,-1.042
7,1.6,3.125
8,1.263,-5.208
9,0.925,-1.042
10,0.587,3.125
11,0.249,-5.208
12,-0.088,-1.042
13,-0.425,3.125
14,-0.763,-5.208
15,-1.101,-1.042
16,-1.439,3.125
17,-1.776,-5.208
18,-2.116,-1.042
19,-2.453,3.125
20,-2.788,-5.208
21,-3.128,-1.042
22,-3.463,3.125
23,-3.8,-5.208
24,-4.138,-1.042
25,-4.473,3.125
26,-4.808,-5.208
27,-5.145,-1.042
28,-5.479,3.125
29,-5.814,-5.208
30,-6.149,-1.042
31,-7.151,-1.042
32,-8.147,-1.042
33,-9.148,-1.042
34,-10.133,-1.042
35,-11.12,-1.042
36,-12.094,-1.042
37,-13.062,-1.042
38,-14.018,-1.042
39,-18.977,-1.042
40,-24.985,-1.042
65 changes: 65 additions & 0 deletions nebula_drivers/calibration/hesai/Pandar64.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
Laser id,Elevation,Azimuth
1,14.9,-1.042
2,11.05,-1.042
3,8.077,-1.042
4,5.075,-1.042
5,3.058,-1.042
6,2.046,-1.042
7,1.878,1.042
8,1.706,3.125
9,1.54,5.208
10,1.369,-5.208
11,1.202,-3.125
12,1.031,-1.042
13,0.864,1.042
14,0.693,3.125
15,0.526,5.208
16,0.355,-5.208
17,0.187,-3.125
18,0.018,-1.042
19,-0.151,1.042
20,-0.319,3.125
21,-0.49,5.208
22,-0.657,-5.208
23,-0.827,-3.125
24,-0.995,-1.042
25,-1.166,1.042
26,-1.333,3.125
27,-1.504,5.208
28,-1.67,-5.208
29,-1.842,-3.125
30,-2.01,-1.042
31,-2.18,1.042
32,-2.347,3.125
33,-2.518,5.208
34,-2.682,-5.208
35,-2.855,-3.125
36,-3.022,-1.042
37,-3.192,1.042
38,-3.357,3.125
39,-3.53,5.208
40,-3.694,-5.208
41,-3.866,-3.125
42,-4.032,-1.042
43,-4.203,1.042
44,-4.367,3.125
45,-4.54,5.208
46,-4.702,-5.208
47,-4.874,-3.125
48,-5.039,-1.042
49,-5.211,1.042
50,-5.373,3.125
51,-5.547,5.208
52,-5.708,-5.208
53,-5.88,-3.125
54,-6.043,-1.042
55,-7.045,-1.042
56,-8.041,-1.042
57,-9.042,-1.042
58,-10.027,-1.042
59,-11.014,-1.042
60,-11.988,-1.042
61,-12.956,-1.042
62,-13.912,-1.042
63,-18.871,-1.042
64,-24.879,-1.042
Loading