ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

6D Pose export as PCD

asked 2022-02-11 09:41:49 -0600

LauRe gravatar image

updated 2022-02-14 00:50:56 -0600

Hello,

I have 6D-Pose data that I want to save, originating from a processed LiDAR sensor. Specifically x,y,z,roll,pitch,yaw. I need to save the data later (possibly PCD Format?)

According to some documentation I've found, I need to use the Narf36 format to save as PCD. What would be the correct way of implementing this? I already have the data as rosbags, but I would like to have them preferably as PCD.

Im thinking:

        pubKey6DPoses = nh.advertise<sensor_msgs::PointCloud2>("/key_6D_pose_origin", 2);
        ros::Publisher pubKey6DPoses;

        cloudKeyPoses6D->points[i].x = cloudKeyPoses3D->points[i].x;
        cloudKeyPoses6D->points[i].y = cloudKeyPoses3D->points[i].y;
        cloudKeyPoses6D->points[i].z = cloudKeyPoses3D->points[i].z;
        cloudKeyPoses6D->points[i].roll  = isamCurrentEstimate.at<Pose3>(i).rotation().pitch();
        cloudKeyPoses6D->points[i].pitch = isamCurrentEstimate.at<Pose3>(i).rotation().yaw();
        cloudKeyPoses6D->points[i].yaw   = isamCurrentEstimate.at<Pose3>(i).rotation().roll();

        pcl::PointCloud<pcl::Narf36> cloudMsg6DTemp;
        pcl::toROSMsg(*cloudKeyPoses6D, cloudMsg6DTemp);
        cloudMsgTemp.header.stamp = ros::Time().fromSec(timeLaserOdometry);
        cloudMsgTemp.header.frame_id = "camera_init";
        pubKey6DPoses.publish(cloudMsgTemp);

Can pointcloud2 be used? Is PCD the best format for 6D poses? Thank you in advance for your help.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-02-15 08:31:31 -0600

LauRe gravatar image

Currently exporting as .csv, but still interested in a PCD variant.

edit flag offensive delete link more
0

answered 2022-02-11 12:13:07 -0600

Airuno2L gravatar image

There is a message specifically for pose

edit flag offensive delete link more

Comments

To answer the part of your question about saving the data for later, ros has a data logging system called bags that let you record any messages with time stamp information so you can play it back later.

Airuno2L gravatar image Airuno2L  ( 2022-02-11 12:41:02 -0600 )edit

Thank you very much for your answer. I was looking more for how I can save this data into PCD format (or something comparable for that matter). I could save as .csv, but I know ros somehow allows additional data in PCD files.

I've edited my question to be clearer in that regard.

LauRe gravatar image LauRe  ( 2022-02-14 00:54:08 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2022-02-11 09:41:49 -0600

Seen: 73 times

Last updated: Feb 15 '22