add file costmap_2d_robot

This commit is contained in:
2025-11-18 11:44:01 +07:00
parent 0c61984d3e
commit 59ec58a018
18 changed files with 203 additions and 101 deletions

View File

@@ -412,12 +412,12 @@ namespace costmap_2d
return false;
}
// Copy map data given proper transformations
tf3::Transform tf2_transform;
tf2_transform = convertToTf2Transform(transformMsg.transform);
x = tf2_transform.getOrigin().x();
y = tf2_transform.getOrigin().y();
tf3::Transform tf3_transform;
tf3_transform = convertTotf3Transform(transformMsg.transform);
x = tf3_transform.getOrigin().x();
y = tf3_transform.getOrigin().y();
// Extract the rotation as a quaternion from the transform
tf3::Quaternion rotation = tf2_transform.getRotation();
tf3::Quaternion rotation = tf3_transform.getRotation();
// Convert the quaternion to a yaw angle (in radians)
yaw = tf3::getYaw(rotation);
return true;