Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

Commit

Permalink
As/111 live traffic new detector (#16)
Browse files Browse the repository at this point in the history
* First run at replacing region_tlr_tensorflow with new version.

* Fixing order-of-operations CMake bug in TLR.

* Fixing another order-of-operations issue in TLR.

* Adding main function and fixing srv install.

* Fixing launch file for new region_tlr_tensorflow.

* Making tensorflow_tlr.py a class.

* python global variable fixes in tlr

* python self instance ref fixes
  • Loading branch information
Joshua Whitley committed Jun 4, 2019
1 parent 238c445 commit 4dfcb8b
Show file tree
Hide file tree
Showing 11 changed files with 737 additions and 1,178 deletions.
690 changes: 0 additions & 690 deletions ros/src/.config/rviz/default.rviz

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ find_package(catkin REQUIRED COMPONENTS
vector_map
camera_info_manager
image_transport
message_generation
)

find_package(OpenCV REQUIRED)
Expand Down Expand Up @@ -70,6 +71,18 @@ include_directories(
${Eigen3_INCLUDE_DIRS}
)

catkin_python_setup()

add_service_files(
FILES RecognizeLightState.srv
)

generate_messages(
DEPENDENCIES
std_msgs
sensor_msgs
)

catkin_package(
INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS}
CATKIN_DEPENDS
Expand All @@ -87,6 +100,7 @@ catkin_package(
vector_map_server
visualization_msgs
waypoint_follower
message_runtime

LIBRARIES libcontext
)
Expand Down Expand Up @@ -213,22 +227,6 @@ target_link_libraries(roi_extractor
add_dependencies(region_tlr
${catkin_EXPORTED_TARGETS})

### roi_pub ###
include_directories(
${catkin_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
)

add_executable(roi_pub
nodes/roi_pub/roi_pub.cpp
)

target_link_libraries(roi_pub
${catkin_LIBRARIES}
${OpenCV_LIBS}
libcontext
)

### label_maker ###
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
Expand Down Expand Up @@ -275,7 +273,7 @@ target_link_libraries(label_maker
)


install(TARGETS region_tlr feat_proj tlr_tuner roi_extractor roi_pub label_maker libcontext tl_switch
install(TARGETS region_tlr feat_proj tlr_tuner roi_extractor label_maker libcontext tl_switch
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
Expand Down Expand Up @@ -390,8 +388,34 @@ if (CUDA_FOUND)
find_package(TensorFlow QUIET)

if (TENSORFLOW_FOUND)
catkin_python_setup()
catkin_install_python(PROGRAMS nodes/region_tlr_tensorflow/trafficlight_recognizer/region_tlr_tensorflow.py
add_executable(region_tlr_tensorflow
nodes/region_tlr_tensorflow/region_tlr_tensorflow.cpp
nodes/region_tlr_tensorflow/region_tlr_tensorflow.h
)

target_include_directories(region_tlr_tensorflow PRIVATE
${catkin_INCLUDE_DIRS}
${OpenCV_LIBRARIES}
)

target_link_libraries(region_tlr_tensorflow
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
libcontext
)

add_dependencies(region_tlr_tensorflow
${catkin_EXPORTED_TARGETS}
${trafficlight_recognizer_EXPORTED_TARGETS}
)

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

catkin_install_python(PROGRAMS nodes/region_tlr_tensorflow/trafficlight_recognizer/tensorflow_tlr.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
else ()
message("'CuDNN' or 'tensorflow' is not installed. 'region_tlr_tensorflow' will not be built.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@
publish: [/light_color, /sound_player, /tlr_result, /tlr_superimpose_image]
subscribe: [/image_raw, /roi_signal]
- name: /region_tlr_tensorflow
publish: [/light_color, /sound_player]
subscribe: [/tlr_roi_image]
publish: [/light_color, /sound_player, /tlr_roi_image, /tlr_result, /tlr_superimpose_image]
subscribe: [/image_raw, /roi_signal]
- name: /roi_extractor
publish: []
subscribe: [/image_raw, /roi_signal]
- name: /roi_pub
publish: [/tlr_roi_image, /tlr_result, /tlr_superimpose_image]
subscribe: [/image_raw, /roi_signal, /config/superimpose]
- name: /light_color_switch
publish: [/light_color]
subscribe: [/camera_light_color, /ams_light_color]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@

<!-- Arguments -->
<arg name="camera_id" default="camera"/>
<arg name="nn_model_path" />
<arg name="nn_model_path" default="$(find aw_platform)/config/model-RGB-009-0.9857.hdf5" />
<arg name="image_transport" default="compressed" />
<arg name="image_raw_topic" default="$(arg camera_id)/image_raw "/>

<!-- ROI extractor -->
<node pkg="trafficlight_recognizer" type="roi_pub" name="roi_pub">
<node pkg="trafficlight_recognizer" type="region_tlr_tensorflow" name="region_tlr_tensorflow">
<param name="image_transport" value="$(arg image_transport)" />
<param name="image_raw_topic" value="$(arg image_raw_topic)" />
</node>

<!-- Classifier -->
<node pkg="trafficlight_recognizer" type="region_tlr_tensorflow.py" name="region_tlr_tensorflow">
<node pkg="trafficlight_recognizer" type="tensorflow_tlr.py" name="tensorflow_tlr">
<param name="nn_model_path" value="$(arg nn_model_path)" />
</node>

Expand Down
Loading

0 comments on commit 4dfcb8b

Please sign in to comment.