- Install realsense2-camera for ROS Melodic
sudo apt install ros-$ROS_DISTRO-librealsense2 ros-$ROS_DISTRO-realsense2-camera ros-$ROS_DISTRO-realsense2-description
- Copy the udev file for realsense-device
wget https://github.com/IntelRealSense/librealsense/raw/master/config/99-realsense-libusb.rules
sudo cp 99-realsense-libusb.rules /etc/udev/rules.d/
- Install the core JSK-PCL package
sudo apt-get install ros-melodic-jsk-pcl-ros
- Allow the system to check the normal vector
sudo apt-get install ros-melodic-jsk-rviz-plugins
- Provide organized pointcloud from the camera
sudo apt-get install ros-melodic-rgbd-launch
- Install ros-numpy
sudo apt-get install ros-melodic-ros-numpy
- Install python-pcl
pip install python_pcl-0.3.0rc1-cp27-cp27mu-linux_x86_64
You can test the realsense camera and jsk pcl package by the following instructions.
- This invoke the camera to produce Organized point clouds
roslaunch realsense2_camera rs_rgbd.launch camera:=d415
- This will show you the RViz with all the different edges detected
roslaunch jsk_pcl_ros sample_organized_edge_detector.launch
You may encounter an error about fail to load a .bag file. You need to go to /opt/ros/melodic/share/jsk_pcl_ros/sample/sample_organzied_edge_detector.launch and comment out line 4 to fix this issue. That line is about to load a play_rosbag_shelf_bin.xml.
- Edit the launch file by changing the input topic to your camera's pointcloud.
# line 13 and line 14
<remap from="~input" to="/d415/depth_registered/points"/>
# YOu need to change this topic if you are using other camera.
- Bringup the robot
./start_robot_bringup.sh
- Start robot pcl planning rviz
./start_robot_pcl_planning.sh
- Start edge following
rosrun edge_follwer main.py
Reference: https://github.com/vincent51689453/pointcloud_path_planning
cd src/path_analyze
python3 smoothing.py
In order to create a C++ PCL package, you need to perform several actions.
- Create a ros package
# You have to replace your own package name with my_pcl_tutorial
catkin_create_pkg my_pcl_tutorial pcl_conversions pcl_ros roscpp sensor_msgs
- Modify package.xml and add the followings
<build_depend>libpcl-all-dev</build_depend>
<exec_depend>libpcl-all</exec_depend>
- Modify CMakeLists.txt of the package
# You have to replace your xxx.cpp with pcl_subscribe.cpp
add_executable(${PROJECT_NAME}_node src/pcl_subscribe.cpp)
target_link_libraries(${PROJECT_NAME}_node ${catkin_LIBRARIES})
-
VSCode configuration. Sometimes your vscode may not able seek for the ros header file. Therefore you can use my .vscode/c_cpp_properties.json to solve this issue.
-
Execute a C++ node
# <executable_name> may not be the name of .cpp file.
rosrun <package_name> <executable_name>
-
jsk_pcl_ros/sample/sample_organized_edge_detector.launch
-
jsk_pcl_ros_utils/sample/sample_normal_concatenater.launch
-
jsk_pcl_ros/sample/sample_normal_estimation_omp.launch
-
jsk_pcl_ros/sample/sample_line_segment_detector.launch