Development of a ROS node for the PS4 VR usb camera. This will allow SLAM to be performed using the VR camera and ROS Noetic. In short, creating a basic 3D scanner for less than $50.
This project served as a refresher for ROS Noetic and to give me the opportunity to educate myself about the stereo_image_proc
and rtab-map
ROS nodes. The code and results from this project will be rolled into further thesis work. I will be applying similar SLAM techniques to autonomous navigation in offroad 'hiking trail' environments in the near future. To my knowledge this is the first implementation of RTAB-Map using the Playstation Four VR camera (definetly first in ROS Noetic).
The following packages and softwares are required. A good understanding of how each of them function will also help mitigate any issues.
- Ubuntu 20.04
- ROS Noetic
- PS4 Camera (modified to connect through USB 3.0)
- Camset (git repo)
- camera_calibration ROS package (ROS page)
- rtabmap_ros ROS package (ROS page)
- Fork this repository and insatll all requirements. This assume you already have a ROS environment setup and have a intermediate understanding of how ROS functions.
- Load the usb firmware on to the PS4 camera using the python script found in the Firmware_loader folder
sudo python3 ps4eye_init.py
. The output should confirm the camera has been setup. - Run camset (
camset
) and mark down the input device number of the PS4 camera. Set the cameras exposure to shutter priority instead of automatic. - In
psvr_cam_publisher.py
set the input device number to the number marked down from step 3. Only the variable at the top requires changing. - Complete camera calibration. A sample calibration grid has been provided, be sure to mount it to a flat surface like cardboard or a binder.
- Run the
psvr_launch
launch file.roslaunch PSVR_cam_core psvr_launch.launch
If setup correctly the node map should look like the following.
The following steps should be taken to calibrate your PS4 camera. The repository comes with calibrations files but more accurate results can be achieved after calibrations.
- Download, print, and build a calibration board
- Run the camera_calibration ROS package and follow their calibration tutorial 😉.
- Instead of commiting the calibration parameters to the camera, save the calibration parameters to a file (the file will be save to the tmp/ folder)
- Copy and paste the left and right camera calibration parameters to their respective .txt files found in the calibration folder. Be sure to read the included comments in each file.
Examples have been processed using cloud compare.
A few extras have been included in this package.
- The printable handle as an .stl file.
- A small 8.5"x11" calibration board (each square is approximately 22mm at 100% size)
- Two rqt_reconfigure tunning files. One for StereoBM and one for StereoSGBM