From 73e470e1a03e9a247bd3114351abbf67f68c25a6 Mon Sep 17 00:00:00 2001 From: "ron.zheng" Date: Tue, 18 Jan 2022 11:27:03 +0800 Subject: [PATCH 1/3] refac: refactory rslidar_msg --- CMakeLists.txt | 3 ++- msg/RslidarPacket.msg | 6 ++++-- msg/RslidarScan.msg | 2 -- package.xml | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) mode change 100755 => 100644 msg/RslidarPacket.msg delete mode 100755 msg/RslidarScan.msg diff --git a/CMakeLists.txt b/CMakeLists.txt index 945bdd1..a825404 100755 --- 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 index 13791e1..b8a8309 100755 --- a/package.xml +++ b/package.xml @@ -3,9 +3,9 @@ rslidar_msg 0.0.0 - TODO: Package description + ros msgs for the rslidar_sdk project robosense - TODO: License declaration + BSD ament_cmake From cb27e818a21396d03369540d06e547d11021027b Mon Sep 17 00:00:00 2001 From: "ron.zheng" Date: Tue, 18 Jan 2022 14:43:04 +0800 Subject: [PATCH 2/3] refac: format --- CMakeLists.txt | 0 package.xml | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 CMakeLists.txt mode change 100755 => 100644 package.xml diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/package.xml b/package.xml old mode 100755 new mode 100644 From 6d515dbbd829e0345cc4e36d715d69dfba285ed6 Mon Sep 17 00:00:00 2001 From: "ron.zheng" Date: Tue, 18 Jan 2022 15:17:57 +0800 Subject: [PATCH 3/3] refac: generate msg files for ros1 --- ros1/CMakeLists.txt | 41 +++++++++++++++++++++++++++++++++++++++++ ros1/package.xml | 22 ++++++++++++++++++++++ ros2/CMakeLists.txt | 41 +++++++++++++++++++++++++++++++++++++++++ ros2/package.xml | 29 +++++++++++++++++++++++++++++ 4 files changed, 133 insertions(+) create mode 100644 ros1/CMakeLists.txt create mode 100644 ros1/package.xml create mode 100644 ros2/CMakeLists.txt create mode 100644 ros2/package.xml 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 + +