diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100755 new mode 100644 index 945bdd1..a825404 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,11 +21,12 @@ find_package(std_msgs REQUIRED) find_package(rclcpp REQUIRED) find_package(builtin_interfaces REQUIRED) find_package(rosidl_default_generators REQUIRED) + rosidl_generate_interfaces(${PROJECT_NAME} "msg/RslidarPacket.msg" - "msg/RslidarScan.msg" DEPENDENCIES builtin_interfaces std_msgs ) + if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) # the following line skips the linter which checks for copyrights diff --git a/msg/RslidarPacket.msg b/msg/RslidarPacket.msg old mode 100755 new mode 100644 index 7136829..b6a05f5 --- a/msg/RslidarPacket.msg +++ b/msg/RslidarPacket.msg @@ -1,2 +1,4 @@ -builtin_interfaces/Time stamp -uint8[1248] data \ No newline at end of file +std_msgs/Header header +uint8 is_difop +uint8 is_frame_begin +uint8[] data diff --git a/msg/RslidarScan.msg b/msg/RslidarScan.msg deleted file mode 100755 index 58c0ca9..0000000 --- a/msg/RslidarScan.msg +++ /dev/null @@ -1,2 +0,0 @@ -std_msgs/Header header -RslidarPacket[] packets diff --git a/package.xml b/package.xml old mode 100755 new mode 100644 index 75d50e4..b8a8309 --- a/package.xml +++ b/package.xml @@ -2,10 +2,11 @@ rslidar_msg - 1.3.2 - Messages for the rslidar_sdk package + 0.0.0 + ros msgs for the rslidar_sdk project robosense BSD + ament_cmake std_msgs @@ -21,7 +22,7 @@ rosidl_default_runtime - rosidl_interface_packages +rosidl_interface_packages ament_cmake diff --git a/ros1/CMakeLists.txt b/ros1/CMakeLists.txt new file mode 100644 index 0000000..320fb43 --- /dev/null +++ b/ros1/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.5) +project(rslidar_msg) + +# Default to C99 +if(NOT CMAKE_C_STANDARD) + set(CMAKE_C_STANDARD 99) +endif() + +# 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 dependencies +find_package(std_msgs REQUIRED) + +find_package(catkin REQUIRED COMPONENTS + roscpp + std_msgs + sensor_msgs + message_generation + ) + +add_message_files(FILES + RslidarPacket.msg + ) + +generate_messages(DEPENDENCIES + std_msgs + sensor_msgs + ) + +catkin_package(CATKIN_DEPENDS + std_msgs + sensor_msgs + message_runtime + ) diff --git a/ros1/package.xml b/ros1/package.xml new file mode 100644 index 0000000..831a653 --- /dev/null +++ b/ros1/package.xml @@ -0,0 +1,22 @@ + + + + rslidar_msg + 0.0.0 + ros msgs for the rslidar_sdk project + robosense + BSD + + catkin + + roscpp + std_msgs + sensor_msgs + message_generation + + roscpp + std_msgs + sensor_msgs + message_runtime + + diff --git a/ros2/CMakeLists.txt b/ros2/CMakeLists.txt new file mode 100644 index 0000000..a825404 --- /dev/null +++ b/ros2/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.5) +project(rslidar_msg) + +# Default to C99 +if(NOT CMAKE_C_STANDARD) + set(CMAKE_C_STANDARD 99) +endif() + +# 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 dependencies +find_package(ament_cmake REQUIRED) +find_package(std_msgs REQUIRED) +find_package(rclcpp REQUIRED) +find_package(builtin_interfaces REQUIRED) +find_package(rosidl_default_generators REQUIRED) + +rosidl_generate_interfaces(${PROJECT_NAME} + "msg/RslidarPacket.msg" + DEPENDENCIES builtin_interfaces std_msgs + ) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + # the following line skips the linter which checks for copyrights + # uncomment the line when a copyright and license is not present in all source files + #set(ament_cmake_copyright_FOUND TRUE) + # the following line skips cpplint (only works in a git repo) + # uncomment the line when this package is not in a git repo + #set(ament_cmake_cpplint_FOUND TRUE) + ament_lint_auto_find_test_dependencies() +endif() + +ament_package() diff --git a/ros2/package.xml b/ros2/package.xml new file mode 100644 index 0000000..b8a8309 --- /dev/null +++ b/ros2/package.xml @@ -0,0 +1,29 @@ + + + + rslidar_msg + 0.0.0 + ros msgs for the rslidar_sdk project + robosense + BSD + + ament_cmake + + std_msgs + rclcpp + + ament_lint_auto + ament_lint_common + + builtin_interfaces + + builtin_interfaces + rosidl_default_generators + + rosidl_default_runtime + +rosidl_interface_packages + + ament_cmake + +