Skip to content

Commit 6d515db

Browse files
committed
refac: generate msg files for ros1
1 parent cb27e81 commit 6d515db

4 files changed

Lines changed: 133 additions & 0 deletions

File tree

ros1/CMakeLists.txt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
project(rslidar_msg)
3+
4+
# Default to C99
5+
if(NOT CMAKE_C_STANDARD)
6+
set(CMAKE_C_STANDARD 99)
7+
endif()
8+
9+
# Default to C++14
10+
if(NOT CMAKE_CXX_STANDARD)
11+
set(CMAKE_CXX_STANDARD 14)
12+
endif()
13+
14+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
15+
add_compile_options(-Wall -Wextra -Wpedantic)
16+
endif()
17+
18+
# find dependencies
19+
find_package(std_msgs REQUIRED)
20+
21+
find_package(catkin REQUIRED COMPONENTS
22+
roscpp
23+
std_msgs
24+
sensor_msgs
25+
message_generation
26+
)
27+
28+
add_message_files(FILES
29+
RslidarPacket.msg
30+
)
31+
32+
generate_messages(DEPENDENCIES
33+
std_msgs
34+
sensor_msgs
35+
)
36+
37+
catkin_package(CATKIN_DEPENDS
38+
std_msgs
39+
sensor_msgs
40+
message_runtime
41+
)

ros1/package.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0"?>
2+
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
<package format="3">
4+
<name>rslidar_msg</name>
5+
<version>0.0.0</version>
6+
<description>ros msgs for the rslidar_sdk project</description>
7+
<maintainer email="zdxiao@robosense.cn">robosense</maintainer>
8+
<license>BSD</license>
9+
10+
<buildtool_depend>catkin</buildtool_depend>
11+
12+
<build_depend>roscpp</build_depend>
13+
<build_depend>std_msgs</build_depend>
14+
<build_depend>sensor_msgs</build_depend>
15+
<build_depend>message_generation</build_depend>
16+
17+
<exec_depend>roscpp</exec_depend>
18+
<exec_depend>std_msgs</exec_depend>
19+
<exec_depend>sensor_msgs</exec_depend>
20+
<exec_depend>message_runtime</exec_depend>
21+
22+
</package>

ros2/CMakeLists.txt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
project(rslidar_msg)
3+
4+
# Default to C99
5+
if(NOT CMAKE_C_STANDARD)
6+
set(CMAKE_C_STANDARD 99)
7+
endif()
8+
9+
# Default to C++14
10+
if(NOT CMAKE_CXX_STANDARD)
11+
set(CMAKE_CXX_STANDARD 14)
12+
endif()
13+
14+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
15+
add_compile_options(-Wall -Wextra -Wpedantic)
16+
endif()
17+
18+
# find dependencies
19+
find_package(ament_cmake REQUIRED)
20+
find_package(std_msgs REQUIRED)
21+
find_package(rclcpp REQUIRED)
22+
find_package(builtin_interfaces REQUIRED)
23+
find_package(rosidl_default_generators REQUIRED)
24+
25+
rosidl_generate_interfaces(${PROJECT_NAME}
26+
"msg/RslidarPacket.msg"
27+
DEPENDENCIES builtin_interfaces std_msgs
28+
)
29+
30+
if(BUILD_TESTING)
31+
find_package(ament_lint_auto REQUIRED)
32+
# the following line skips the linter which checks for copyrights
33+
# uncomment the line when a copyright and license is not present in all source files
34+
#set(ament_cmake_copyright_FOUND TRUE)
35+
# the following line skips cpplint (only works in a git repo)
36+
# uncomment the line when this package is not in a git repo
37+
#set(ament_cmake_cpplint_FOUND TRUE)
38+
ament_lint_auto_find_test_dependencies()
39+
endif()
40+
41+
ament_package()

ros2/package.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0"?>
2+
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
<package format="3">
4+
<name>rslidar_msg</name>
5+
<version>0.0.0</version>
6+
<description>ros msgs for the rslidar_sdk project</description>
7+
<maintainer email="zdxiao@robosense.cn">robosense</maintainer>
8+
<license>BSD</license>
9+
10+
<buildtool_depend>ament_cmake</buildtool_depend>
11+
12+
<depend>std_msgs</depend>
13+
<depend>rclcpp</depend>
14+
15+
<test_depend>ament_lint_auto</test_depend>
16+
<test_depend>ament_lint_common</test_depend>
17+
18+
<build_depend>builtin_interfaces</build_depend>
19+
20+
<exec_depend>builtin_interfaces</exec_depend>
21+
<build_depend>rosidl_default_generators</build_depend>
22+
23+
<exec_depend>rosidl_default_runtime</exec_depend>
24+
25+
<member_of_group>rosidl_interface_packages</member_of_group>
26+
<export>
27+
<build_type>ament_cmake</build_type>
28+
</export>
29+
</package>

0 commit comments

Comments
 (0)