Skip to content

Commit

Permalink
[fix] SSD detector, cmake colcon (#1837)
Browse files Browse the repository at this point in the history
* Fixes for new colcon script on ssd cuda based node

* Fixed to RTM and darknet launch files

* catkin_fix

* * catkin & colcon build successfully
* reverted back run to devel space (for the time being)
  • Loading branch information
amc-nu authored Jan 8, 2019
1 parent c96daee commit f77b784
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 25 deletions.
4 changes: 4 additions & 0 deletions ros/colcon_release
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ if [[ -d install ]]; then
rm -rf install
fi

if [ -f src/CMakeLists.txt ]; then
rm -r src/CMakeLists.txt
fi

COLCON_OPTS="--cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs"

export LIBRARY_PATH=/usr/lib/OpenNI2/Drivers:$LIBRARY_PATH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ find_package(autoware_msgs REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
cv_bridge
autoware_msgs
)
find_package(OpenCV REQUIRED)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ find_package(catkin REQUIRED COMPONENTS
roscpp
geometry_msgs
jsk_recognition_msgs
autoware_msgs
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ find_package(autoware_build_flags REQUIRED)
find_package(autoware_msgs REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
autoware_msgs
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ IF (CUDA_FOUND)
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
PATTERN ".svn" EXCLUDE)

install(DIRECTORY darknet/cfg/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/darknet/cfg/
PATTERN ".svn" EXCLUDE)
ELSE()
message("darknet won't be built, CUDA was not found.")
ENDIF ()
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ set(ROS_VERSION $ENV{ROS_DISTRO})

include(FindPkgConfig)

find_package(autoware_build_flags REQUIRED)
find_package(autoware_msgs REQUIRED)
find_package(autoware_config_msgs REQUIRED)

FIND_PACKAGE(catkin REQUIRED COMPONENTS
cv_bridge
Expand All @@ -25,6 +28,7 @@ catkin_package(
sensor_msgs
std_msgs
autoware_msgs
autoware_config_msgs
tf
)

Expand Down Expand Up @@ -69,6 +73,8 @@ if (EXISTS "${SSD_CAFFE_PATH}")
)

target_include_directories(vision_ssd_detect PRIVATE
${autoware_msgs_INCLUDE_DIRS}
${autoware_config_msgs_INCLUDE_DIRS}
${SSD_CAFFE_PATH}/include
include
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SSDDetector
void Preprocess(const cv::Mat &img, std::vector<cv::Mat> *input_channels);

private:
boost::shared_ptr <caffe::Net<float>> net_;
boost::shared_ptr <caffe::Net<float> > net_;
cv::Size input_geometry_;
int num_channels_;
cv::Scalar mean_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<build_depend>geometry_msgs</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>autoware_msgs</build_depend>
<build_depend>autoware_config_msgs</build_depend>
<build_depend>libdpm_ttic</build_depend>
<build_depend>fusion</build_depend>
<build_depend>tf</build_depend>
Expand All @@ -29,6 +30,7 @@
<run_depend>geometry_msgs</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>autoware_msgs</run_depend>
<run_depend>autoware_config_msgs</run_depend>
<run_depend>libdpm_ttic</run_depend>
<run_depend>fusion</run_depend>
<run_depend>tf</run_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ SSDDetector::SSDDetector(const std::string& in_network_definition_file,
caffe::Caffe::set_mode(caffe::Caffe::CPU);

/* Load the network. */
net_.reset(new caffe::Net<float>(in_network_definition_file, caffe::Phase::TEST));
net_.reset(new caffe::Net<float>(in_network_definition_file, caffe::TEST));
net_->CopyTrainedLayersFrom(in_pre_trained_model_file);

CHECK_EQ(net_->num_inputs(), 1) << "Network should have exactly one input.";
Expand Down Expand Up @@ -63,7 +63,7 @@ std::vector < RectClassScore<float> > SSDDetector::Detect(const cv::Mat& img)
caffe::Blob<float> *result_blob = net_->output_blobs()[0];
const float *result = result_blob->cpu_data();
const int num_det = result_blob->height();
std::vector <RectClassScore<float>> detections;
std::vector <RectClassScore<float> > detections;
for (int k = 0; k < num_det; ++k)
{
if (result[0] == -1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ execute_process(
)



find_package(autoware_build_flags REQUIRED)

find_package(autoware_msgs REQUIRED)
Expand All @@ -17,7 +16,7 @@ find_package(OpenCV REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
geometry_msgs
autoware_msgs
autoware_msgs
map_file
pcl_conversions
pcl_ros
Expand All @@ -26,7 +25,7 @@ find_package(catkin REQUIRED COMPONENTS
jsk_recognition_msgs
op_utility
op_planner
op_simu
op_simu
op_ros_helpers
waypoint_follower
)
Expand All @@ -38,9 +37,9 @@ find_package(catkin REQUIRED COMPONENTS
## catkin specific configuration ##
###################################
catkin_package(
INCLUDE_DIRS include
LIBRARIES
CATKIN_DEPENDS roscpp geometry_msgs autoware_msgs map_file op_utility op_planner op_simu op_ros_helpers waypoint_follower
INCLUDE_DIRS include
LIBRARIES
CATKIN_DEPENDS roscpp geometry_msgs autoware_msgs map_file op_utility op_planner op_simu op_ros_helpers waypoint_follower
# DEPENDS system_lib
)

Expand All @@ -53,25 +52,41 @@ if ("${ROS_VERSION}" MATCHES "(kinetic)")
endif()

include_directories(
include
${catkin_INCLUDE_DIRS}
${autoware_msgs_INCLUDE_DIRS}
)
include
${catkin_INCLUDE_DIRS}
${autoware_msgs_INCLUDE_DIRS}
)

link_directories(lib)


add_executable(op_car_simulator nodes/op_car_simulator/op_car_simulator.cpp nodes/op_car_simulator/op_car_simulator_core.cpp)
target_link_libraries(op_car_simulator
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${OpenCV_LIBS}
)

add_executable(op_perception_simulator nodes/op_perception_simulator/op_perception_simulator.cpp nodes/op_perception_simulator/op_perception_simulator_core.cpp)
target_link_libraries(op_perception_simulator ${catkin_LIBRARIES} ${PCL_LIBRARIES})

add_executable(op_signs_simulator nodes/op_signs_simulator/op_signs_simulator.cpp nodes/op_signs_simulator/op_signs_simulator_core.cpp)
target_link_libraries(op_signs_simulator ${catkin_LIBRARIES} ${PCL_LIBRARIES})

add_dependencies(op_car_simulator op_perception_simulator op_signs_simulator op_data_logger ${catkin_EXPORTED_TARGETS})
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${OpenCV_LIBS}
)

add_executable(op_perception_simulator
nodes/op_perception_simulator/op_perception_simulator.cpp
nodes/op_perception_simulator/op_perception_simulator_core.cpp
)
target_link_libraries(op_perception_simulator
${catkin_LIBRARIES}
${PCL_LIBRARIES}
)

add_executable(op_signs_simulator
nodes/op_signs_simulator/op_signs_simulator.cpp
nodes/op_signs_simulator/op_signs_simulator_core.cpp
)
target_link_libraries(op_signs_simulator
${catkin_LIBRARIES}
${PCL_LIBRARIES}
)

add_dependencies(op_car_simulator
op_perception_simulator
op_signs_simulator
${catkin_EXPORTED_TARGETS}
)
1 change: 1 addition & 0 deletions ros/src/socket/packages/mqtt_socket/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ find_package(catkin REQUIRED COMPONENTS
roslib
std_msgs
autoware_can_msgs
autoware_msgs
)

catkin_package(CATKIN_DEPENDS
Expand Down

0 comments on commit f77b784

Please sign in to comment.