Skip to content

Commit

Permalink
fix: keyboard control logic
Browse files Browse the repository at this point in the history
Signed-off-by: Alptuğ Cırıt <[email protected]>
  • Loading branch information
mozhoku committed Sep 13, 2024
1 parent 0248a5c commit 837198c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LightingSettings:
m_PrefabAsset: {fileID: 0}
m_Name: LightingSettings
serializedVersion: 6
m_GIWorkflowMode: 0
m_GIWorkflowMode: 1
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_RealtimeEnvironmentLighting: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class AutowareVPPAdapter : MonoBehaviour

/// Control inputs from Autoware
[NonSerialized] public float SteerAngleInput;

private float _steerAngleInput => SteerAngleInput;

public bool IsDefinedSteeringTireRotationRateInput { get; set; }
Expand Down Expand Up @@ -253,15 +254,8 @@ public void HandleAcceleration()
// Store current values
CurrentSpeed = _vehicleController.speed;

if (_throttleInput > 0)
{
SetThrottle((int)(_throttleInput * AutowareToVppMultiplier));
}

if (_brakeInput > 0)
{
SetBrake((int)(_brakeInput * AutowareToVppMultiplier));
}
SetThrottle((int)(_throttleInput * AutowareToVppMultiplier));
SetBrake((int)(_brakeInput * AutowareToVppMultiplier));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class NoCommand : IVehicleControlMode
{
public void ExecuteControlMode(AutowareVPPAdapter adapter)
{
Debug.Log("Control mode: No command");
// Debug.Log("Control mode: No command");
}
}

Expand Down Expand Up @@ -51,23 +51,23 @@ public class Manual : IVehicleControlMode
{
public void ExecuteControlMode(AutowareVPPAdapter adapter)
{
Debug.Log("Control mode: Manual");
// Debug.Log("Control mode: Manual");
}
}

public class Disengaged : IVehicleControlMode
{
public void ExecuteControlMode(AutowareVPPAdapter adapter)
{
Debug.Log("Control mode: Disengaged");
// Debug.Log("Control mode: Disengaged");
}
}

public class NotReady : IVehicleControlMode
{
public void ExecuteControlMode(AutowareVPPAdapter adapter)
{
Debug.Log("Control mode: Not ready");
// Debug.Log("Control mode: Not ready");
}
}
}
Expand Down

0 comments on commit 837198c

Please sign in to comment.