Skip to content

Commit

Permalink
Delete usless member
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrMrozik committed Aug 7, 2023
1 parent 63b58a4 commit b07ca03
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions Assets/RGLUnityPlugin/Scripts/LidarSensor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ public class LidarSensor : MonoBehaviour

private Matrix4x4 lastTransform;
private Matrix4x4 currentTransform;
private Vector3 linearVelocity;
private Vector3 angularVelocity;

public void Awake()
{
Expand Down Expand Up @@ -269,23 +267,17 @@ public void UpdateTransforms()
currentTransform = gameObject.transform.localToWorldMatrix;
}

public void UpdateVelocities()
public void DistortSensorRays()
{
// Calculate delta transform of lidar.
// Sensor linear velocity in m/s.
linearVelocity = (lastTransform.GetColumn(3) - currentTransform.GetColumn(3)) / Time.deltaTime;
Vector3 linearVelocity = (lastTransform.GetColumn(3) - currentTransform.GetColumn(3)) / Time.deltaTime;

Vector3 deltaRotation = Quaternion.LookRotation(lastTransform.GetColumn(2), lastTransform.GetColumn(1)).eulerAngles
- Quaternion.LookRotation(currentTransform.GetColumn(2), currentTransform.GetColumn(1)).eulerAngles;
deltaRotation *= Mathf.Deg2Rad;

// Sensor angular velocity in rad/s.
angularVelocity = deltaRotation / Time.deltaTime;
}
Vector3 angularVelocity = (deltaRotation * Mathf.Deg2Rad) / Time.deltaTime;

public void DistortSensorRays()
{
UpdateVelocities();
rglGraphLidar.UpdateNodeRaysVelocityDistortion(lidarVelocityDistortionNodeId, linearVelocity, angularVelocity);
}
}
Expand Down

0 comments on commit b07ca03

Please sign in to comment.