43 #include <Eigen/Geometry>
57 using Ptr = pcl::shared_ptr<CameraPoseProcessor>;
58 using ConstPtr = pcl::shared_ptr<const CameraPoseProcessor>;
74 std::string output_filename_;
75 std::ofstream out_stream_;
81 output_filename_ (output_filename)
83 out_stream_.open (output_filename_.c_str () );
88 if (out_stream_.is_open ())
91 std::cout <<
"wrote camera poses to file " << output_filename_ << std::endl;
98 if (out_stream_.good ())
101 Eigen::Quaternionf q (pose.rotation ());
102 Eigen::Vector3f t (pose.translation ());
104 out_stream_ << t[0] <<
"," << t[1] <<
"," << t[2]
105 <<
"," << q.w () <<
"," << q.x ()
106 <<
"," << q.y ()<<
"," << q.z () << std::endl;
The CameraPoseProcessor class is an interface to extract camera pose data generated by the pcl_kinfu_...
pcl::shared_ptr< const CameraPoseProcessor > ConstPtr
virtual void processPose(const Eigen::Affine3f &pose)=0
process the camera pose, this method is called at every frame.
pcl::shared_ptr< CameraPoseProcessor > Ptr
virtual ~CameraPoseProcessor()=default
CameraPoseWriter writes all camera poses computed by the KinfuTracker to a file on disk.
void processPose(const Eigen::Affine3f &pose) override
process the camera pose, this method is called at every frame.
CameraPoseWriter(const std::string &output_filename)
Defines functions, macros and traits for allocating and using memory.