Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion ROS2/src/VzenseROS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ find_package(std_msgs REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(PCL REQUIRED COMPONENTS common io)
find_package(image_transport REQUIRED)
#find_package(boost REQUIRED)

add_definitions(${PCL_DEFINITIONS})
Expand Down Expand Up @@ -64,7 +66,7 @@ add_executable(vzense_camera src/vzense_driver.cpp
file(GLOB PCL_LIBRARIES /usr/lib/x86_64-linux-gnu/libpcl_*)

target_link_libraries(vzense_camera ${libNebula_api} ${OpenCV_LIBRARIES} ${PCL_LIBRARIES} ${Boost_LIBRARIES})
ament_target_dependencies(vzense_camera rclcpp sensor_msgs std_msgs cv_bridge tf2 tf2_ros pcl_conversions)
ament_target_dependencies(vzense_camera rclcpp sensor_msgs std_msgs cv_bridge tf2 tf2_ros pcl_conversions image_transport tf2_geometry_msgs)

install(
DIRECTORY dependencies/Lib/
Expand Down
20 changes: 3 additions & 17 deletions ROS2/src/VzenseROS/include/vzense_manager.hpp
Original file line number Diff line number Diff line change
@@ -1,35 +1,21 @@
#ifndef VZENSE_MANAGER_H
#define VZENSE_MANAGER_H


#include <csignal>
#include <iostream>
// 包含头文件ros/ros.h,ROS提供的C++客户端库,在后面的编译配置中要添加相应的依赖库roscpp

#include "rclcpp/rclcpp.hpp"
#include "rclcpp/logger.hpp"
// 使用std_msgs的内置消息或者自定义数据来传递图像数据
#include <sensor_msgs/image_encodings.hpp>
#include <sensor_msgs/msg/image.hpp>

// opencv读取的图像数据传给sensor_msgs的图像消息
#include <cv_bridge/cv_bridge.h>
#include <cv_bridge/cv_bridge.hpp>

// 用来发布和订阅图像信息
#include <image_transport/image_transport.h>
#include "std_msgs/msg/string.hpp"
#include <image_transport/image_transport.hpp>
#include <rcl_interfaces/msg/parameter_event.hpp>
#include "pcl_conversions/pcl_conversions.h"


#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/io/ply_io.h>
#include <pcl/point_types.h>
#include <pcl/console/print.h>
#include <pcl/console/parse.h>
#include <pcl/console/time.h>


#include <opencv2/opencv.hpp>
#include "VzenseNebula_api.h"
using namespace std;
Expand Down
4 changes: 3 additions & 1 deletion ROS2/src/VzenseROS/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
<depend>tf2</depend>
<depend>tf2_ros</depend>
<depend>pcl_conversions</depend>

<depend>image_transport</depend>
<depend>tf2_geometry_msgs</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

Expand Down
2 changes: 1 addition & 1 deletion ROS2/src/VzenseROS/src/vzense_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <thread>
#include "tf2/LinearMath/Matrix3x3.h"
#include "tf2/LinearMath/Quaternion.h"
#include "tf2_geometry_msgs/tf2_geometry_msgs.h"
#include "tf2_geometry_msgs/tf2_geometry_msgs.hpp"
#include <tf2_ros/static_transform_broadcaster.h>

using namespace std::chrono_literals;
Expand Down