Skip to content

Commit

Permalink
modify ProcessDevice() in MicomCommand()
Browse files Browse the repository at this point in the history
- change order of processing command
<messages.Twist> -> <messages.Joystick> -> <messages.Param>
  • Loading branch information
hyunseok-yang committed Dec 18, 2024
1 parent 872ee35 commit fe646ee
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions Assets/Scripts/Devices/MicomCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,23 @@ protected override void ProcessDevice()
}
else
{
var customCmd = receivedMessage.GetMessage<messages.Param>();
if (customCmd != null)
var joystick = receivedMessage.GetMessage<messages.Joystick>();
if (joystick != null)
{
if (customCmd.Name.StartsWith("mowing"))
{
ControlMowing(customCmd.Name, customCmd.Value);
}
ControlJoystick(joystick);
}
else
{
var joystick = receivedMessage.GetMessage<messages.Joystick>();

if (joystick != null)
var customCmd = receivedMessage.GetMessage<messages.Param>();
if (customCmd != null)
{
ControlJoystick(joystick);
if (customCmd.Name.StartsWith("mowing"))
{
ControlMowing(customCmd.Name, customCmd.Value);
}
else if (customCmd.Name.StartsWith("display"))
{
}
}
#if UNITY_EDITOR
else
Expand Down

0 comments on commit fe646ee

Please sign in to comment.