This package has been tested with Ubuntu 20.04, ROS Noetic and OpenCV 4.
- C++11 or higher
- ROS
- Eigen3
- OpenCV 4 (3 might be supported as well but not tested)
- kitti2bag (for KITTI rosbag)
Clone the repository in your home:
cd ~
git clone https://github.com/gizemasya/3D-to-2D-Projector.git
Build the package with:
cd 3D-to-2D-Projector/
catkin_make
source ~/3D-to-2D-Projector/devel/setup.bash
Firsly, run the node:
rosrun projecting_frames_pkg Pinhole
In another terminal, start playing the KITTI rosbag:
cd ~
rosbag play kitti_2011_09_26_drive_0002_synced.bag
To set your desired point in 3D, you can change the values of origin_of_temp_in_world_ and rotation_of_temp_in_world_ variables from Pinhole.cpp line 3.
- origin_of_temp_in_world_ variable takes x,y,z coordinates of the 3D point relative to the world frame.
- rotation_of_temp_in_world_ variable is a quaternion represents the rotation of the 3D point relative to the world frame, takes x,y,z,w as parameters.