Pixel XYZ 深度版双目ROS 环境搭建

深度版双目相机,品牌:Pixel XYZ 实时输出双目原图+距离深度图。

系统 x86 ubuntu20.04, docker ubuntu 18.04

1. 供应商给的 catkin_ws 和 ptest

将两个压缩包解压,然后 copy 到 /root 下面

vim  /etc/ld.so.conf
# 加上一行
/root/ptest/P_XYZ
cd catkin_ws
catkin_make

# 错误信息
```catkin_make 命令报错:
CMake Error at CMakeLists.txt:1:
  Parse error.  Expected a command name, got unquoted argument with text
  "/opt/ros/melodic/share/catkin/cmake/toplevel.cmake".
# 解决
```参考: https://blog.csdn.net/m0_70652514/article/details/128907831
rm src/CMakeLists.txt 
catkin_make


# 错误信息
```catkin_make 命令报错:
make[2]: *** No rule to make target '/home/neardi/ptest/P_XYZ/libav_filterlib.so.3.0.1.01', needed by '/root/catkin_ws/devel/lib/ptest_ros/ptest_ros'.  Stop.
# 解决
```路径问题
vim src/ptest_ros/CMakeLists.txt 

target_link_libraries(${PROJECT_NAME} /root/ptest/P_XYZ/libav_filterlib.so.3.0.1.01)

# 终端1:
roscore
# 终端2:
source devel/setup.bash
rosrun ptest_ros ptest_ros
# 终端3:
rviz

image

image

左目+深度。

请注意该代码发布的 图像 不带时间戳。所以需要加上。

vim  src/ptest_ros/src/main.cpp

// 获取当前时间
ros::Time current_time = ros::Time::now();
std_msgs::Header header;
header.stamp = current_time; // 设置时间戳
// 调整图像尺寸为 640x360
// cv::resize(px_color_2, px_color_2, cv::Size(640, 360));
sensor_msgs::ImagePtr msg1 = cv_bridge::CvImage(header,"bgr8",px_color_2).toImageMsg();
pub1.publish(msg1);
sensor_msgs::ImagePtr msg2 = cv_bridge::CvImage(header,"bgr8",px_depth_2).toImageMsg();
pub2.publish(msg2);

跑 let-net vins-mono

roscore

rosrun ptest_ros ptest_ros

roslaunch fdilink_ahrs ahrs_data.launch

roslaunch vins_estimator d_custom_vi.launch

<launch>
    <!-- 定义配置文件路径参数,默认值为$(find feature_tracker)/../config/uma-vi.yaml -->
    <arg name="config_path" default = "$(find feature_tracker)/../config/custom/d_custom_config_no_extrinsic.yaml" />
      <!-- 定义vins路径参数,默认值为$(find feature_tracker)/../config/../ -->
	  <arg name="vins_path" default = "$(find feature_tracker)/../config/../" />

    <!-- 启动vins_estimator节点 -->
    <node name="vins_estimator" pkg="vins_estimator" type="vins_estimator" output="screen">
       <!-- 设置vins_estimator节点的配置文件参数 -->
       <param name="config_file" type="string" value="$(arg config_path)" />
       <!-- 设置vins_estimator节点的vins文件夹参数 -->
       <param name="vins_folder" type="string" value="$(arg vins_path)" />
    </node>

    <!-- 启动pose_graph节点 -->
    <node name="pose_graph" pkg="pose_graph" type="pose_graph" output="screen">
        <!-- 设置pose_graph节点的配置文件参数 -->
        <param name="config_file" type="string" value="$(arg config_path)" />
        <!-- 设置pose_graph节点的可视化偏移参数 -->
        <param name="visualization_shift_x" type="int" value="0" />
        <param name="visualization_shift_y" type="int" value="0" />
        <!-- 设置pose_graph节点的跳过计数参数 -->
        <param name="skip_cnt" type="int" value="0" />
        <!-- 设置pose_graph节点的跳过距离参数 -->
        <param name="skip_dis" type="double" value="0" />
    </node>

</launch>

roslaunch vins_estimator d_vins_rviz.launch

./devel/lib/feature_tracker/my_feature_tracker_illustration


跑 LET-NET VINS-mono 播放 bag 包

修改这三个文件:image

roslaunch vins_estimator bag_custom_vi.launch
roslaunch vins_estimator d_vins_rviz.launch
./devel/lib/feature_tracker/my_feature_tracker_illustration
rosbag play /root/LET-NET/datasets/sync-ZHZ-indoor-test2.bag
posted @ 2024-07-02 10:46  cold_moon  阅读(7)  评论(0编辑  收藏  举报