Bugfix: the lidar points are now output in the

sensor's coordinate system.
This commit is contained in:
Daniel Santos-Olivan 2020-06-25 16:39:13 +02:00 committed by Marc Garcia Puig
parent 7e2b57338b
commit 6d65a60d23
1 changed files with 3 additions and 6 deletions

View File

@ -138,6 +138,7 @@ bool ARayCastLidar::ShootLaser(const uint32 Channel, const float HorizontalAngle
FHitResult HitInfo(ForceInit);
FTransform actorTransf = GetTransform();
FVector LidarBodyLoc = GetActorLocation();
FRotator LidarBodyRot = GetActorRotation();
FRotator LaserRot (VerticalAngle, HorizontalAngle, 0); // float InPitch, float InYaw, float InRoll
@ -171,12 +172,8 @@ bool ARayCastLidar::ShootLaser(const uint32 Channel, const float HorizontalAngle
);
}
XYZ = LidarBodyLoc - HitInfo.ImpactPoint;
XYZ = UKismetMathLibrary::RotateAngleAxis(
XYZ,
- LidarBodyRot.Yaw + 90,
FVector(0, 0, 1)
);
const FVector hp = HitInfo.ImpactPoint;
XYZ = actorTransf.Inverse().TransformPosition(hp);
return true;
} else {