目录
一、环境配置
二、步骤
一、环境配置
安装好ubuntu系统和ROS环境
操作系统: Ubuntu 20.04
wget http://fishros.com/install -O fishros && . fishros
二、步骤
打开终端,并在终端命令行输入以下指令:
git clone https://gitee.com/wccworld/read_pcd.git
cd read_pcd/catkin_ws
catkin_make
出现报错
- 没有pcl-conversions
sudo apt-get install ros-noetic-pcl-conversions
- 没有pcl-ros
pcl_ros
没有报错的话,继续
source devel/setup.bash
roslaunch read_pcd read_pcd.launch
找到所下载源码里的read_pcd.launch文件,只需对相应参数进行修改,便可实现PCL点云的滤波、体素降采样、移除离群点、旋转以及平移等操作,具体参数代表的内容如下所示:
<launch><param name="output_frame_id" value = "map" /> <param name="pointCloud_pubTopic" value = "/handle_point" /><param name="pcd_doc_path" value = "/home/yang/read_pcd/catkin_ws/pcd/test.pcd" /><param name="output_pcd_path" value = "/home/yang/read_pcd/catkin_ws/pcd/output.pcd" /><param name="pass_x_min" value = "-100.0" /><param name="pass_x_max" value = "100.0" /><param name="pass_y_min" value = "-100.0" /><param name="pass_y_max" value = "100.0" /><param name="pass_z_min" value = "-1.0" /><param name="pass_z_max" value = "30.0" /><param name="voxel_size" value = "0.1" /><param name="sor_nearby_number" value = "10" /><param name="sor_thresh_value" value = "5.0" /><param name="x_rotate_value" value = "0.0" /><param name="y_rotate_value" value = "0.0" /><param name="z_rotate_value" value = "0.0" /><param name="x_trans_value" value = "0.0" /><param name="y_trans_value" value = "20.0" /><param name="z_trans_value" value = "0.0" /><node pkg="read_pcd" name="read_pcd" type="read_pcd" output="screen" /><node pkg="rviz" type="rviz" name="rviz" args="-d $(find read_pcd)/rviz/read_pcd.rviz" />
</launch>
出现报错
网上找了各种办法没有解决,我直接重新开始安装一遍。
还可以运行自己的数据,修改lanch文件就行。
<launch><param name="output_frame_id" value = "map" /> <param name="pointCloud_pubTopic" value = "/handle_point" /><param name="pcd_doc_path" value = "/home/yang/kitti/datasets/pcd/0000000002.pcd" /><param name="output_pcd_path" value = "/home/yang/readpcd/read_pcd/catkin_ws/outpcd/output.pcd" /><param name="pass_x_min" value = "-100.0" /><param name="pass_x_max" value = "100.0" /><param name="pass_y_min" value = "-100.0" /><param name="pass_y_max" value = "100.0" /><param name="pass_z_min" value = "-1.0" /><param name="pass_z_max" value = "30.0" /><param name="voxel_size" value = "0.1" /><param name="sor_nearby_number" value = "10" /><param name="sor_thresh_value" value = "5.0" /><param name="x_rotate_value" value = "0.0" /><param name="y_rotate_value" value = "0.0" /><param name="z_rotate_value" value = "0.0" /><param name="x_trans_value" value = "0.0" /><param name="y_trans_value" value = "20.0" /><param name="z_trans_value" value = "0.0" /><node pkg="read_pcd" name="read_pcd" type="read_pcd" output="screen" /><node pkg="rviz" type="rviz" name="rviz" args="-d $(find read_pcd)/rviz/read_pcd.rviz" />
</launch>