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

Lane detection hough #9

Open
wants to merge 102 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
c547270
Initial commit
MaslinuPoimal Jun 15, 2017
5bc36ab
Continued porting new_road_detection to ROS, added dynamic reconfigur…
MaslinuPoimal Jun 16, 2017
4ba460a
Rewrite of new_road_detection complete, needs Eigen integration for w…
MaslinuPoimal Jun 18, 2017
2d7705f
Merged remote branch
MaslinuPoimal Jun 18, 2017
e33a2aa
Fixed bresenham line search logic, changed function visibility
MaslinuPoimal Jun 18, 2017
84d150b
Added world->image, image->world services, last remaining step: eigen…
MaslinuPoimal Jun 18, 2017
81fa3e0
Add common geometry operations header (based on boost::geometry), fix…
MaslinuPoimal Jun 18, 2017
d32f0ba
Fixed config header naming
MaslinuPoimal Jun 21, 2017
11ce761
Warp node functioning, but homography seems incorrect, added debug pu…
MaslinuPoimal Jun 21, 2017
e3c9531
Homography scaling
MaslinuPoimal Jun 21, 2017
ebdcbcd
Added image warp nodelet, fixed services for image transformation
MaslinuPoimal Jun 22, 2017
0e7f387
Added line recognition nodelet, added nodelet and node launch files, …
MaslinuPoimal Jun 23, 2017
80c69eb
Remove perspective transformation, add image transformation of search…
Jun 24, 2017
f5fe363
Use CameraInfo for image transformations, adjust service requests
Jun 24, 2017
6ad6e96
Adjusted launch parameters, fixed wrong image initialization, added c…
MaslinuPoimal Jun 25, 2017
9fc6589
Add filtered point debug display and publisher
MaslinuPoimal Jun 25, 2017
626ace1
Readded condition for threading, added some more debug output
Jun 26, 2017
66c070e
init commit street_crossing
Simon089 Jun 29, 2017
5e61fd3
Merge branch 'WIP' of https://github.com/tum-phoenix/drive_ros_image_…
Simon089 Jun 29, 2017
d6de0df
fixed typo in header guards
Jul 5, 2017
46af5ee
removed line recognition files
Jul 5, 2017
1dd8990
removed camera matrix yml (parameter come with camera info message)
Jul 5, 2017
46ccc92
removed image publisher node (moved to separate repo)
Jul 5, 2017
949c5a9
moved vision launch files to config repo
Jul 5, 2017
d63a1ab
removed line recognition launch files
Jul 5, 2017
89493fd
removed old lms stuff
Jul 6, 2017
36d5e36
publish debug image for street_crossing
Jul 6, 2017
7178304
Merge branch 'WIP' of https://github.com/tum-phoenix/drive_ros_image_…
Jul 6, 2017
bad6f19
street_crossing recognizes horizontal lines in front of the car
Jul 7, 2017
848a8f4
add street_crossing.launch
Jul 7, 2017
7e43608
merge local changes
Jul 7, 2017
f857203
Move shared functions to header, remove services, todo: add parameter…
Jul 11, 2017
cfa9018
Modified common operation classes for correct initialization, moved n…
Jul 12, 2017
275fe96
Added placeholder code for obstacles in crossing_detection
Jul 12, 2017
cfa90da
Adjusted image processing to avoid iterations and unify both brightne…
Jul 12, 2017
b81d167
Remove old camera model yamls from launch files, remove invalid param…
MaslinuPoimal Jul 12, 2017
2f82c9c
Add synchronized subscriptions for road and incoming image, working d…
MaslinuPoimal Jul 13, 2017
427c70b
Fixed sobel and brightness line checks, moved code to unfied header, …
MaslinuPoimal Jul 15, 2017
b4b6c40
changed default camera topic ns
Jul 18, 2017
3fa7435
correct homography yaml path
Jul 18, 2017
5afcd17
updated yaml paths in launch files
Jul 18, 2017
e2dbeb6
removed set matrix to [0] in getHomographyMatParam
fabolhak Jul 18, 2017
466b4ab
added matrix in getHomographyMatParam to ensure correct dimensions
fabolhak Jul 18, 2017
d6bf6f6
change camera1 to camera in launch files
Oct 5, 2017
68e32ed
Merge branch 'WIP' of https://github.com/tum-phoenix/drive_ros_image_…
Oct 5, 2017
94fd9ef
refactoring: changed naming from new_road_detection to road_detection
Oct 5, 2017
b17da1d
added first unittest test
Oct 7, 2017
cd4cce5
add if() clause to cmake test
Oct 7, 2017
dbc1513
removed failing testcase
Oct 7, 2017
fd48987
added more testing
Oct 7, 2017
81eeceb
added some more geometry common tests and fixed move orthogonal with …
Oct 8, 2017
9080551
moved RoadLane.msg to drive_ros_msgs package
Oct 10, 2017
64c7cc5
modify the search-line and fix publishing the debug image
Oct 10, 2017
4c104d8
Add homography subscription to warp node, some minor compile flags in…
Oct 11, 2017
ce001cd
Fix launch files (install paths and removed homography yaml references)
MaslinuPoimal Oct 13, 2017
98dd4cb
Remove yaml homography loading, add homography subscription to imagin…
MaslinuPoimal Oct 14, 2017
8b10a7f
updated camera_info topic name; please redownload your bags to get up…
Oct 14, 2017
92340cc
fix launch file
Oct 14, 2017
8d5b5c4
Reorganized and fixed launch files, fixed missing references in subsc…
MaslinuPoimal Oct 15, 2017
30c0dac
Fixed homography scaling, removed unneeded dependencies
MaslinuPoimal Oct 22, 2017
c8b1a4e
Fixed transform callbacks, fixed duplicate callbacks due to helper se…
MaslinuPoimal Nov 1, 2017
28a7bf5
Added option to transform from unwarped image, move to PointStamped i…
Nov 3, 2017
c718c81
refactoring: changed naming from new_road_detection to road_detection
Oct 5, 2017
2b8e088
added first unittest test
Oct 7, 2017
b17fa6c
add if() clause to cmake test
Oct 7, 2017
cad57ba
removed failing testcase
Oct 7, 2017
d25c343
added more testing
Oct 7, 2017
b1bc764
added some more geometry common tests and fixed move orthogonal with …
Oct 8, 2017
3affde1
moved RoadLane.msg to drive_ros_msgs package
Oct 10, 2017
cf7163e
Add homography subscription to warp node, some minor compile flags in…
Oct 11, 2017
42a6cfc
Fix launch files (install paths and removed homography yaml references)
MaslinuPoimal Oct 13, 2017
f61b621
Remove yaml homography loading, add homography subscription to imagin…
MaslinuPoimal Oct 14, 2017
4052f84
updated camera_info topic name; please redownload your bags to get up…
Oct 14, 2017
f02d1e1
fix launch file
Oct 14, 2017
7214338
Reorganized and fixed launch files, fixed missing references in subsc…
MaslinuPoimal Oct 15, 2017
e2f6790
Fixed homography scaling, removed unneeded dependencies
MaslinuPoimal Oct 22, 2017
f9e19f3
Fixed transform callbacks, fixed duplicate callbacks due to helper se…
MaslinuPoimal Nov 1, 2017
7cb1755
start using HoughLines for lane detection
Nov 3, 2017
ee118cd
Added option to transform from unwarped image, move to PointStamped i…
Nov 3, 2017
e038daa
general line detection
Nov 8, 2017
dc871fe
Merge branch 'WIP' of https://github.com/tum-phoenix/drive_ros_image_…
Nov 8, 2017
7ff2b63
finish merge
Nov 8, 2017
f294dbe
remove unused code. warp_image node uses image_operator now
Nov 9, 2017
5af78c8
fix launch file
Nov 18, 2017
67a40e0
use knowledge about the environment to classify lines
Dec 5, 2017
fe6d5b1
fix launch file
Nov 18, 2017
c6f7288
Merge branch 'lane_detection_hough' of https://github.com/tum-phoenix…
Dec 5, 2017
40fcb27
publish middle line points to topic. improve line detection
Dec 16, 2017
250b4cf
added output argument in launch files
Feb 25, 2018
df2050d
Start homography publisher in launch file. Small changes
May 28, 2018
82e49a3
Refactor code for future use
Jun 11, 2018
c505dd1
Bundle debug image output in function
Jun 13, 2018
e372601
Detect intersection
Jul 4, 2018
8f79814
Handle intersections
Jul 25, 2018
397327d
Find way through intersection with stop line
Jul 29, 2018
00b941d
Project middle lines to mid and find polynomial fit
Jul 30, 2018
2bb8aa6
Change lane detection to segment based detection
Nov 20, 2018
32c2d1e
Use odometry to transform the driving line.
Nov 22, 2018
f2f15b7
Create a simple trajectory.
Simon089 Nov 24, 2018
af7fbff
Trajectory steering angle
MaslinuPoimal Nov 24, 2018
3d64376
Directly use provided homography (as the published one is already sca…
MaslinuPoimal Dec 3, 2018
feaa51b
Use unscaled homography
MaslinuPoimal Dec 9, 2018
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
81 changes: 54 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,41 @@ project(drive_ros_image_recognition)
#SET(CMAKE_BUILD_TYPE Release)
SET(CMAKE_BUILD_TYPE Debug)

# enable to compile with OpenCV window displays
#add_definitions(-DDRAW_DEBUG)
# enable to compile with publishers of internally processed images
add_definitions(-DPUBLISH_DEBUG)
# enable to use World2Cam homography
#add_definitions(-DUSE_WORLD2CAM_HOMOGRAPHY)
# enable publishing of detected points (for rviz display)
#add_definitions(-DPUBLISH_WORLD_POINTS)

add_definitions(-std=c++11)

find_package(catkin REQUIRED COMPONENTS
cv_bridge
image_transport
image_geometry
roscpp
sensor_msgs
std_msgs
)
drive_ros_msgs
dynamic_reconfigure
geometry_msgs
nodelet
tf
)

#include Boost for lane line processing
find_package(Boost REQUIRED)

generate_dynamic_reconfigure_options(
cfg/LineDetection.cfg
)

catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS cv_bridge image_transport roscpp sensor_msgs std_msgs
CATKIN_DEPENDS cv_bridge image_transport roscpp sensor_msgs std_msgs drive_ros_msgs
)

find_package(OpenCV REQUIRED)
Expand All @@ -25,67 +47,69 @@ include_directories(
include
${catkin_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
)
${Boost_INCLUDE_DIRS}
)

################################################################################
# Line recognition node
# Warp image node
################################################################################
add_executable(line_recognition_node
src/line_recognition_node.cpp
src/line_recognition.cpp
src/edge_point.cpp
# src/line_point.cpp
add_executable(warp_image_node
src/warp_image_node.cpp
src/warp_image.cpp
)

add_dependencies(line_recognition_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_dependencies(warp_image_node ${drive_ros_msgs_generate_messages_cpp} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

target_link_libraries(line_recognition_node
target_link_libraries(warp_image_node
${catkin_LIBRARIES}
${OpenCV_LIBS}
)

install(TARGETS line_recognition_node
install(TARGETS warp_image_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

################################################################################
# Warp image node
# Warp image nodelet
################################################################################
add_executable(warp_image_node
src/warp_image_node.cpp
add_library(warp_image_nodelet
src/warp_image.cpp
)

add_dependencies(warp_image_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_dependencies(warp_image_nodelet ${drive_ros_msgs_generate_messages_cpp} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

target_link_libraries(warp_image_node
target_link_libraries(warp_image_nodelet
${catkin_LIBRARIES}
${OpenCV_LIBS}
)

install(TARGETS warp_image_node
install(TARGETS warp_image_nodelet
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

################################################################################
# Image publisher node
# Line detection node
################################################################################
add_executable(image_publisher_node
src/image_publisher_node.cpp

add_executable(line_detection_node
src/line_detection.cpp
src/line_detection_node.cpp
src/road_model.cpp
)

add_dependencies(image_publisher_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_dependencies(line_detection_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

target_link_libraries(image_publisher_node
target_link_libraries(line_detection_node
${catkin_LIBRARIES}
${OpenCV_LIBS}
${Boost_LIBRARIES}
)

install(TARGETS image_publisher_node
install(TARGETS line_detection_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
Expand All @@ -94,19 +118,22 @@ install(TARGETS image_publisher_node
################################################################################
# Install other files
################################################################################
install(FILES nodelets.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE
)

install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
FILES_MATCHING PATTERN "*.launch"
)

install(DIRECTORY config/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config
FILES_MATCHING PATTERN "*.yaml"
)

7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# drive_ros_image_recognition
image recognition (lanes, crossings, start lines, ....)

For using the line detection, we need
* a camera image (from ximea camera or a rosbag)
* the homography. Therefore you can use `drive_ros_ximea_importer/launch/homography_publischer_only.launch`.

Now start `drive_ros_image_recognition/launch/line_recognition.launch`.
For `drive_ros_image_recognition/launch/warp_image.launch` you have to do the same two steps from above.
22 changes: 22 additions & 0 deletions cfg/LineDetection.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python
PACKAGE = "drive_ros_image_recognition"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

gen.add("lineWidth", double_t, 0, "Line width [m]", 0.45, 0.1, 1.0)
gen.add("lineVar", double_t, 0, "Line search corridor [m]", 0.1, 0.01, 0.20)
gen.add("lineAngle", double_t, 0, "Max line angle (rad)", 0.7, 0.1, 3.1)
gen.add("maxSenseRange", double_t, 0, "Max view range for lines", 2.0, 0.5, 5.0)
gen.add("cannyThreshold", int_t, 0, "cannyThreshold", 30, 10, 500)
gen.add("houghThreshold", int_t, 0, "houghThreshold", 20, 5, 100)
gen.add("houghMinLineLen", int_t, 0, "houghMinLineLen", 5, 1, 100)
gen.add("houghMaxLineGap", int_t, 0, "houghMaxLineGap", 3, 0, 300)
gen.add("segmentLength", double_t, 0, "Classification segment length", 0.2, 0.1, 1.0)
gen.add("ransacIterations", int_t, 0, "Max number of Ransac iterations", 200, 50, 1000)
gen.add("trajectory_dist", double_t, 0, "Distance we want the trajectory point to be", 0.3, 0.1, 1.0)
gen.add("target_velocity", double_t, 0, "The velocity for our trajectory", 0.01, 0.00, 10.0)

exit(gen.generate(PACKAGE, "drive_ros_image_recognition", "LineDetection"))

6 changes: 0 additions & 6 deletions config/camera_matrix.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions config/homography.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
world_size: [3.0, 3.0]
image_size: [800, 800]
3 changes: 0 additions & 3 deletions config/homography_matrix.yaml

This file was deleted.

Loading