Skip to content

Commit

Permalink
upgrade everything to work with simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
S1ink committed Oct 15, 2024
1 parent ad22c53 commit b0d438d
Show file tree
Hide file tree
Showing 13 changed files with 1,825 additions and 1,873 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:

- uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: humble
required-ros-distributions: jazzy

- uses: ros-tooling/action-ros-ci@v0.3
with:
package-name: sick_perception
target-ros2-distro: humble
target-ros2-distro: jazzy
colcon-extra-args: --event-handler console_direct+

# - name: "Get PCL"
Expand Down
29 changes: 17 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ if(${sickperception_VSCODE_CONFIGURE}) # this is just a dummy configuration so v
find_package(sensor_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2_sensor_msgs REQUIRED)
find_package(pcl_conversions REQUIRED)

find_package(PCL REQUIRED COMPONENTS common filters, octree)
Expand Down Expand Up @@ -80,16 +82,16 @@ if(${sickperception_VSCODE_CONFIGURE}) # this is just a dummy configuration so v
list(APPEND ldrp_sources "${ldrp_src}/main.cpp" "${ldrp_src}/ldrp/perception.cpp")
list(APPEND ldrp_includedirs)

add_executable(ldrp_node ${ldrp_sources})
add_executable(${PROJECT_NAME} ${ldrp_sources})

target_include_directories(ldrp_node
target_include_directories(${PROJECT_NAME}
PRIVATE ${PCL_INCLUDE_DIRS}
PRIVATE ${ldrp_includedirs})
target_link_directories(ldrp_node
target_link_directories(${PROJECT_NAME}
PRIVATE ${PCL_LIBRARY_DIRS})
target_link_libraries(ldrp_node
target_link_libraries(${PROJECT_NAME}
${PCL_LIBRARIES}) # PRIVATE here causes conflicts with ament_target_dependencies
target_compile_definitions(ldrp_node
target_compile_definitions(${PROJECT_NAME}
PRIVATE ${ldrp_defines}
PRIVATE ${PCL_DEFINITIONS})

Expand All @@ -102,6 +104,8 @@ else()
find_package(sensor_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2_sensor_msgs REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(pcl_ros REQUIRED)
# find_package(tf2_msgs REQUIRED)
Expand Down Expand Up @@ -189,30 +193,31 @@ endif()
list(APPEND ldrp_sources "${ldrp_src}/main.cpp" "${ldrp_src}/ldrp/perception.cpp")
list(APPEND ldrp_includedirs)

add_executable(ldrp_node ${ldrp_sources})
add_executable(${PROJECT_NAME} ${ldrp_sources})

target_include_directories(ldrp_node
target_include_directories(${PROJECT_NAME}
PRIVATE ${PCL_INCLUDE_DIRS}
PRIVATE ${ldrp_includedirs})
target_link_directories(ldrp_node
target_link_directories(${PROJECT_NAME}
PRIVATE ${PCL_LIBRARY_DIRS})
target_link_libraries(ldrp_node
target_link_libraries(${PROJECT_NAME}
${PCL_LIBRARIES}) # PRIVATE here causes conflicts with ament_target_dependencies
target_compile_definitions(ldrp_node
target_compile_definitions(${PROJECT_NAME}
PRIVATE ${ldrp_defines}
PRIVATE ${PCL_DEFINITIONS})

ament_target_dependencies(ldrp_node
ament_target_dependencies(${PROJECT_NAME}
"rclcpp"
"pcl_conversions"
"pcl_ros"
"tf2_ros"
"tf2_sensor_msgs"
"nav_msgs"
"sensor_msgs"
"geometry_msgs")

install(
TARGETS ldrp_node
TARGETS ${PROJECT_NAME}
DESTINATION lib/${PROJECT_NAME})
install(
DIRECTORY config launch
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![CI](https://github.com/Cardinal-Space-Mining/Sick-Perception/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Cardinal-Space-Mining/Sick-Perception/actions/workflows/ci.yml)

# Sick-Perception
*Don't be fooled, this is actually a mapping package!*

## ⚠️ IMPORTANT ⚠️
Previous versions (branches) of this project were architected to be standalone "pure-C++" modules, however, __this branch has been updated to target ROS\[2\], and offloads sensor interfacing and localization pipeline prerequisites to various external ROS packages__, which are discuessed below. To view the old architecture, check out the [perception-v1](/Cardinal-Space-Mining/Sick-Perception/tree/perception-v1) and/or [perception-v2](/Cardinal-Space-Mining/Sick-Perception/tree/perception-v2) branches. These branches are not likely to be maintained, and as a result may not reflect the same functionality as this branch in the future.
Expand Down
7 changes: 5 additions & 2 deletions config/params.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/**:
ros__parameters:

scan_matching_history_s: 0.25
scan_topic: "/cardinal_perception/filtered_scan"

max_tf_wait_time_s: 0.25

map_resolution_cm: 5.0
voxel_size_cm: 3.0
Expand All @@ -16,4 +18,5 @@
pmf_max_distance_cm: 12.0
pmf_slope: 2.0

output_frame: "world"
map_frame: "map"
lidar_frame: "lidar_link"
44 changes: 0 additions & 44 deletions launch/ldrp.launch.py

This file was deleted.

32 changes: 32 additions & 0 deletions launch/sick_perception.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import os

from ament_index_python.packages import get_package_share_directory

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


def generate_launch_description():

pkg_path = get_package_share_directory('sick_perception')
param_file = os.path.join(pkg_path, 'config', 'params.yaml')

use_sim_time = LaunchConfiguration('use_sim_time', default='false')

map_node = Node(
name = 'sick_perception',
package = 'sick_perception',
executable = 'sick_perception',
output = 'screen',
parameters = [param_file, {'use_sim_time': use_sim_time}],
remappings = [
('obstacle_grid', '/sick_perception/obstacle_grid')
]
)

return LaunchDescription([
DeclareLaunchArgument('use_sim_time', default_value='false'),
map_node
])
4 changes: 3 additions & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
<name>sick_perception</name>
<version>0.1.0</version>
<description>LiDAR Obstacle Detection Mapping</description>
<maintainer email="samrichter888@gmail.com">sigma</maintainer>
<maintainer email="samrichter888@gmail.com">Sam Richter</maintainer>
<license>MIT</license>

<depend>rclcpp</depend>
<depend>std_msgs</depend>
<depend>sensor_msgs</depend>
<depend>geometry_msgs</depend>
<depend>nav_msgs</depend>
<depend>tf2_ros</depend>
<depend>tf2_sensor_msgs</depend>
<depend>pcl_conversions</depend>
<depend>pcl_ros</depend>

Expand Down
Loading

0 comments on commit b0d438d

Please sign in to comment.