Skip to content

Commit

Permalink
add debug term
Browse files Browse the repository at this point in the history
Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>
  • Loading branch information
Daisuke Nishimatsu committed Feb 7, 2023
1 parent ae132b4 commit eb91252
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions perception/traffic_light_classifier/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,20 @@ if(TRT_AVAIL AND CUDA_AVAIL AND CUDNN_AVAIL)
EXECUTABLE traffic_light_classifier_node
)

ament_auto_add_library(single_image_inference_node SHARED
ament_auto_add_library(single_image_debug_inference_node SHARED
src/cnn_classifier.cpp
src/color_classifier.cpp
src/nodelet.cpp
src/single_image_inference_node.cpp
src/single_image_debug_inference_node.cpp
)
target_link_libraries(single_image_inference_node
target_link_libraries(single_image_debug_inference_node
libutils
opencv_core
opencv_highgui
)
rclcpp_components_register_node(single_image_inference_node
PLUGIN "traffic_light::SingleImageInferenceNode"
EXECUTABLE single_image_inference
rclcpp_components_register_node(single_image_debug_inference_node
PLUGIN "traffic_light::SingleImageDebugInferenceNode"
EXECUTABLE single_image_debug_inference
)

ament_auto_package(INSTALL_TO_SHARE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ std::string toString(const uint8_t state)

namespace traffic_light
{
class SingleImageInferenceNode : public rclcpp::Node
class SingleImageDebugInferenceNode : public rclcpp::Node
{
public:
explicit SingleImageInferenceNode(const rclcpp::NodeOptions & node_options)
explicit SingleImageDebugInferenceNode(const rclcpp::NodeOptions & node_options)
: Node("single_image_inference", node_options)
{
const auto image_path = declare_parameter("image_path", "");
Expand All @@ -89,7 +89,7 @@ class SingleImageInferenceNode : public rclcpp::Node
return;
}
cv::namedWindow("inference image", cv::WINDOW_NORMAL);
cv::setMouseCallback("inference image", SingleImageInferenceNode::onMouse, this);
cv::setMouseCallback("inference image", SingleImageDebugInferenceNode::onMouse, this);

cv::imshow("inference image", image_);

Expand All @@ -103,7 +103,7 @@ class SingleImageInferenceNode : public rclcpp::Node
private:
static void onMouse(int event, int x, int y, int flags, void * param)
{
SingleImageInferenceNode * node = static_cast<SingleImageInferenceNode *>(param);
SingleImageDebugInferenceNode * node = static_cast<SingleImageDebugInferenceNode *>(param);
if (node) {
node->inferWithCrop(event, x, y, flags);
}
Expand Down Expand Up @@ -159,4 +159,4 @@ class SingleImageInferenceNode : public rclcpp::Node
} // namespace traffic_light

#include "rclcpp_components/register_node_macro.hpp"
RCLCPP_COMPONENTS_REGISTER_NODE(traffic_light::SingleImageInferenceNode)
RCLCPP_COMPONENTS_REGISTER_NODE(traffic_light::SingleImageDebugInferenceNode)

0 comments on commit eb91252

Please sign in to comment.