update
This commit is contained in:
@@ -16,12 +16,19 @@ find_package(message_filters REQUIRED)
|
||||
find_package(interfaces REQUIRED)
|
||||
find_package(ament_index_cpp REQUIRED)
|
||||
|
||||
find_package()
|
||||
|
||||
|
||||
add_executable(
|
||||
detect_node
|
||||
src/creat_detect_node.cpp
|
||||
src/VisionTestNode.cpp
|
||||
src/CalculateTool.cpp
|
||||
src/main.cpp
|
||||
src/detect_node.cpp
|
||||
src/init_base.cpp
|
||||
src/config_base.cpp
|
||||
|
||||
src/calculate_tools.cpp
|
||||
src/read_file_tools.cpp
|
||||
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
@@ -43,6 +50,7 @@ install(
|
||||
DIRECTORY configs DESTINATION share/${PROJECT_NAME}/configs
|
||||
DIRECTORY checkpoints DESTINATION share/${PROJECT_NAME}/checkpoints
|
||||
DIRECTORY launch DESTINATION share/${PROJECT_NAME}/launch
|
||||
DIRECTORY calibration_mats DESTINATION share/${PROJECT_NAME}/calibration_mats
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ class ConfigBase: public rclcpp::Node {
|
||||
explicit ConfigBase(const std::string name);
|
||||
|
||||
protected:
|
||||
// Variables
|
||||
nlohmann::json configs;
|
||||
nlohmann::json calculate_configs;
|
||||
nlohmann::json camera_data;
|
||||
@@ -73,8 +74,7 @@ class ConfigBase: public rclcpp::Node {
|
||||
std::vector<std::vector<std::vector<int>>> color_range;
|
||||
std::vector<int> classes;
|
||||
|
||||
|
||||
|
||||
// Functions
|
||||
void read_calibration_mat();
|
||||
|
||||
};
|
||||
|
||||
12
vision_test/include/vision_test/detect_node.hpp
Normal file
12
vision_test/include/vision_test/detect_node.hpp
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
|
||||
|
||||
#include "vision_test/init_base.hpp"
|
||||
|
||||
|
||||
class DetectNode: public InitBase {
|
||||
public:
|
||||
explicit DetectNode(const std::string name);
|
||||
|
||||
};
|
||||
@@ -1,3 +1,14 @@
|
||||
|
||||
|
||||
#include "vision_test/config_base.hpp"
|
||||
#include "vision_test/config_base.hpp"
|
||||
|
||||
|
||||
class InitBase: public ConfigBase {
|
||||
public:
|
||||
explicit InitBase(const std::string name);
|
||||
|
||||
protected:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
8
vision_test/src/detect_node.cpp
Normal file
8
vision_test/src/detect_node.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
|
||||
#include "vision_test/detect_node.hpp"
|
||||
|
||||
|
||||
DetectNode::DetectNode(const std::string name): InitBase(name) {
|
||||
|
||||
}
|
||||
@@ -1 +1,8 @@
|
||||
#include "vision_test/init_base.hpp"
|
||||
|
||||
|
||||
#include "vision_test/init_base.hpp"
|
||||
|
||||
|
||||
InitBase::InitBase(const std::string name): ConfigBase(name) {
|
||||
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "rclcpp/rclcpp.hpp"
|
||||
#include "vision_test/vision_detect_node.hpp"
|
||||
#include "vision_test/detect_node.hpp"
|
||||
|
||||
|
||||
int main(int argc, char ** argv) {
|
||||
rclcpp::init(argc, argv);
|
||||
path::shared_path = ament_index_cpp::get_package_share_directory("vision_test");
|
||||
auto node = std::make_shared<VisionDetectNode>("detect");
|
||||
auto node = std::make_shared<DetectNode>("detect");
|
||||
rclcpp::spin(node);
|
||||
|
||||
rclcpp::shutdown();
|
||||
Reference in New Issue
Block a user