mirror of
https://github.com/BotChain-Robots/ui.git
synced 2026-07-08 15:07:22 +02:00
UI material + environment change
Made-with: Cursor
This commit is contained in:
@@ -8,14 +8,15 @@ public abstract class ModuleBase : MonoBehaviour
|
||||
|
||||
public void SendToControlLibrary(string moduleType, float currentAngle)
|
||||
{
|
||||
int angleRounded = Mathf.RoundToInt(currentAngle);
|
||||
var json = "";
|
||||
if (moduleType.Contains("Servo"))
|
||||
if (moduleType.Contains("Servo") || moduleType == "Gripper")
|
||||
{
|
||||
json = JsonUtility.ToJson(new ServoCommand
|
||||
{
|
||||
ModuleId = moduleID,
|
||||
Type = moduleType,
|
||||
TargetAngle = currentAngle
|
||||
TargetAngle = angleRounded
|
||||
});
|
||||
}
|
||||
else if(moduleType == "DC")
|
||||
@@ -29,7 +30,7 @@ public abstract class ModuleBase : MonoBehaviour
|
||||
{
|
||||
ModuleId = moduleID,
|
||||
Type = moduleType,
|
||||
RotateByDegrees = Math.Abs(currentAngle),
|
||||
RotateByDegrees = Math.Abs(angleRounded),
|
||||
Direction = direction
|
||||
});
|
||||
}
|
||||
@@ -38,7 +39,7 @@ public abstract class ModuleBase : MonoBehaviour
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (0 != ControlLibrary.send_angle_control(Int32.Parse(moduleID), (int)currentAngle))
|
||||
if (0 != ControlLibrary.send_angle_control(Int32.Parse(moduleID), angleRounded))
|
||||
{
|
||||
Debug.Log("Control library exited with error");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user