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

Delete build.sh & merge ROS1/2 into one package #46

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.vscode
build
package.xml
__pycache__
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# judge which cmake codes to use
if(ROS_EDITION STREQUAL "ROS1")
if($ENV{ROS_VERSION} STREQUAL "1")

# Copyright(c) 2019 livoxtech limited.

Expand Down Expand Up @@ -184,7 +184,7 @@ if(ROS_EDITION STREQUAL "ROS1")
#---------------------------------------------------------------------------------------


else(ROS_EDITION STREQUAL "ROS2")
else($ENV{ROS_VERSION} STREQUAL "2")

# Copyright(c) 2020 livoxtech limited.

Expand Down Expand Up @@ -282,14 +282,14 @@ else(ROS_EDITION STREQUAL "ROS2")
target_include_directories(${PROJECT_NAME} PRIVATE ${livox_sdk_INCLUDE_DIRS})

# get include directories of custom msg headers
if(HUMBLE_ROS STREQUAL "humble")
rosidl_get_typesupport_target(cpp_typesupport_target
${LIVOX_INTERFACES} "rosidl_typesupport_cpp")
target_link_libraries(${PROJECT_NAME} "${cpp_typesupport_target}")
else()
if($ENV{ROS_DISTRO} STREQUAL "foxy")
set(LIVOX_INTERFACE_TARGET "${LIVOX_INTERFACES}__rosidl_typesupport_cpp")
add_dependencies(${PROJECT_NAME} ${LIVOX_INTERFACES})
get_target_property(LIVOX_INTERFACES_INCLUDE_DIRECTORIES ${LIVOX_INTERFACE_TARGET} INTERFACE_INCLUDE_DIRECTORIES)
else()
rosidl_get_typesupport_target(cpp_typesupport_target
${LIVOX_INTERFACES} "rosidl_typesupport_cpp")
target_link_libraries(${PROJECT_NAME} "${cpp_typesupport_target}")
endif()

# include file direcotry
Expand Down
19 changes: 3 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,9 @@ git clone https://github.com/Livox-SDK/livox_ros_driver2.git ws_livox/src/livox_

### 2.3 Build the Livox ROS Driver 2:

#### For ROS (take Noetic as an example):
```shell
source /opt/ros/noetic/setup.sh
./build.sh ROS1
```

#### For ROS2 Foxy:
```shell
source /opt/ros/foxy/setup.sh
./build.sh ROS2
```

#### For ROS2 Humble:
```shell
source /opt/ros/humble/setup.sh
./build.sh humble
```bash
rosdep install --from-paths src --ignore-src -y
colcon build --symlink-install
```

### 2.4 Run Livox ROS Driver 2:
Expand Down
70 changes: 0 additions & 70 deletions build.sh

This file was deleted.

45 changes: 45 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0"?>
<package format="3">
<name>livox_ros_driver2</name>
<version>1.0.0</version>
<description>The ROS device driver for Livox 3D LiDARs</description>
<maintainer email="[email protected]">feng</maintainer>
<license>MIT</license>

<!-- Common ROS 1 / ROS 2 dependencies -->
<build_depend>ros_environment</build_depend>

<!-- ROS1 dependencies -->
<buildtool_depend condition="$ROS_VERSION == 1">catkin</buildtool_depend>
<depend condition="$ROS_VERSION == 1">roscpp</depend>
<depend condition="$ROS_VERSION == 1">rospy</depend>
<depend condition="$ROS_VERSION == 1">message_generation</depend>
<exec_depend condition="$ROS_VERSION == 1">message_runtime</exec_depend>
<exec_depend condition="$ROS_VERSION == 1">rosbag</exec_depend>

<!-- ROS2 dependencies -->
<buildtool_depend condition="$ROS_VERSION == 2">ament_cmake_auto</buildtool_depend>
<build_depend condition="$ROS_VERSION == 2">rosidl_default_generators</build_depend>
<member_of_group condition="$ROS_VERSION == 2">rosidl_interface_packages</member_of_group>
<depend condition="$ROS_VERSION == 2">rclcpp</depend>
<depend condition="$ROS_VERSION == 2">rclcpp_components</depend>
<depend condition="$ROS_VERSION == 2">rcl_interfaces</depend>
<depend condition="$ROS_VERSION == 2">rcutils</depend>
<exec_depend condition="$ROS_VERSION == 2">rosbag2</exec_depend>
<exec_depend condition="$ROS_VERSION == 2">rosidl_default_runtime</exec_depend>
<test_depend condition="$ROS_VERSION == 2">ament_lint_auto</test_depend>
<test_depend condition="$ROS_VERSION == 2">ament_lint_common</test_depend>

<!-- ROS1/2 dependencies -->
<depend>std_msgs</depend>
<depend>sensor_msgs</depend>
<depend>pcl_conversions</depend>
<depend>pcl_ros</depend>
<depend>git</depend>
<depend>apr</depend>

<export>
<build_type condition="$ROS_VERSION == 2">ament_cmake</build_type>
<build_type condition="$ROS_VERSION == 1">catkin</build_type>
</export>
</package>
82 changes: 0 additions & 82 deletions package_ROS1.xml

This file was deleted.

35 changes: 0 additions & 35 deletions package_ROS2.xml

This file was deleted.