ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Autoware: ndt_mapping doesn't compute transformation matrix

asked 2020-11-12 06:42:27 -0500

mix345 gravatar image

updated 2020-11-12 06:45:53 -0500

Hi,

I run ndt_mapping on the demo bag file (sample_moriyama_150324.bag). It shows /point_raw on rviz, but /points_map can't be visualized and /current_pose is alwasys zero matrix. Does anyone have an idea why?

Environment: Ubuntu18 and Autoware master version.

Steps to reproduce: 1. Download a demo bag files and setup Autoware master version (https://github.com/Autoware-AI/autowa...)

  1. Launch runtime_manager
  2. Launch tf of velodyne and map
  3. Launch ndt_mapping
  4. Launch Rviz
  5. Cancel the pause of .bag file

Console output: ....

"-----------------------------------------------------------------"

(Processed/Input): (306 / 308)

"-----------------------------------------------------------------"

Sequence number: 86918

Number of scan points: 39581 points.

Number of filtered scan points: 3091 points.

transformed_scan_ptr: 39581 points.

map: 39928 points.

NDT has converged: 1

Fitness score: 0

Number of iteration: 0

(x,y,z,roll,pitch,yaw):

(0, 0, 0, 0, -0, 0)

Transformation Matrix:

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

shift: 0

"-----------------------------------------------------------------"

.....

edit retag flag offensive close merge delete

Comments

Hello, I met the same problem. Have you solved it?

franklin gravatar image franklin  ( 2020-12-17 09:38:57 -0500 )edit

I tried Autoware v1.13 instead of the latest master, then it works.

mix345 gravatar image mix345  ( 2020-12-24 20:07:56 -0500 )edit

I met the same problem too!!! The version is v1.14 (master) I'm wondering why this problem happened if you work out the principle.

Kin_Zhang gravatar image Kin_Zhang  ( 2021-03-05 21:23:57 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-03-08 00:29:41 -0500

Kin_Zhang gravatar image

updated 2021-03-08 07:07:54 -0500

I tried Autoware v1.13 instead of the latest master, then it works.

This comment is right if others want to use ndt_mapping

I found the solution: replace these codes in original ndt_mapping.cpp between line 1016 and 1046: Since I don't know why the ROS Wiki's page cannot preview the markdown code well... Here is CSDN view link Roll down to the bottom of the page

double tf_x, tf_y, tf_z, tf_roll, tf_pitch, tf_yaw; // 3. Try getting base_link -> lidar TF from tf_* params if (!received_tf) { if (nh.getParam("tf_x", tf_x) && nh.getParam("tf_y", tf_y) && nh.getParam("tf_z", tf_z) && nh.getParam("tf_roll", tf_roll) && nh.getParam("tf_pitch", tf_pitch) && nh.getParam("tf_yaw", tf_yaw)) { tf::Vector3 trans(tf_x, tf_y, tf_z); tf::Quaternion quat; quat.setRPY(tf_roll, tf_pitch, tf_yaw); tf_baselink2primarylidar.setOrigin(trans); tf_baselink2primarylidar.setRotation(quat); received_tf = true; } else { ROS_WARN("Query base_link to primary lidar frame through tf_* params failed"); }

} if (received_tf) { ROS_INFO("base_link to primary lidar transform queried successfully");

tf_baselink2primarylidar.getOrigin();
tf_x = tf_baselink2primarylidar.getOrigin().getX();
tf_y = tf_baselink2primarylidar.getOrigin().getY();
tf_z = tf_baselink2primarylidar.getOrigin().getZ();
Eigen::Translation3f tl_btol(tf_x, tf_y, tf_z);// tl: translation

tf::Matrix3x3(tf_baselink2primarylidar.getRotation()).getRPY( tf_roll, tf_pitch,tf_yaw);
Eigen::AngleAxisf rot_x_btol(tf_roll, Eigen::Vector3f::UnitX());  // rot: rotation
Eigen::AngleAxisf rot_y_btol(tf_pitch, Eigen::Vector3f::UnitY());
Eigen::AngleAxisf rot_z_btol(tf_yaw, Eigen::Vector3f::UnitZ());
tf_btol = (tl_btol * rot_z_btol * rot_y_btol * rot_x_btol).matrix();
tf_ltob = tf_btol.inverse();

}

And the reason is 1.14 didn't update tf_ltob that used in computing transformation matrix.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-11-12 06:42:27 -0500

Seen: 871 times

Last updated: Mar 08 '21