Skip to content

Commit

Permalink
Added logging and doubled max values
Browse files Browse the repository at this point in the history
  • Loading branch information
griffinteller committed Aug 16, 2020
1 parent 357f2c5 commit 4e8e16d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Assets/Prefab/Part/Play/BasicTire.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
attachedTireComponent: {fileID: 0}
maxPower: 7500
maxMotorTorque: 3000
maxPower: 15000
maxMotorTorque: 7500
maxAngularVelocity: 100
maxBrakeTorque: 500
rotationalFriction: 0.05
36 changes: 21 additions & 15 deletions Assets/Scripts/Main/UserScriptInterpreter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,24 +275,30 @@ private void Tire(List<string> remainingCommand)
var keyword = remainingCommand[0];
remainingCommand.RemoveAt(0);

switch (keyword)
try
{
case "power":

_actionHandler.SetTirePower(remainingCommand[0], (float) double.Parse(remainingCommand[1]));
break;

case "steering":

_actionHandler.SetTireSteering(remainingCommand[0], (float) double.Parse(remainingCommand[1]));
break;

case "brake":
switch (keyword)
{
case "power":

_actionHandler.SetTireBrake(remainingCommand[0], (float) double.Parse(remainingCommand[1]));
break;
_actionHandler.SetTirePower(remainingCommand[0], (float) double.Parse(remainingCommand[1]));
break;

case "steering":

_actionHandler.SetTireSteering(remainingCommand[0], (float) double.Parse(remainingCommand[1]));
break;

case "brake":

_actionHandler.SetTireBrake(remainingCommand[0], (float) double.Parse(remainingCommand[1]));
break;
}
}
catch (FormatException e)
{
Debug.LogError("Format exception! String was: " + remainingCommand[1]);
}

}
}
}
2 changes: 1 addition & 1 deletion awconnection/Tests/Scratchpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
r = RobotConnection()
r.connect()

power = 0
power = 3000
steering = 0
brake = 0

Expand Down

0 comments on commit 4e8e16d

Please sign in to comment.