tilting velodyne lidar: pointcloud and tf
Hi,
Im working with a velodyne Lidar sensor to eventually be mounted on a UAV. (Ubuntu 20,5.15.0-46-generic,ROS Noetic)
I understand that the velodyne lidar when in a horizontal position has its axis as defined by ROS REP-103, as seen in the figure (x- forward, y-right, z-up)
With the lidar in the horizontal position and running the ros driver package (https://github.com/ros-drivers/velodyne) with
frame_id=velodyne
and visualizing the pointcloud, the result is as expected. The pointcloud is shown with the 'velodyne' frame as below.
I then physically tilt the lidar forward (rotate +90 degrees around +y) and set the frame_id=velodyne_vertical and visualize the pointcloud as below.
now since the pointcloud data is collected in the frame frame_id=velodyne_vertical
, how can I transform the pointcloud to be represented in the original velodyne frame (frame_id=velodyne)?
The lidar mapping package im trying to use requires the pointcloud data to be in the original ROS-REP103 standard.
Any ideas on how that can be achieved? Am i missing something here?
Edit:
TF tree
Edit:
I did just that @ravijoshi, but when visualizing both pointclouds they seem to be coinciding. Doesnt seem to be correct, is it?
Here is the original pointcloud in the frame_id=velodyne_vertical
and here is the same pointcloud in the transformed frame base_link
for reference, here is the callback function to transform the pointcloud
void pcCallback(const PointCloud::ConstPtr &msg)
{
try
{
if (target_frame_.empty() == false)
{
if (pcl_ros::transformPointCloud(target_frame_, *msg, *cloud_tranformed_, tf_listener_) == false)
{
ROS_ERROR("Failed pcl_ros::transformPointCloud target_frame:[%s]",target_frame_.c_str());
return;
}
//BOOST_FOREACH (const pcl::PointXYZ& pt2, cloud_tranformed_->points)
//printf ("transformed points: \t(%f, %f, %f)\n", pt2.x, pt2.y, pt2.z);
pub_transformed_.publish(cloud_tranformed_);
}
}
catch (std::exception &e)
{
ROS_ERROR("%s", e.what());
}
}
hello . did you solved this problem? i just want to do that either. if you had done, is there any references that you can recommend?
for me i want to change the orientation of the point cloud. but for me i am quite newbie in this field. so can you help me?
unfortunately i havent solved it yet. hopefully we can get help from this forum.
@lee hisae please do not create an answer that is not actually an answer to the question being asked. In the future, please use the Comments section for this kind of query.