-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into hepromark/tilt
- Loading branch information
Showing
26 changed files
with
461 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "src/perception/lane_detection/src/lane_detection_tensorrt"] | ||
path = src/perception/lane_detection/src/lane_detection_tensorrt | ||
url = [email protected]:WATonomous/lane_detection_tensorrt.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ Note: These are all available on WATonomous servers by default. | |
## Running Your First Program in the Monorepo | ||
These steps will let you run our sample nodes module. To run other modules, refer to our modules documentation. | ||
|
||
1. Clone this repo onto the host machine by using `$ git clone [email protected]:WATonomous/wato_monorepo.git`. We recommend you clone the repo into your home directory, `~` | ||
1. Clone this repo onto the host machine by using `$ git clone --recurse-submodules [email protected]:WATonomous/wato_monorepo.git`. The `--recurse-submodules` flag is needed to initialize submodules required by the repo - if you did not clone with this flag, run `git submodule update --init --recursive` inside the repo. We recommend you clone the repo into your home directory, `~` | ||
2. Login to the our container registry by using `docker login ghcr.io`. Provide your GitHub Username and GitHub Token. | ||
3. Configure to only run our sample nodes by uncommenting and setting `ACTIVE_MODULES="samples"` in `watod-config.sh` | ||
4. Run `$ ./watod pull` to pull latest docker images from our container registry. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,70 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(lane_detection) | ||
set(ProjectName "lane_detection") | ||
set(CUDA_TOOLKIT_ROOT_DIR "/usr/local/cuda") | ||
SET(CMAKE_CUDA_COMPILER /usr/local/cuda-12.2/bin/nvcc) | ||
SET(CUDACXX /usr/local/cuda-12.2/bin/nvcc) | ||
project(${ProjectName} LANGUAGES CXX CUDA) | ||
|
||
# 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) | ||
# uncomment the following section in order to fill in | ||
# further dependencies manually. | ||
# find_package(<dependency> REQUIRED) | ||
### TensorRT model ### | ||
|
||
# Select build system and set compile options | ||
include(${CMAKE_CURRENT_LIST_DIR}/src/lane_detection_tensorrt/common_helper/cmakes/build_setting.cmake) | ||
add_executable(lane_detection src/lane_detection_node.cpp) | ||
|
||
add_subdirectory(./src/lane_detection_tensorrt/ultra_fast_lane_detection_v2/image_processor image_processor) | ||
target_include_directories(${ProjectName} PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR}/include | ||
./src/lane_detection_tensorrt/ultra_fast_lane_detection_v2/image_processor) | ||
target_link_libraries(${ProjectName} ImageProcessor) | ||
|
||
find_package(OpenCV REQUIRED) | ||
target_include_directories(${ProjectName} PUBLIC ${OpenCV_INCLUDE_DIRS}) | ||
target_link_libraries(${ProjectName} ${OpenCV_LIBS}) | ||
|
||
# Copy resouce | ||
add_definitions(-DRESOURCE_DIR="/models/") | ||
|
||
### End of TensorRT model ### | ||
|
||
set(REQUIRED_PACKAGES | ||
rclcpp | ||
std_msgs | ||
sensor_msgs | ||
geometry_msgs | ||
lane_detection_msgs | ||
cv_bridge | ||
image_transport | ||
CUDA | ||
) | ||
|
||
foreach(PKG IN LISTS REQUIRED_PACKAGES) | ||
find_package(${PKG} REQUIRED) | ||
endforeach() | ||
|
||
# Install launch files | ||
install(DIRECTORY | ||
launch | ||
DESTINATION share/${PROJECT_NAME}/ | ||
) | ||
|
||
# Install config files | ||
install(DIRECTORY | ||
config | ||
DESTINATION share/${PROJECT_NAME}/ | ||
) | ||
|
||
install(TARGETS | ||
lane_detection | ||
DESTINATION lib/${PROJECT_NAME}) | ||
|
||
ament_target_dependencies(lane_detection rclcpp OpenCV std_msgs sensor_msgs cv_bridge image_transport lane_detection_msgs) | ||
ament_package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
lane_detection_node: | ||
ros__parameters: | ||
camera_topic: /camera/left/image_color | ||
publish_vis_topic: /camera/left/lanes_viz | ||
publish_lanes_topic: /camera/left/lanes | ||
save_images: false | ||
save_images_path: /tmp | ||
publish_source_image: false | ||
debug_node: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
lane_detection_node: | ||
ros__parameters: | ||
camera_topic: /CAM_FRONT/image_rect_compressed | ||
publish_vis_topic: /CAM_FRONT/lanes_viz | ||
publish_lanes_topic: /CAM_FRONT/lanes | ||
save_images: false | ||
save_images_path: /tmp | ||
publish_source_image: false | ||
debug_node: false |
48 changes: 48 additions & 0 deletions
48
src/perception/lane_detection/include/lane_detection_node.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#ifndef LANE_DETECTION_NODE_HPP | ||
#define LANE_DETECTION_NODE_HPP | ||
|
||
#include <chrono> | ||
#include <filesystem> | ||
#include <functional> | ||
#include <memory> | ||
#include <string> | ||
|
||
#include <cv_bridge/cv_bridge.h> | ||
#include <rclcpp/rclcpp.hpp> | ||
#include <sensor_msgs/msg/compressed_image.hpp> | ||
#include <sensor_msgs/msg/image.hpp> | ||
#include "lane_detection_msgs/msg/lane_detection.hpp" | ||
|
||
#include <opencv2/opencv.hpp> | ||
|
||
#include "common_helper_cv.h" | ||
#include "image_processor.h" | ||
|
||
class LaneDetectionNode : public rclcpp::Node { | ||
public: | ||
LaneDetectionNode(); | ||
void image_callback(const sensor_msgs::msg::Image::ConstSharedPtr &msg); | ||
|
||
private: | ||
void populate_lane_msg(lane_detection_msgs::msg::LaneDetection &lane_msg, | ||
const std::vector<std::vector<float>> &raw_lane_list); | ||
void save_image(const cv::Mat &image, const std::string &filename); | ||
|
||
rclcpp::Subscription<sensor_msgs::msg::Image>::SharedPtr subscription_; | ||
rclcpp::Publisher<sensor_msgs::msg::Image>::SharedPtr image_pub_; | ||
rclcpp::Publisher<lane_detection_msgs::msg::LaneDetection>::SharedPtr lane_detection_pub_; | ||
|
||
size_t count_; | ||
|
||
// ROS Parameters | ||
std::string camera_topic_; | ||
std::string publish_vis_topic_; | ||
std::string publish_lanes_topic_; | ||
bool save_images_; | ||
std::string save_dir_; | ||
bool publish_source_image_; | ||
// Debug will publish the source image with lane detection overlay | ||
bool debug_node_; | ||
}; | ||
|
||
#endif // LANE_DETECTION_NODE_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from launch import LaunchDescription | ||
from launch_ros.actions import Node | ||
from ament_index_python.packages import get_package_share_directory | ||
import os | ||
|
||
|
||
def generate_launch_description(): | ||
ld = LaunchDescription() | ||
|
||
config = os.path.join( | ||
get_package_share_directory('lane_detection'), | ||
'config', | ||
'eve_config.yaml' | ||
) | ||
|
||
lane_detection_node = Node( | ||
package='lane_detection', | ||
executable='lane_detection', | ||
name='lane_detection_node', | ||
parameters=[config], | ||
arguments=['--ros-args', '--log-level', 'info'] | ||
) | ||
|
||
ld.add_action(lane_detection_node) | ||
|
||
return ld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from launch import LaunchDescription | ||
from launch_ros.actions import Node | ||
from ament_index_python.packages import get_package_share_directory | ||
import os | ||
|
||
|
||
def generate_launch_description(): | ||
ld = LaunchDescription() | ||
|
||
config = os.path.join( | ||
get_package_share_directory('lane_detection'), | ||
'config', | ||
'nuscenes_config.yaml' | ||
) | ||
|
||
lane_detection_node = Node( | ||
package='lane_detection', | ||
executable='lane_detection', | ||
name='lane_detection_node', | ||
parameters=[config], | ||
arguments=['--ros-args', '--log-level', 'info'] | ||
) | ||
|
||
ld.add_action(lane_detection_node) | ||
|
||
return ld |
Oops, something went wrong.