소스 검색

再次更新

样式分支
applelon 2 년 전
부모
커밋
05647d081c
42개의 변경된 파일4913개의 추가작업 그리고 46개의 파일을 삭제
  1. +9
    -0
      BPASmartClient.Business/BPASmartClient.Business.csproj
  2. +7
    -0
      BPASmartClient.Business/Class1.cs
  3. +17
    -0
      BPASmartClient.Device/DeviceStatus.cs
  4. +16
    -0
      BPASmartClient.Device/IDevice.cs
  5. +4
    -0
      BPASmartClient.DeviceProxy/BPASmartClient.DeviceProxy.csproj
  6. +26
    -0
      BPASmartClient.DeviceProxy/DeviceMgr.cs
  7. +9
    -0
      BPASmartClient.Lebai/BPASmartClient.Lebai.csproj
  8. +0
    -8
      BPASmartClient.Lebai/Class1.cs
  9. +26
    -0
      BPASmartClient.Lebai/ELebaiRModel.cs
  10. +244
    -0
      BPASmartClient.Lebai/LebaiRobot.cs
  11. +4
    -4
      BPASmartClient.Modbus/ModbusTcp.cs
  12. +9
    -0
      BPASmartClient.MorkIC/BPASmartClient.MorkIC.csproj
  13. +7
    -0
      BPASmartClient.MorkIC/Device_MorkIC.cs
  14. +2
    -2
      BPASmartClient.MorkT/Device_MorkT.cs
  15. +9
    -0
      BPASmartClient.OrderProxy/BPASmartClient.OrderProxy.csproj
  16. +7
    -0
      BPASmartClient.OrderProxy/Class1.cs
  17. +9
    -0
      BPASmartClient.Peripheral/BPASmartClient.Peripheral.csproj
  18. +46
    -0
      BPASmartClient.Peripheral/BasePeripheral.cs
  19. +16
    -0
      BPASmartClient.Peripheral/DRIVER_CMD.cs
  20. +29
    -0
      BPASmartClient.Peripheral/IBasePeripheral.cs
  21. +26
    -0
      BPASmartClient/DeviceInfo.xml
  22. +15
    -0
      Lebai.SDK/Dtos/GetTasksInput.cs
  23. +15
    -0
      Lebai.SDK/Dtos/LebaiHttpResult.cs
  24. +85
    -0
      Lebai.SDK/Dtos/RobotStatus.cs
  25. +16
    -0
      Lebai.SDK/Dtos/TaskExecuteResult.cs
  26. +127
    -0
      Lebai.SDK/Dtos/TaskInfo.cs
  27. +43
    -0
      Lebai.SDK/Dtos/TaskStatus.cs
  28. +49
    -0
      Lebai.SDK/Dtos/TasksResult.cs
  29. +14
    -0
      Lebai.SDK/Exceptions/RobotException.cs
  30. +14
    -0
      Lebai.SDK/Exceptions/RobotStatusException.cs
  31. +14
    -0
      Lebai.SDK/Exceptions/RobotTaskException.cs
  32. +4
    -0
      Lebai.SDK/FodyWeavers.xml
  33. +47
    -0
      Lebai.SDK/Lebai.SDK.csproj
  34. +1844
    -0
      Lebai.SDK/LebaiRobotClient.cs
  35. +275
    -0
      Lebai.SDK/LeibaiRobotClient_HttpPart.cs
  36. +56
    -0
      Lebai.SDK/Protos/os_server.proto
  37. +606
    -0
      Lebai.SDK/Protos/private_controller.proto
  38. +735
    -0
      Lebai.SDK/Protos/robot_controller.proto
  39. +193
    -0
      Lebai.SDK/Protos/robot_test.proto
  40. +46
    -0
      Lebai.SDK/Protos/simulation.proto
  41. +126
    -0
      Lebai.SDK/messages.proto
  42. +67
    -32
      SmartClient.sln

+ 9
- 0
BPASmartClient.Business/BPASmartClient.Business.csproj 파일 보기

@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>

+ 7
- 0
BPASmartClient.Business/Class1.cs 파일 보기

@@ -0,0 +1,7 @@
namespace BPASmartClient.Business
{
public class Class1
{

}
}

+ 17
- 0
BPASmartClient.Device/DeviceStatus.cs 파일 보기

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.Device
{
public class DeviceStatus
{
public Dictionary<string,object> status=new Dictionary<string,object>();

public void Update(string key, object value) {
status[key] = value;
}
}
}

+ 16
- 0
BPASmartClient.Device/IDevice.cs 파일 보기

@@ -6,8 +6,24 @@ using System.Threading.Tasks;

namespace BPASmartClient.Device
{
/// <summary>
/// 设备接口
/// </summary>
public interface IDevice
{
DeviceStatus Status { get; set; }
/// <summary>
/// 初始化设备加载
/// </summary>
void Initliaze();
/// <summary>
/// 开启设备主任务
/// </summary>
void StartMain();
/// <summary>
/// 设备停止
/// </summary>
void Stop();

}
}

+ 4
- 0
BPASmartClient.DeviceProxy/BPASmartClient.DeviceProxy.csproj 파일 보기

@@ -4,4 +4,8 @@
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\BPASmartClient.Helper\BPASmartClient.Helper.csproj" />
</ItemGroup>

</Project>

+ 26
- 0
BPASmartClient.DeviceProxy/DeviceMgr.cs 파일 보기

@@ -0,0 +1,26 @@
using BPASmartClient.Device;
using BPASmartClient.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.DeviceProxy
{
/// <summary>
/// 设备管理器,统一管理所有设备资源
/// </summary>
public class DeviceMgr:Singleton<DeviceMgr>
{
//设备集合
private List<IDevice> devices=new List<IDevice>();

/// <summary>
/// 设备加载
/// </summary>
public void LoadDevice() {
}
}
}

+ 9
- 0
BPASmartClient.Lebai/BPASmartClient.Lebai.csproj 파일 보기

@@ -2,6 +2,15 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\BPASmartClient.Helper\BPASmartClient.Helper.csproj" />
<ProjectReference Include="..\BPASmartClient.Message\BPASmartClient.Message.csproj" />
<ProjectReference Include="..\BPASmartClient.Peripheral\BPASmartClient.Peripheral.csproj" />
<ProjectReference Include="..\Lebai.SDK\Lebai.SDK.csproj" />
</ItemGroup>

</Project>

+ 0
- 8
BPASmartClient.Lebai/Class1.cs 파일 보기

@@ -1,8 +0,0 @@
using System;

namespace BPASmartClient.Lebai
{
public class Class1
{
}
}

+ 26
- 0
BPASmartClient.Lebai/ELebaiRModel.cs 파일 보기

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.Lebai
{
public enum ELebaiRModel : int
{
硬件通讯故障 = 0,
已急停 = 1,
初始化中 = 2,
已关机 = 3,
已开机 = 4,
空闲状态 = 5,
暂停中 = 6,
运行中 = 7,
固件更新中 = 8,
启动中 = 9,
停止中 = 10,
示教中 = 11,
普通停止 = 12,
微调中 = 13
}
}

+ 244
- 0
BPASmartClient.Lebai/LebaiRobot.cs 파일 보기

@@ -0,0 +1,244 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Lebai.SDK;
using Lebai.SDK.Dtos;
using Robotc;
using BPASmartClient.Message;
using BPASmartClient.Helper;
using TaskStatus = Lebai.SDK.Dtos.TaskStatus;
using BPASmartClient.Peripheral;

namespace BPASmartClient.Lebai
{
public class LebaiRobot: BasePeripheral
{

//public const int SENCE_自嗨 = 10008;
//public const int SENCE_接冰淇淋1 = 10004;
//public const int SENCE_接冰淇淋2 = 10003;
//public const int SENCE_接冰淇淋3 = 10005;
//public const int SENCE_咖啡 = 10006;
//#region 新增场景
//public const int SENCE_取咖啡杯 = 10013;
//public const int SENCE_咖啡杯检测 = 10014;
//public const int SENCE_再次取杯 = 10017;
//public const int SENCE_接咖啡 = 10015;
//public const int SENCE_送咖啡 = 10016; //无取走咖啡检测配合场景
//public const int SENCE_New送咖啡 = 10021;//有取走咖啡检测配合场景
//public const int SENCE_有无咖啡检测 = 10019;
//public const int SENCE_再送咖啡 = 10020;
//public const int SENCE_复位 = 10018;
//#endregion
//public const int SENCE_欢迎 = 10002;


#region 且时且多设备
//取咖啡杯 set:=1 get:=101 10031
//取冰淇淋杯 set:=1 get:=101 10032
//咖啡杯检测 set:=1 get:=101 10033
//冰淇淋杯检测 set:=1 get:=101 10034
//二次取咖啡杯 set:=1 get:=101 10035
//二次取冰淇淋杯 set:=1 get:=101 10036
//接咖啡 set:=1 get:=101 10037
//接冰淇淋公共点 set:=1 get:=101 10038
//接1号冰淇淋 set:=1 get:=101 10039
//接2号冰淇淋 set:=1 get:=101 10040
//接3号冰淇淋 set:=1 get:=101 10041
//放咖啡位置 set:=1 get:=101 10042
//放冰淇淋位置 set:=1 get:=101 10043

public const int SENCE_取咖啡杯 = 10031;
public const int SENCE_取冰淇淋杯 = 10032;
public const int SENCE_咖啡杯检测 = 10033;
public const int SENCE_冰淇淋杯检测 = 10034;
public const int SENCE_二次取咖啡杯 = 10035;
public const int SENCE_二次取冰淇淋杯 = 10036;
public const int SENCE_接咖啡 = 10037;
public const int SENCE_接冰淇淋公共点 = 10038;
public const int SENCE_接1号冰淇淋 = 10039;
public const int SENCE_接2号冰淇淋 = 10040;
public const int SENCE_接3号冰淇淋 = 10041;
public const int SENCE_放咖啡位置 = 10042;
public const int SENCE_放冰淇淋位置 = 10043;
#endregion

/// <summary>
/// IP地址
/// </summary>
public string IpAddress { get; set; }
/// <summary>
/// 抓手上传感器输入位索引
/// </summary>
public int HandSensor { get; set; }
/// <summary>
/// 输出信号量索引
/// </summary>
public int OutputSingalValue { get; set; }

private LebaiRobotClient client;
private RobotData robotData;
public bool IsIdle { get; set; } = false;
public bool IsConnected { get { return null != robotData; } }

public void Connect(string ip)
{
bool ErrorFlag = false;
while (robotData == null)
{
try
{
client = new LebaiRobotClient(ip);
robotData = client.GetRobotData().Result;
}
catch (Exception ex)
{
if (!ErrorFlag)
{
MessageLog.GetInstance.ShowEx(ex.ToString());
ErrorFlag = true;
}
Thread.Sleep(3000);
}
}
StartRobot();
MessageLog.GetInstance.Show("乐百机器人连接成功!");
}

public void GetRobotModeStatus()
{

if (robotData == null) return;
int mode = robotData.RobotMode.Mode;
IsIdle = mode == 5;
for (int i = 0; i < 14; i++)
{
if (RTrig.GetInstance(((ELebaiRModel)i).ToString()).Start(mode == i))
MessageLog.GetInstance.Show(((ELebaiRModel)i).ToString());
}
}
public void GetSpeed()
{
//client.StartSys().GetAwaiter();
var aa = client.GetActualTcpSpeed().GetAwaiter();
//robotData.RobotMode.Mode
}

/// <summary>
/// 启动机器人
/// </summary>
public async void StartRobot()
{
if (robotData != null)
{
await client.StartSys();
await client.Sync();
MessageLog.GetInstance.Show("机器人启动成功");
}
}

/// <summary>
/// 获取抓手重量
/// </summary>
/// <returns></returns>
public double GetClawWdight()
{
if (robotData != null)
{
return client.GetClawWeight().Result.Weight_;
}
return 0;
}

/// <summary>
/// 获取信号量
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
public SignalResult? GetValueAsync(int index = 0)
{
if (robotData == null) return default(SignalResult);
SignalValue signalValue = new SignalValue();
signalValue.Index = index;
return client?.GetSignal(signalValue).Result;
}

/// <summary>
/// 设置信号量
/// </summary>
/// <param name="index"></param>
/// <param name="value"></param>
/// <returns></returns>
public SignalResult? SetValue(int value, int index = 0)
{
if (robotData == null) return default;
SignalValue signalValue = new SignalValue();
signalValue.Index = index;
signalValue.Value = value;
return client.SetSignal(signalValue).Result;
}

/// <summary>
/// 获取输入DI状态
/// </summary>
/// <param name="pin"></param>
/// <returns></returns>
public bool GetInput(int pin = 0)
{
if (client == null) return false;
var res = client.GetDIO(new IOPin() { Pin = pin }).Result;
if (res != null)
{
return res.Value == 1 ? true : false;
}
return false;
}

/// <summary>
/// 运行指定的场景
/// </summary>
/// <param name="id"></param>
public async void Scene(int id)
{
CancellationToken cancellationToken = default(CancellationToken);
var result = await client.GetTasks(new GetTasksInput { PageIndex = 1, PageSize = 1 }, cancellationToken);
var first = result?.Items?.FirstOrDefault();
var r = first == null || first.Status != TaskStatus.Running && first.Status != TaskStatus.Pause;
while (!r)
{
Thread.Sleep(5);
result = await client.GetTasks(new GetTasksInput { PageIndex = 1, PageSize = 1 }, cancellationToken);
first = result?.Items?.FirstOrDefault();
r = first == null || first.Status != TaskStatus.Running && first.Status != TaskStatus.Pause;
}
while (GetValueAsync().Value != 0)
{
Thread.Sleep(500);
}
Thread.Sleep(1000);
if (robotData == null || client == null) return;
//if (!client.GetIsCanRunTask().Result) return;
await client?.RunScene(id);
MessageLog.GetInstance.Show($"调用场景:{id}");
}

protected override void InitStatus()
{
status["Connected"] = false;
status["HandSensor"] = 0;
status["OutputSingalValue"] = 0;
}

public override void Start()
{
Connect(IpAddress);
}

public override void Stop()
{
}
}
}

BPASmartClient.Modbus/ModbusTcpHelper.cs → BPASmartClient.Modbus/ModbusTcp.cs 파일 보기

@@ -9,12 +9,12 @@ using System.Threading;

namespace BPASmartClient.Modbus
{
public class ModbusTcpHelper
public class ModbusTcp
{

private volatile static ModbusTcpHelper _Instance;
public static ModbusTcpHelper GetInstance => _Instance ?? (_Instance = new ModbusTcpHelper());
private ModbusTcpHelper() { }
private volatile static ModbusTcp _Instance;
public static ModbusTcp GetInstance => _Instance ?? (_Instance = new ModbusTcp());
private ModbusTcp() { }

private ModbusFactory modbusFactory;
private IModbusMaster master;

+ 9
- 0
BPASmartClient.MorkIC/BPASmartClient.MorkIC.csproj 파일 보기

@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>

+ 7
- 0
BPASmartClient.MorkIC/Device_MorkIC.cs 파일 보기

@@ -0,0 +1,7 @@
namespace BPASmartClient.MorkIC
{
public class Device_MorkIC
{

}
}

BPASmartClient.Device/IDeviceStatus.cs → BPASmartClient.MorkT/Device_MorkT.cs 파일 보기

@@ -4,9 +4,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.Device
namespace BPASmartClient.MorkT
{
internal class IDeviceStatus
public class Device_MorkT
{
}
}

+ 9
- 0
BPASmartClient.OrderProxy/BPASmartClient.OrderProxy.csproj 파일 보기

@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>

+ 7
- 0
BPASmartClient.OrderProxy/Class1.cs 파일 보기

@@ -0,0 +1,7 @@
namespace BPASmartClient.OrderProxy
{
public class Class1
{

}
}

+ 9
- 0
BPASmartClient.Peripheral/BPASmartClient.Peripheral.csproj 파일 보기

@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>

+ 46
- 0
BPASmartClient.Peripheral/BasePeripheral.cs 파일 보기

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.Peripheral
{
/// <summary>
/// 外设基类
/// </summary>
public abstract class BasePeripheral : IBasePeripheral
{
/// <summary>
/// 是否已连接
/// </summary>
public bool IsConnected { get; protected set; }
/// <summary>
/// 是否工作正常
/// </summary>
public bool IsWork { get; protected set; }
/// <summary>
/// 外设状态集合
/// </summary>
protected Dictionary<string, object> status = new Dictionary<string, object>();

/// <summary>
/// 初始化外设状态
/// </summary>
protected abstract void InitStatus();

public object? GetStatus(string statusName)
{
if (status.ContainsKey(statusName))
return status[statusName];
return null;
}


public abstract void Start();

public abstract void Stop();

}
}

+ 16
- 0
BPASmartClient.Peripheral/DRIVER_CMD.cs 파일 보기

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.Peripheral
{
/// <summary>
/// 驱动执行命令
/// </summary>
public enum DRIVER_CMD
{
LEBAI_RUN_SENCE,
}
}

+ 29
- 0
BPASmartClient.Peripheral/IBasePeripheral.cs 파일 보기

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.Peripheral
{
/// <summary>
/// 外设接口
/// </summary>
public interface IBasePeripheral
{
/// <summary>
/// 获取指定状态值
/// </summary>
/// <param name="statusName">状态名称</param>
/// <returns>状态值</returns>
object? GetStatus(string statusName);
/// <summary>
/// 驱动开启
/// </summary>
void Start();
/// <summary>
/// 驱动停止
/// </summary>
void Stop();
}
}

+ 26
- 0
BPASmartClient/DeviceInfo.xml 파일 보기

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" ?>
<BPADevices>
<Device Name="MorkT">
<Peripherals>
<Peripheral Module="BPASmartClient.Lebai.LebaiRobot">
<Parameters>
<IpAddress>127.0.0.1</IpAddress>
<HandSensor>1</HandSensor>
<OutputSingalValue>0</OutputSingalValue>
</Parameters>
</Peripheral>
<Peripheral Module="BPASmartClient.DRCoffee">
<Parameters>
<COM>COM5</COM>
<BaudRate>9600</BaudRate>
</Parameters>
</Peripheral>
<Peripheral Module="BPASmartClient.BPASmartClient.SCChip">
<Parameters>
<COM>COM6</COM>
<BaudRate>115200</BaudRate>
</Parameters>
</Peripheral>
</Peripherals>
</Device>
</BPADevices>

+ 15
- 0
Lebai.SDK/Dtos/GetTasksInput.cs 파일 보기

@@ -0,0 +1,15 @@
namespace Lebai.SDK.Dtos
{
public class GetTasksInput
{
/// <summary>
/// 页索引
/// </summary>
public int PageIndex { get; set; } = 1;

/// <summary>
/// 页大小
/// </summary>
public int PageSize { get; set; } = 10;
}
}

+ 15
- 0
Lebai.SDK/Dtos/LebaiHttpResult.cs 파일 보기

@@ -0,0 +1,15 @@
namespace Lebai.SDK.Dtos
{
public class LebaiHttpResult<T>
{
/// <summary>
/// 数据
/// </summary>
public T Data { get; set; }

/// <summary>
/// 错误码
/// </summary>
public int Code { get; set; }
}
}

+ 85
- 0
Lebai.SDK/Dtos/RobotStatus.cs 파일 보기

@@ -0,0 +1,85 @@
using System.ComponentModel;

namespace Lebai.SDK.Dtos
{
public enum RobotStatus
{
/// <summary>
/// 已断开连接
/// </summary>
[Description("已断开连接")] DISCONNECTED = 0,


/// <summary>
/// 急停停止状态
/// </summary>
[Description("急停停止状态")] ESTOP = 1,


/// <summary>
/// 启动中
/// </summary>
[Description("启动中")] BOOTING = 2,


/// <summary>
/// 电源关闭
/// </summary>
[Description("电源关闭")] ROBOT_OFF = 3,


/// <summary>
/// 电源开启
/// </summary>
[Description("电源开启")] ROBOT_ON = 4,


/// <summary>
/// 空闲中
/// </summary>
[Description("空闲中")] IDLE = 5,


/// <summary>
/// 暂停中
/// </summary>
[Description("暂停中")] PAUSED = 6,


/// <summary>
/// 机器人运动运行中
/// </summary>
[Description("机器人运动运行中")] RUNNING = 7,


/// <summary>
/// 更新固件中
/// </summary>
[Description("更新固件中")] UPDATING = 8,


/// <summary>
/// 启动中
/// </summary>
[Description("启动中")] STARTING = 9,


/// <summary>
/// 停止中
/// </summary>
[Description("停止中")] STOPPING = 10,


/// <summary>
/// 示教中
/// </summary>
[Description("示教中")] TEACHING = 11,


/// <summary>
/// 普通停止
/// </summary>
[Description("普通停止")] STOP = 12,
}
}

+ 16
- 0
Lebai.SDK/Dtos/TaskExecuteResult.cs 파일 보기

@@ -0,0 +1,16 @@
namespace Lebai.SDK.Dtos
{
public class TaskExecuteResult
{
public int Id { get; set; }

public TaskExecuteResult()
{
}

public void Deconstruct(out int id)
{
id = Id;
}
}
}

+ 127
- 0
Lebai.SDK/Dtos/TaskInfo.cs 파일 보기

@@ -0,0 +1,127 @@
using System;


namespace Lebai.SDK.Dtos
{
public class OriginTaskInfo
{
public int Id { get; set; }

public int? scene_id { get; set; }

public int execute_count { get; set; }

public int executed_count { get; set; }

public string Name { get; set; }

public TaskStatus Status { get; set; }

public string Comment { get; set; }

public string start_time { get; set; }

public string end_time { get; set; }

public long consume_time { get; set; }

public int Mode { get; set; }

public string create_time { get; set; }

public string update_time { get; set; }

public int? scene_type { get; set; }

public object first_pose { get; set; }

public TaskInfo ToTaskInfo()
{
return new TaskInfo
{
Id = Id,
Comment = Comment,
Mode = Mode,
Name = Name,
Status = Status,
ConsumeTime = consume_time,
CreationTime = create_time,
EndTime = end_time,
ExecuteCount = execute_count,
ExecutedCount = executed_count,
FirstPose = first_pose,
SceneId = scene_id,
SceneType = scene_type,
StartTime = start_time,
UpdateTime = update_time
};
}
}

public class TaskInfo
{
public int Id { get; set; }


/// <summary>
/// 场景Id
/// </summary>
public int? SceneId { get; set; }

/// <summary>
/// 执行次数
/// </summary>
public int? ExecuteCount { get; set; }

/// <summary>
/// 执行的次数
/// </summary>
public int? ExecutedCount { get; set; }

/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }

/// <summary>
/// 状态
/// </summary>
public TaskStatus? Status { get; set; }

/// <summary>
/// 注释
/// </summary>
public string Comment { get; set; }

/// <summary>
/// 开始时间
/// </summary>
public string StartTime { get; set; }

/// <summary>
/// 结束时间
/// </summary>
public string EndTime { get; set; }
public long? ConsumeTime { get; set; }

public int? Mode { get; set; }


/// <summary>
/// 创建时间
/// </summary>
public string CreationTime { get; set; }

/// <summary>
/// 更新时间
/// </summary>
public string UpdateTime { get; set; }


public int? SceneType { get; set; }


public object FirstPose { get; set; }
}
}

+ 43
- 0
Lebai.SDK/Dtos/TaskStatus.cs 파일 보기

@@ -0,0 +1,43 @@
using System.ComponentModel;

namespace Lebai.SDK.Dtos
{
public enum TaskStatus
{
/// <summary>
/// 空闲
/// </summary>
[Description("空闲")]
Idea = 0,

/// <summary>
/// 运行
/// </summary>
[Description("运行")]
Running = 1,

/// <summary>
/// 暂停
/// </summary>
[Description("暂停")]
Pause = 2,

/// <summary>
/// 运行成功
/// </summary>
[Description("运行成功")]
RunSuccess = 3,

/// <summary>
/// 手动停止
/// </summary>
[Description("手动停止")]
ManualStop = 4,

/// <summary>
/// 异常停止
/// </summary>
[Description("异常停止")]
AbnormalStop = 5
}
}

+ 49
- 0
Lebai.SDK/Dtos/TasksResult.cs 파일 보기

@@ -0,0 +1,49 @@
using System.Linq;

namespace Lebai.SDK.Dtos
{
public class OriginTasksResult
{
public int pi { get; set; }

public int ps { get; set; }

public int total { get; set; }

public OriginTaskInfo[] records { get; set; }

public TasksResult ToResult()
{
return new TasksResult
{
Items = records.Select(n=>n.ToTaskInfo()).ToArray(),
PageIndex = pi,
PageSize = ps,
TotalCount = total
};
}
}

public class TasksResult
{
/// <summary>
/// 页索引
/// </summary>
public int PageIndex { get; set; }

/// <summary>
/// 页大小
/// </summary>
public int PageSize { get; set; }

/// <summary>
/// 总数量
/// </summary>
public int TotalCount { get; set; }

/// <summary>
/// 任务列表
/// </summary>
public TaskInfo[] Items { get; set; }
}
}

+ 14
- 0
Lebai.SDK/Exceptions/RobotException.cs 파일 보기

@@ -0,0 +1,14 @@
using System;

namespace Lebai.SDK.Exceptions
{
public class RobotException : Exception
{
public bool CanRetry { get; }

public RobotException(string message, bool canRetry = false) : base(message)
{
CanRetry = canRetry;
}
}
}

+ 14
- 0
Lebai.SDK/Exceptions/RobotStatusException.cs 파일 보기

@@ -0,0 +1,14 @@
using Lebai.SDK.Dtos;

namespace Lebai.SDK.Exceptions
{
public class RobotStatusException : RobotException
{
private RobotStatus RobotStatus { get; }

public RobotStatusException(RobotStatus robotStatus) : base(EnumExtension.GetEnumDescription(robotStatus))
{
RobotStatus = robotStatus;
}
}
}

+ 14
- 0
Lebai.SDK/Exceptions/RobotTaskException.cs 파일 보기

@@ -0,0 +1,14 @@
using Lebai.SDK.Dtos;

namespace Lebai.SDK.Exceptions
{
public class RobotTaskException : RobotException
{
public TaskStatus? TaskStatus { get; }

public RobotTaskException(TaskStatus? taskStatus) : base(EnumExtension.GetEnumDescription(taskStatus))
{
TaskStatus = taskStatus;
}
}
}

+ 4
- 0
Lebai.SDK/FodyWeavers.xml 파일 보기

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

+ 47
- 0
Lebai.SDK/Lebai.SDK.csproj 파일 보기

@@ -0,0 +1,47 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>0.3.13</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFrameworks>net5.0</TargetFrameworks>
<RepositoryUrl>https://github.com/lebai-robotics/lebai-dotnet-sdk</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.19.1" />
<PackageReference Include="Grpc.Net.Client" Version="2.40.0" />
<PackageReference Include="Grpc.Tools" Version="2.42.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

<Protobuf Include="messages.proto">
<GrpcServices>Client</GrpcServices>
<Access>Public</Access>
<ProtoCompile>True</ProtoCompile>
<CompileOutputs>True</CompileOutputs>
<Generator>MSBuild:Compile</Generator>
</Protobuf>
<Protobuf Include="Protos\os_server.proto">
<GrpcServices>Client</GrpcServices>
<Generator>MSBuild:Compile</Generator>
</Protobuf>
<Protobuf Include="Protos\private_controller.proto">
<GrpcServices>Client</GrpcServices>
<Generator>MSBuild:Compile</Generator>
</Protobuf>
<Protobuf Include="Protos\robot_controller.proto">
<GrpcServices>Client</GrpcServices>
<Generator>MSBuild:Compile</Generator>
</Protobuf>
<Protobuf Include="Protos\robot_test.proto">
<Generator>MSBuild:Compile</Generator>
<GrpcServices>Client</GrpcServices>
</Protobuf>
<Protobuf Include="Protos\simulation.proto">
<Generator>MSBuild:Compile</Generator>
<GrpcServices>Client</GrpcServices>
</Protobuf>
</ItemGroup>

</Project>

+ 1844
- 0
Lebai.SDK/LebaiRobotClient.cs
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 275
- 0
Lebai.SDK/LeibaiRobotClient_HttpPart.cs 파일 보기

@@ -0,0 +1,275 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Lebai.SDK.Dtos;
using Lebai.SDK.Exceptions;
using TaskStatus = Lebai.SDK.Dtos.TaskStatus;
#if NET5_0||NET6_0
using System.Net.Http.Json;

#endif

namespace Lebai.SDK
{
public class EnumExtension
{
/// <summary>
///
/// </summary>
/// <param name="tField"></param>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public static string GetEnumDescription<T>(T tField)
{
var description = string.Empty; //结果
var inputType = tField.GetType(); //输入的类型
var descType = typeof(DescriptionAttribute); //目标查找的描述类型

var fieldStr = tField.ToString(); //输入的字段字符串
var field = inputType.GetField(fieldStr); //目标字段

var isDefined = field.IsDefined(descType, false); //判断描述是否在字段的特性
if (isDefined)
{
var enumAttributes = (DescriptionAttribute[]) field //得到特性信息
.GetCustomAttributes(descType, false);
description = enumAttributes.FirstOrDefault()?.Description ?? string.Empty;
}

return description;
}
}

public partial class LebaiRobotClient
{
public static Dictionary<int, string> CodeMessage = new()
{
[2001] = "系统异常",
[2002] = "登录授权码错误",
[2003] = "登录授权码已失效",
[2004] = "机器人控制系统异常",
[2005] = "404",
[2006] = "参数错误",
[2007] = "数据不存在",
[2009] = "请登录",
[2010] = "同一时间只能有一个用户登录",
[2011] = "队列任务执行报错",
[2012] = "机器人任务运行中不能运行其他任务",
[2015] = "场景导入失败,导入文件格式错误",
[2021] = "数据库异常",
[2022] = "签名失败",
[2023] = "任务队列恢复失败,手臂当前位置与即将运行轨迹的首个位置数据校验失败",
[2024] = "无效机器人操作命令",
[2025] = "机器人当前状态没有满足执行当前指令的预期(废弃)",
[2026] = "请求超时",
[2027] = "网络配置中,不能频繁进行操作",
[2028] = "条件任务执行超时",

[2029] = "机器人控制系统故障,请重启机器人后再试",
[2030] = "机器人通信故障,请检查机器人是否已正确连接",
[2031] = "机器人初始化中,请稍候再试",
[2032] = "机器人更新中,请稍候再试",
[2033] = "机器人启动中,请稍候再试",
[2034] = "机器人停止中,请稍候再试",
[2035] = "请结束示教操作后再试",
[2036] = "请先停止任务历史中的当前任务后再执行相应操作",
[2037] = "仿真模式暂不支持该功能"
};

/// <summary>
/// 获取指定任务信息
/// </summary>
/// <param name="id"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public virtual async ValueTask<TaskInfo> GetTask(int id, CancellationToken cancellationToken = default)
{
var response = await _httpClient.GetAsync($"/public/task?id={id}", cancellationToken);

var r = await response.Content.ReadFromJsonAsync<LebaiHttpResult<OriginTaskInfo>>(
cancellationToken: cancellationToken);
HandleResult(r, $"场景Id:{id}");
return r?.Data.ToTaskInfo();
}

/// <summary>
/// 获取任务信息
/// </summary>
/// <param name="input"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public virtual async ValueTask<TasksResult> GetTasks(GetTasksInput input,
CancellationToken cancellationToken = default)
{
var response = _httpClient
.GetAsync($"/public/tasks?pi={input.PageIndex}&ps={input.PageSize}", cancellationToken).Result;
var r = await response.Content.ReadFromJsonAsync<LebaiHttpResult<OriginTasksResult>>(
cancellationToken: cancellationToken);

HandleResult(r);
return r?.Data?.ToResult();
}

/// <summary>
/// 检测是否能运行任务(机器人是否正在运行其他任务)
/// </summary>
/// <returns></returns>
public virtual async ValueTask<bool> GetIsCanRunTask(CancellationToken cancellationToken = default)
{
var result = await GetTasks(new GetTasksInput {PageIndex = 1, PageSize = 1}, cancellationToken);
var first = result?.Items?.FirstOrDefault();
return first == null || first.Status != TaskStatus.Running && first.Status != TaskStatus.Pause;
}

/// <summary>
///
/// </summary>
/// <param name="cancellationToken"></param>
/// <exception cref="Exception"></exception>
protected virtual async ValueTask CheckRobotStatus(CancellationToken cancellationToken = default)
{
var result = await GetTasks(new GetTasksInput {PageIndex = 1, PageSize = 1}, cancellationToken);
var first = result?.Items?.FirstOrDefault();
var r= first == null || first.Status != TaskStatus.Running && first.Status != TaskStatus.Pause;
if (!r) throw new Exception($"机器人正在执行其他任务!,任务数量:{result?.Items} 真正运行的其他任务: {first.Status}");
}

/// <summary>
/// 运行任务
/// </summary>
/// <param name="id">任务Id</param>
/// <param name="executeCount">执行次数</param>
/// <param name="clear">是否强制停止正在运行的任务</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public virtual async Task<TaskExecuteResult> RunTask(int id, int executeCount = 1,
bool clear = true, CancellationToken cancellationToken = default)
{
await CheckRobotStatus(cancellationToken);
var response = _httpClient.PostAsJsonAsync("/public/task", new
{
execute_count = executeCount,
clear = clear ? 1 : 0,
task_id = id
}, cancellationToken).Result;
var r = await response.Content.ReadFromJsonAsync<LebaiHttpResult<TaskExecuteResult>>(
cancellationToken: cancellationToken);
HandleResult(r);
return r?.Data;
}

/// <summary>
/// 运行场景
/// </summary>
/// <param name="id">场景Id</param>
/// <param name="executeCount">运行次数</param>
/// <param name="clear">是否强制停止正在运行的场景</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public virtual async Task<TaskExecuteResult> RunScene(int id, int executeCount = 1,
bool clear = false, CancellationToken cancellationToken = default)
{
await CheckRobotStatus(cancellationToken);

var response = _httpClient.PostAsJsonAsync("/public/task", new
{
execute_count = executeCount,
clear = clear ? 1 : 0,
scene_id = id
}, cancellationToken).Result;
var r = await response.Content.ReadFromJsonAsync<LebaiHttpResult<TaskExecuteResult>>(
cancellationToken: cancellationToken);
HandleResult(r, $"场景Id:{id}");
return r?.Data;
}

/// <summary>
///
/// </summary>
/// <param name="result"></param>
/// <param name="message"></param>
/// <typeparam name="T"></typeparam>
/// <exception cref="HttpRequestException"></exception>
protected void HandleResult<T>(LebaiHttpResult<T> result, string message = "")
{
if (result?.Code != 0)
throw new HttpRequestException($"调用失败,{message},Code:{result.Code}" +
(CodeMessage.ContainsKey(result.Code)
? $",{CodeMessage[result.Code]}"
: ""));
}

/// <summary>
/// 等待任务运行完成
/// </summary>
/// <param name="id">任务Id</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <exception cref="OperationCanceledException"></exception>
/// <exception cref="RobotTaskException"></exception>
public virtual async ValueTask<TaskInfo> WaitTaskRunCompleted(int id,
CancellationToken cancellationToken = default)
{
TaskInfo taskInfo = await GetTask(id, cancellationToken);
while (true)
{
if (cancellationToken.IsCancellationRequested) throw new OperationCanceledException();

if (taskInfo?.Status is TaskStatus.Running or TaskStatus.Idea)
{
await Task.Delay(100, cancellationToken);
taskInfo = await GetTask(id, cancellationToken);
}
else if (taskInfo?.Status is TaskStatus.RunSuccess)
{
break;
}
else
{
throw new RobotTaskException(taskInfo?.Status);
}
}

return taskInfo;
}

/// <summary>
/// 运行场景直到运行完成
/// </summary>
/// <param name="id">场景Id</param>
/// <param name="executeCount">执行次数</param>
/// <param name="clear">是否强制停止正在运行的场景</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public virtual async Task<TaskInfo> RunSceneUntilDone(int id, int executeCount = 1,
bool clear = false, CancellationToken cancellationToken = default)
{
var r = await RunScene(id, executeCount, clear, cancellationToken);

return await WaitTaskRunCompleted(r.Id, cancellationToken);
}

/// <summary>
/// 执行Lua 代码
/// </summary>
/// <param name="luaCode"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public virtual async Task<TaskExecuteResult> ExecuteLua(string luaCode,
CancellationToken cancellationToken = default)
{
var response =
await _httpClient.PostAsync("/public/executor/lua", new StringContent(luaCode), cancellationToken);
var r = await response.Content.ReadFromJsonAsync<LebaiHttpResult<TaskExecuteResult>>(
cancellationToken: cancellationToken);

HandleResult(r);
return r?.Data;
}
}
}

+ 56
- 0
Lebai.SDK/Protos/os_server.proto 파일 보기

@@ -0,0 +1,56 @@
syntax = "proto3";
// compile method:
// 1. cpp:
// protoc --grpc_out=./ --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` *.proto
// protoc --cpp_out=. *.proto
// 2. python:
// protoc --python_out=. *.proto
//import "google/protobuf/empty.proto";
// build for web
// protoc -I=./ *.proto --js_out=import_style=commonjs:./ --grpc-web_out=import_style=commonjs,mode=grpcwebtext:./

package osserver;

service OsServer {
rpc getRingData(Req) returns (stream RingData);
}

message Req {
int32 req = 1;
}

message PR {
double x = 1;
double y = 2;
double z = 3;
double rr = 4;
double rp = 5;
double ry = 6;
}

message Joint {
double targetPose = 1;
double targetV = 2;
double targetA = 3;
double targetTorque = 4;
double actualPose = 5;
double actualV = 6;
double actualA = 7;
double actualTorque = 8;
double temperature = 9;
}

message RingData {
repeated Joint joints = 1;
int32 num = 2;
PR targetPose = 3;
PR actualPose = 4;
CurrentVoltage voltage = 5;
}

message CurrentVoltage {
double power = 1; // 电源电压V/电流mA
double flan = 2; // 法兰电压/电流
repeated double joint = 3; // 关节电压/电流
double io_power = 4; // IO板
}

+ 606
- 0
Lebai.SDK/Protos/private_controller.proto 파일 보기

@@ -0,0 +1,606 @@
/**
* Copyright © 2017-2018 Shanghai Lebai Robotic Co., Ltd. All rights reserved.
*
* FileName: robot_controller.proto
*
* Author: Yonnie Lu
* Email: zhangyong.lu@lebai.ltd
* Date: 2019-10-31 10:20:01
* Description:
* History:
* <Author> <Time> <version> <desc>
* YonnieLu 2019-10-31 10:20:01 1.0 Create
*
* compile methods:
* 1. c++
* protoc --grpc_out=./ --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` *.proto
* protoc --cpp_out=. *.proto
*
* 2. golang
* protoc *.proto --go_out=plugins=grpc:../
*
* 3. python
*/
syntax = "proto3";

import "google/protobuf/empty.proto";
import "messages.proto";

package robotc;

service RobotPrivateController {
// 初始化配置
rpc Init(Configuration) returns (Response);
// 获取机器人基础信息
rpc GetRobotInfo(google.protobuf.Empty) returns (RobotInfo);
// 设置机器人安装方向
rpc SetInstallDirection(InstallDirection) returns (Response);
// 设置碰撞检测
rpc SetCollisionDetector(CollisionDetector) returns (Response);
// 设置关节配置
rpc SetJointConfig(JointConfigs) returns (Response);
// 设置笛卡尔空间的配置
rpc SetCartesianConfig(CartesianConfig) returns (Response);
// 开启DDS
rpc EnableDDS(TrueOrFalse) returns (Response);
// 设置碰撞检测力矩差阈值
rpc SetCollisionTorqueDiff(CollisionTorqueDiff) returns(Response);
// 注册通知事件
rpc RegisterNotification(google.protobuf.Empty) returns (stream Notification);
rpc RobotDriverInfo(google.protobuf.Empty) returns (DriverInfo);
// 机器人OTA单个设备更新接口
rpc RobotOTA(OTAData) returns (stream OTAResult);
// 通知灯板、法兰、关节切换分区
rpc SwitchOtaPartition(OTACmd) returns (Response);
// 机器人OTA批量更新接口
rpc RobotOTABatch(OTADatas) returns (stream OTAResults);
// 重置
rpc Reset(google.protobuf.Empty) returns(Response);
// 以给定角度置零
rpc InitZero(Zero) returns (Response);
// 以零位置零
rpc SetZero(google.protobuf.Empty) returns (Response);
// 获取机器人电压V
rpc GetVoltage(google.protobuf.Empty) returns (CurrentVoltage);
// 设置单关节伺服参数
rpc SetServoParam(JointServoParam) returns (JointServoParams);
// 获取当前所有关节伺服参数
rpc GetServoParams(google.protobuf.Empty) returns (JointServoParams);
// 调试设置
rpc SetDebugParams(DebugParams) returns (DebugParams);
// 更改DH参数(三轴平行6参数)
rpc FixDHParams(FixDHRequest) returns (FixDHResult);
// 设置LED样式
rpc SetLEDStyle(LEDStyle) returns (LEDStyles);
// 获取LED样式
rpc GetLEDStyles(google.protobuf.Empty) returns (LEDStyles);
// 注册命令状态事件
rpc RegisterLuaEvent(google.protobuf.Empty) returns (stream LuaEvent);
// 当推送 ALERT/CONFIRM/INPUT/SELECT,用户在前端确定后调用该接口
rpc ConfirmCallback(ConfirmInput) returns (Response);
// 获取 Lua 上次执行到的机器人位置
rpc GetLastPose(google.protobuf.Empty) returns (PoseRes);
//配置Modbus外部IO设备
rpc SetModbusExternalIO(ModbusExternalIOs) returns (Response);
// 修改按钮配置
rpc SetButtonConfig(ButtonConfig) returns (Response);
// 设置绑定设备开关, true: 不限制设备绑定; false:限制设备绑定逻辑
rpc SetBreakACup(TrueOrFalse) returns (Response);
// PVAT数据记录接口,用户记录pvat数据
rpc RecordPVAT(RecordPVATRequest) returns (stream RecordPVATResponse);
rpc StopRecordPVAT(google.protobuf.Empty) returns (Response);
// 语音升级
rpc UpgradeVoiceFile(VoiceFile) returns (stream VoiceResult);//yvoice
// 获取当前 DH 参数
rpc GetDHParams(DHRequest) returns (DHParams);
// 设置 DH 参数并返回设置后的结果
rpc SetDHParams(DHParams) returns (DHParams);
// 伺服控制参数
rpc WriteExtraServoParam(ExtraServoParam) returns (ExtraServoParam);
rpc ReadExtraServoParam(ExtraServoParam) returns (ExtraServoParam);
rpc WriteExtraServoParams(ExtraServoParam) returns (ExtraServoParams);
rpc ReadExtraServoParams(google.protobuf.Empty) returns (ExtraServoParams);
rpc ResetExtraServoParams(google.protobuf.Empty) returns (ExtraServoParams);
// “主动消回差”参数
rpc WriteJointBacklash(JointBacklash) returns (JointBacklash);
rpc ReadJointBacklash(JointBacklash) returns (JointBacklash);
rpc WriteJointBacklashes(JointBacklash) returns (JointBacklashes);
rpc ReadJointBacklashes(google.protobuf.Empty) returns (JointBacklashes);
rpc ResetJointBacklashes(google.protobuf.Empty) returns (JointBacklashes);
// 启用主动消回差
rpc WriteEnableJointBacklashes(EnableJointBacklash) returns (EnableJointBacklashes);
rpc ReadEnableJointBacklashes(google.protobuf.Empty) returns (EnableJointBacklashes);
rpc ResetEnableJointBacklashes(google.protobuf.Empty) returns (EnableJointBacklashes);
// 关节回差参数
rpc WriteJointBacklashParam(JointBacklashParam) returns (JointBacklashParam);
rpc ReadJointBacklashParam(JointBacklashParam) returns (JointBacklashParam);
rpc WriteJointBacklashParams(JointBacklashParam) returns (JointBacklashParams);
rpc ReadJointBacklashParams(google.protobuf.Empty) returns (JointBacklashParams);
rpc ResetJointBacklashParams(google.protobuf.Empty) returns (JointBacklashParams);
// 关节限位检测
rpc EnableJointLimit(TrueOrFalse) returns (Response);
rpc SwitchSimulate(TrueOrFalse) returns (Response);
// 连接/断开 MODBUS 设备
rpc ConnectExternalIO(ExternalIOState) returns (Response);
}

message EnableJointBacklash {
int32 joint = 1;
bool enable = 2;
}

message EnableJointBacklashes {
repeated EnableJointBacklash joints = 1;
}

message ExtraServoParam {
int32 joint = 1; // 当 Read、Enable/Disable 时仅该值生效, 0 代表关节 1

double acc_position_kp = 2;
double acc_speed_kp = 3;
double acc_speed_it = 4;
double uni_position_kp = 5;
double uni_speed_kp = 6;
double uni_speed_it = 7;
double dec_position_kp = 8;
double dec_speed_kp = 9;
double dec_speed_it = 10;
}

message ExtraServoParams {
repeated ExtraServoParam joints = 1;
}

message JointBacklash {
int32 joint = 1;

uint32 k = 2;
double iq = 3;
double iq_final = 4;
uint32 iq_count = 5;
}

message JointBacklashes {
repeated JointBacklash joints = 1;
}

message JointBacklashParam {
int32 joint = 1;

int32 encoder_data_offset = 2;
uint32 on = 3;
uint32 over = 4;
uint32 leave = 5;
uint32 max = 6;
}

message JointBacklashParams {
repeated JointBacklashParam joints = 1;
}

message VoiceFile {//yvoice
int32 id = 1;
string file = 2;
string md5 = 3;
}

message VoiceResult {//yvoice
int32 id = 1;
int32 step = 2;// 0: not begin, 1: downloading, 2: flashing, 3: done, 4:fail
int32 stepProgress = 3;// 0-100, currently only downloading step has progress, other steps need show pending progress
}

//0: all joints 1-7:joint1-7 8:flan 9:claw 10:lamp
enum BootloaderId {
ALL_JOINTS = 0;
JOINT_1 = 1;
JOINT_2 = 2;
JOINT_3 = 3;
JOINT_4 = 4;
JOINT_5 = 5;
JOINT_6 = 6;
JOINT_7 = 7;
FLANGE = 8;
CLAW = 9;
LAMP = 10;
COMBOARD = 14;
}

enum BootPartition {
A = 0;
B = 1;
C = 2;
PART_UNKNOWN = 3;
}

// Message definition
message TrueOrFalse {
bool val = 1;
}

message InstallDirection {
int32 direction = 1; // 安装方式: 0: up; 1: down; 2: side, default: UP
}

message JointConfig {
double maxAngle = 1;
double minAngle = 2;
double maxV = 3; // 用户端设定的全局速度拆分到每个关节的maxV上
double maxAcc = 4;
}

message JointConfigs {
repeated JointConfig configs = 1;
}

message CartesianConfig {
double maxV = 1;
double maxAcc = 2;
}

message SafetyPlat { // 安全平面,点为平面四个角的顶点,非示教的三个点
repeated Coordinate points = 1;
}

message SafetyPlats {
repeated SafetyPlat plats = 1; // default: empty
}

message CollisionTorqueDiff { // 每个关节碰撞检测的扭矩差值
repeated double diffs = 1;
}

message CollisionDetector {
bool enable = 1; // 是否启用碰撞检测, default: false
int32 action = 2; // 碰撞检测后动作, 0: estop, 1: pause default: ESTOP
int32 pauseTime = 3; // 碰撞检测暂停时间, default: 0
int32 sensitivity = 4; // 碰撞检测灵敏度, , default: 50
}

message LEDStyle {
int32 mode = 3;
int32 speed = 4;
repeated int32 color = 5;
int32 voice = 1;
int32 volume = 2;
int32 robotMode = 6; // robot-mode
}

message LEDStyles {
repeated LEDStyle styles = 16; // 机器人状态对应的LED样式,下标为robot-mode
}

message ButtonConfig {
bool btn_flan_1 = 1; //
bool btn_flan_2 = 2;
bool btn_shoulder_0 = 3;
}

message Configuration {
InstallDirection installDirection = 1;
CollisionDetector collisionDetector = 2;
JointConfigs jointConfigs = 3; // 0-6 关节配置
SafetyPlats safetyPlats = 4; // 安全平面列表
PR tcp = 5; // tcp配置
Payload payload = 6; // 负载
bool enableDDS = 7; // 是否开启内部数据调试服务(Data Debug Service),默认关闭
CollisionTorqueDiff collisionTorqueDiff = 8;

int32 robotDIOInNum = 9;
int32 robotDIOOutNum = 10;
repeated AIO robotAIOInConfig = 11;
repeated AIO robotAIOOutConfig = 12;
int32 tcpDIOInNum = 13;
int32 tcpDIOOutNum = 14;
repeated double zeros = 15; // 关节归零角度 (弃用)
repeated LEDStyle styles = 16; // 机器人状态对应的LED样式
bool break_a_cup = 17; // true: 不校验启动验证绑定设备hash逻辑; false: 默认值,校验
ButtonConfig button_config = 18;
CartesianConfig cartesianConfig = 19;
int32 extra_robotDIOInNum = 20;
int32 extra_robotDIOOutNum = 21;
repeated AIO extra_robotAIOInConfig = 22;
repeated AIO extra_robotAIOOutConfig = 23;
}


message Zero {
repeated double zeros = 1;
}

message Notice {
// 通知类型
enum NoticeType {
NOTICE_STATE = 0; // 机器人状态变更;机器人状态和急停状态位等
NOTICE_ERROR = 1; // 错误:错误类型
NOTICE_BUTTON = 2; // 按钮事件;
}

// 按钮类型的nId定义
enum NoticeId {
NOTICE_ID_STATE_ROBOT_STATE = 0; // 机器人状态
NOTICE_ID_STATE_E_STOP = 1; // 机器人状态
NOTICE_ID_STATE_DATA_UPDATE = 2; // 机器人数据有更新
NOTICE_ID_ERROR = 3; // 机器人错误
NOTICE_ID_BUTTON_SHOULDER = 4; // 肩部按钮
NOTICE_ID_BUTTON_FLANGE_1 = 5; // 末端按钮1
NOTICE_ID_BUTTON_FLANGE_2 = 6; // 末端按钮1
}

NoticeType type = 1; // 通知类型
/**
* type = 1 按钮事件
* value: 按钮模式:1: 按钮空闲;2:长按;3:单击;4: 双击
*/
NoticeId id = 2;
int32 value = 3; // when there ERROR, value represent the LEVEL
int32 code = 4;
// some fucking boring and important data need return back to front end
repeated double lol = 5;
int32 count = 6; // 肩部按钮按下时,按该按钮的次数
}

message Notification {
repeated Notice items = 1;
}

message Driver {
// 驱动器基本信息
Hardware hardware = 1;
// 当前运行分区情况
BootPartition curPartition = 2;
}

message DriverInfo {
Driver flange = 1;
Driver led = 2;
repeated Driver joints = 3;
Driver comboard = 4;
}

message OTAFile {
string file = 1; // 文件完整路径
string md5 = 2; // 文件原始md5,前端计算
// version string: XX.YY.ZZ.20200608
string version = 3;
}

message OTACmd {
BootloaderId bootloaderId = 1;
// 0: B分区;1: C分区
BootPartition targetPartition = 2;
}

message OTAData {
OTACmd cmd = 1;
OTAFile file = 2;
}

message OTAJoints {
repeated OTACmd cmds = 1;
OTAFile file = 2;
}

message OTADatas {
// 所有关节更新描述
OTAJoints joints = 1;
// 非关节更新描述: 灯板,法兰
repeated OTAData notJoints = 2;
}

message OTAResult {
BootloaderId bootloaderId = 1;
int32 step = 2; // 0: not begin, 1: downloading, 2: flashing, 3: done, 4:fail
int32 stepProgress = 3; // 0-100, currently only downloading step has progress, other steps need show pending progress
string version = 4;
BootPartition partition = 5;
}

message OTAResults {
repeated OTAResult results = 1;
}

message CurrentVoltage {
double power = 1; // 电源电压V/电流mA
double flan = 2; // 法兰电压/电流
repeated double joint = 3; // 关节电压/电流
double io_power = 4; // IO板
}

message JointServoParam {
uint32 index = 1; // 0代表关节一
double position_kp = 2;
double speed_kp = 3;
double speed_it = 4;
double torque_cmd_filter = 5;
}

message JointServoParams {
repeated JointServoParam joints = 1;
}

message DebugParams {
repeated double d = 1;
}

message FixDHRequest {
repeated double delta_theta = 1;
bool plus_theta = 2; // true则走到theta位再置零,false则走到-theta位再置零
repeated double delta_l = 3;
bool plus_l = 4; // true则加,false则减
}

message DHRequest {
bool get_theoretical = 1; // 是否获取理论dh参数
}

message DHt {
double d = 1;
double a = 2;
double alpha = 3;
double theta = 4;
}

message DHParams {
repeated DHt params = 1;
}

message FixDHResult {
repeated DHt origin = 1;
repeated DHt before = 2;
repeated DHt after = 3;
}

message Option {
string value = 1;
string label = 2;
}

message LuaEvent {
enum Type {
ECHO = 0;
LUA = 1;
SIGNAL = 2;
LOOP = 3;
ALERT = 4;
CONFIRM = 5;
INPUT = 6;
SELECT = 7;
}
enum CmdState {
INIT = 0;
RUNNING = 1;
SUCCESS = 2;
FAILED = 3;
}

Type type = 1;
// type: ECHO
int32 cmd_id = 2;
CmdState cmd_state = 3;
// echo_key
// 当type=Lua时,该字段表示错误消息;
// 当type=LOOP 时表示loopid
// 当type=ALERT/CONFIRM/INPUT/SELECT时,该字段表示提示语
string echo_key = 4;
// index
// 当type=LOOP时,表示进行到了第几个循环
// 当type=LUA时,表示对应的任务ID
int32 index = 8;
// type: LUA
LuaState lua_state = 5;
// type: SIGNAL
int32 signal_id = 6;
double signal_value = 7;
// type: SELECT
repeated Option options = 9;
}

message ConfirmInput {
string input = 1; // CONFIRM时为"true"|"false", INPUT为用户输入字符串, SELECT为用户选择的value
}

message PoseRes {
PR cart = 1; // 笛卡尔位置
JPose joint = 2; // 关节位置
}

message ModbusDio {
int32 pin = 1;
//对应modbus内部地址
int32 addr = 2;
}

message ModbusDioGroup {
repeated ModbusDio pins = 1;
int32 addr = 2;
}

message ModbusAio {
int32 pin = 1;
// 0: 电压型 1: 电流型
int32 mode = 2;
//对应Modbus内部地址
// 一个addr占用2bytes=16bits
int32 addr = 3;
}

message AIORange {
double min = 1;
double max = 2;
}

message Range {
AIORange V = 1;
AIORange A = 2;
}

message ModbusAioGroup {
repeated ModbusAio pins = 1;
// modbus base address
int32 addr = 2;
//大小端
int32 isLsb = 3;
Range range = 4;
// number of 16 bit words for one pin
int32 size = 5;
}

message ModbusExternalIOMapping {
// 所有数字量的输入值
ModbusDioGroup di = 1;
// 所有数字量的输出值
ModbusDioGroup do = 2;
// 所有模拟量输入值
ModbusAioGroup ai = 3;
// 所有模拟量输出值
ModbusAioGroup ao = 4;
}

message ExternalIOState {
int32 id = 1;
bool enable = 2; // true 连接 false 断开
}

message ModbusExternalIO {
int32 id = 1;
string ip = 2;
int32 port = 3;
int32 timeout = 4;
int32 slaveId = 5;
int32 cmdHoldTime = 6;
int32 version = 7;
ModbusExternalIOMapping ioMap = 8;
}

message ModbusExternalIOs {
repeated ModbusExternalIO ios= 1;
}

message RecordPVATRequest {
enum PVATType {
PT = 0;
PVT = 1;
PVAT = 2;
}

message VZeroGap {
double threshold = 1; // v zero gap threshold should be > 0 and < 0.01
bool remove_gap = 2; // whether to remove zero gap during teaching
}

PVATType type = 1;
double duration = 2; // duration in microseconds
VZeroGap vZeroGap = 3;
bool use_duration_ts = 4;
bool save_file = 5;
}

message RecordPVATResponse {
repeated double p = 1;
repeated double v = 2;
repeated double acc = 3;
double t = 4;
bool end = 5; // is pvat end
string f = 6; // data save file path, local
}

+ 735
- 0
Lebai.SDK/Protos/robot_controller.proto 파일 보기

@@ -0,0 +1,735 @@
/**
* Copyright © 2017-2018 Shanghai Lebai Robotic Co., Ltd. All rights reserved.
*
* FileName: robot_controller.proto
*
* Author: Yonnie Lu
* Email: zhangyong.lu@lebai.ltd
* Date: 2018-12-28 17:26
* Description:
* History:
* <Author> <Time> <version> <desc>
* YonnieLu 2018-12-28 17:26 1.0 Create
*
* compile methods:
* 1. c++
* protoc --grpc_out=./ --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` *.proto
* protoc --cpp_out=. *.proto
*
* 2. golang
* protoc *.proto --go_out=plugins=grpc:../
*
* 3. python
*/
syntax = "proto3";

import "google/protobuf/empty.proto";
import "messages.proto";

package robotc;

// Robot controller gRPC & protobuf idl language definition
service RobotController {
// 1. Basic control commands
// 关闭电源
rpc PowerDown(google.protobuf.Empty) returns (CmdId);

// 等待,单位毫秒
rpc Sleep(SleepRequest) returns (CmdId);
// 同步,等待指定命令执行完成,type为0时表示所有(默认)
rpc Sync(google.protobuf.Empty) returns (CmdId);
rpc SyncFor(SyncRequest) returns (CmdId);

// 2. Config commands
// 开启示教模式
rpc TeachMode(google.protobuf.Empty) returns (CmdId);
// 关闭示教模式
rpc EndTeachMode(google.protobuf.Empty) returns (CmdId);
// 设置速度因子(0-100)
rpc SetVelocityFactor(Factor) returns (CmdId);
// 获取速度因子(0-100)
rpc GetVelocityFactor(google.protobuf.Empty) returns (Factor);

rpc SetGravity(Coordinate) returns (CmdId);

rpc GetGravity(google.protobuf.Empty) returns (Coordinate);

rpc SetPayload(Payload) returns (CmdId);

rpc GetPayload(google.protobuf.Empty) returns (Payload);

rpc SetPayloadMass(PayloadMass) returns (CmdId);

rpc GetPayloadMass(google.protobuf.Empty) returns (PayloadMass);
rpc SetPayloadCog(PayloadCog) returns (CmdId);

rpc GetPayloadCog(google.protobuf.Empty) returns (PayloadCog);
rpc SetTcp(PR) returns (CmdId);

rpc GetTcp(google.protobuf.Empty) returns (PR);
// 设置手爪幅度:0-100 double
rpc SetClawAmplitude(Amplitude) returns (CmdId);
// 获得手爪幅度:0-100 double
rpc GetClawAmplitude(google.protobuf.Empty) returns (Amplitude);
// 获得手爪目前是否夹紧物体状态1表示夹紧,0为松开
rpc GetClawHoldOn(google.protobuf.Empty) returns (HoldOn);
// 设置手爪力度:0-100 double
rpc SetClawForce(Force) returns (CmdId);
// 获得手爪称重结果
rpc GetClawWeight(google.protobuf.Empty) returns (Weight);
// implement later
// rpc Force(google.protobuf.Empty) returns (Force);
// implement later
rpc GetTcpForce(google.protobuf.Empty) returns (ForceTorque);
rpc SetClaw(ClawInfo) returns (ClawInfo);
rpc GetClaw(google.protobuf.Empty) returns (ClawInfo);

// 3. Motion control commands
rpc SetPos(JPose) returns (CmdId);

// implement later
rpc SpeedJ(SpeedJRequest) returns (CmdId);
// implement later
rpc SpeedL(SpeedLRequest) returns (CmdId);
// implement later
rpc StopJ(StopJRequest) returns (CmdId);
// implement later
rpc StopL(StopLRequest) returns (CmdId);

// 停止当前移动
rpc StopMove(google.protobuf.Empty) returns (CmdId);

// 圆弧移动
rpc MoveC(MoveCRequest) returns (CmdId);
// 关节空间线性移动
rpc MoveJ(MoveJRequest) returns (CmdId);
// 笛卡尔空间线性移动
rpc MoveL(MoveLRequest) returns (CmdId);
// DEPRECIATED
rpc MoveLJ(MoveLRequest) returns (CmdId);
// implement later
rpc MoveP(MovePRequest) returns (CmdId);
// pt move
rpc MovePT(PVATRequest) returns (CmdId);
rpc MovePTStream(stream PVATRequest) returns (CmdId);
// pvt move
rpc MovePVT(PVATRequest) returns (CmdId);
rpc MovePVTStream(stream PVATRequest) returns (CmdId);
// pvat move
rpc MovePVAT(PVATRequest) returns (CmdId);
rpc MovePVATStream(stream PVATRequest) returns (CmdId);

// implement later
rpc ServoC(ServoCRequest) returns (CmdId);
// implement later
rpc ServoJ(ServoJRequest) returns (CmdId);
// 4. Status and data query commands
// 获取机器人所有状态数据
rpc GetRobotData(google.protobuf.Empty) returns (RobotData);
// 获取机器人概要数据
rpc GetRobotBriefData(stream RobotDataCmd) returns (stream RobotBriefData);
// 获取机器人的IO数据
rpc GetRobotIOData(stream RobotDataCmd) returns (stream IO);
// 获取机器人状态
rpc GetRobotMode(google.protobuf.Empty) returns (RobotMode);
// 获得实际关节位置
rpc GetActualJointPositions(google.protobuf.Empty) returns (Joint);
// 获得目标关节位置
rpc GetTargetJointPositions(google.protobuf.Empty) returns (Joint);
// 获得实际关节速度
rpc GetActualJointSpeeds(google.protobuf.Empty) returns (Joint);
// 获得目标关节速度
rpc GetTargetJointSpeeds(google.protobuf.Empty) returns (Joint);
// 获得末端在笛卡尔坐标系下的位姿
rpc GetActualTcpPose(google.protobuf.Empty) returns (Vector);
// 获得末端在笛卡尔坐标系下的目标位姿
rpc GetTargetTcpPose(google.protobuf.Empty) returns (Vector);
// implement later
rpc GetActualTcpSpeed(google.protobuf.Empty) returns (Vector);
// implement later
rpc GetTargetTcpSpeed(google.protobuf.Empty) returns (Vector);
// implement later
rpc GetActualFlangePose(google.protobuf.Empty) returns (Vector);
// 获取关节扭矩
rpc GetJointTorques(google.protobuf.Empty) returns (Joint);
// 获取控制器温度
rpc GetControllerTemp(google.protobuf.Empty) returns (Temperature);
// 获取关节内部温度
rpc GetJointTemp(IntRequest) returns (Temperature);
// implement later
rpc GetToolCurrent(google.protobuf.Empty) returns (Current);

//xxx
// 5. IO-related cmds
// 设置数字输出端口的值
rpc SetDIO(DIO) returns (CmdId);
// 设置扩展数字输出端口的值
rpc SetExtraDIO(DIO) returns (CmdId);
// 获得数字输入端口的值
rpc GetDIO(IOPin) returns (DIO);
// 获得扩展数字数如端口的值
rpc GetExtraDIO(IOPin) returns (DIO);
// 设置TCP数字输出端口的值
rpc SetTcpDIO(DIO) returns (CmdId);
// 获得TCP数字输入端口的值
rpc GetTcpDIO(IOPin) returns (DIO);
// 设置模拟输出端口的值
rpc SetAIO(AIO) returns (CmdId);
// 获得模拟输入端口的值
rpc SetExtraAIO(AIO) returns (CmdId);
// 获得模拟输入端口的值
rpc GetAIO(IOPin) returns (AIO);
// 获得扩展模拟输入端口的值
rpc GetExtraAIO(IOPin) returns (AIO);
// 设置模拟输入端口工作模式:0:电压,1:电流
rpc SetAInMode(AIO) returns (CmdId);
// 设置扩展模拟输入端口工作模式:0:电压,1:电流
rpc SetExtraAInMode(AIO) returns (CmdId);
// 获得模拟输入端口工作模式:0:电压,1:电流
rpc GetAInMode(IOPin) returns (AIO);
// 获得扩展模拟输入端口工作模式:0:电压,1:电流
rpc GetExtraAInMode(IOPin) returns (AIO);
// 设置模拟输出端口工作模式:0:电压,1:电流
rpc SetAOutMode(AIO) returns (CmdId);
// 设置扩展模拟输出端口工作模式:0:电压,1:电流
rpc SetExtraAOutMode(AIO) returns (CmdId);
// 获得模拟输出端口工作模式:0:电压,1:电流
rpc GetAOutMode(IOPin) returns (AIO);
// 获得扩展模拟输出端口工作模式:0:电压,1:电流
rpc GetExtraAOutMode(IOPin) returns (AIO);

// 6. Control commands
// 开启/启动系统
rpc StartSys(google.protobuf.Empty) returns (CmdId);
// 关闭/停止系统
rpc StopSys(google.protobuf.Empty) returns (CmdId);
// 程序停止
rpc Stop(google.protobuf.Empty) returns (CmdId);
// 急停
rpc EStop(google.protobuf.Empty) returns (CmdId);
// 7. Internal commands
// 获取kdl参数
rpc GetKDL(google.protobuf.Empty) returns (KDParam);
// 查询系统里面的日志信息
rpc GetLogs(google.protobuf.Empty) returns (Logs);
// 获得当前正在执行的命令id,如果没有在执行的命令,则返回-1
rpc GetCurrentCmd(google.protobuf.Empty) returns (CmdId); // 命令id
// 获得指定命令id的执行结果:-1: 未执行;0: 已执行
rpc GetCmdExecStatus(CmdId) returns (CmdStatus);
// 开始微调: 如果当前有其他微调再传入新的微调命令会终止当前的微调进行新的微调
rpc StartFineTuning(FineTuning) returns (CmdId);
// 停止微调
rpc StopFineTuning(google.protobuf.Empty) returns (CmdId);
// 暂停机器人
rpc Pause(google.protobuf.Empty) returns (CmdId);
// 恢复机器人
rpc Resume(google.protobuf.Empty) returns (CmdId);

// 机器人正解
rpc KinematicsForward(Joint) returns (Vector);
// 机器人反解
rpc KinematicsInverse(Vector) returns (Joint);
// TCP示教添加
rpc CalcTcpTranslation(CalcTcpParam) returns (Vector);

// 8. Test command
// 测试命令,以给定的RPY数据执行线性移动
rpc MoveLRPY(MoveLRPYRequest) returns (CmdId);

// 9. 扬声器和LED灯
// 设置LED灯状态
rpc SetLED(LEDStatus) returns (CmdId);
// 设置声音
rpc SetVoice(VoiceStatus) returns (CmdId);
// 设置风扇
rpc SetFan(FanStatus) returns (CmdId);
// 获取灯板状态
rpc GetLampStatus(google.protobuf.Empty) returns (LampStatus);

// Lua 状态查询
rpc GetLuaState(google.protobuf.Empty) returns (LuaStatus);

// 外置数字输出
rpc SetExternalDO(ExternalDigital) returns (Response);
rpc GetExternalDO(ExternalPin) returns (ExternalDigital);
// 外置数字输入
rpc GetExternalDI(ExternalPin) returns (ExternalDigital);
// 外置模拟输出
rpc SetExternalAO(ExternalAnalog) returns (Response);
rpc GetExternalAO(ExternalPin) returns (ExternalAnalog);
// 外置模拟输入
rpc GetExternalAI(ExternalPin) returns (ExternalAnalog);
// 获取某个外置io的全部io信息
rpc GetExternalIOs(ExternalDevice) returns (ExternalIOs);

// 外置IO的复数版本
// 外置数字输出
rpc SetExternalDOs(ExternalDigitals) returns (Response);
rpc GetExternalDOs(ExternalPins) returns (ExternalDigitals);
// 外置数字输入
rpc GetExternalDIs(ExternalPins) returns (ExternalDigitals);
// 外置模拟输出
rpc SetExternalAOs(ExternalAnalogs) returns (Response);
rpc GetExternalAOs(ExternalPins) returns (ExternalAnalogs);
// 外置模拟输入
rpc GetExternalAIs(ExternalPins) returns (ExternalAnalogs);

// 信号量
rpc SetSignal(SignalValue) returns (SignalResult);
rpc GetSignal(SignalValue) returns (SignalResult);
rpc AddSignal(SignalValue) returns (SignalResult);
rpc RegisterSignals(stream SignalList) returns (stream SignalValue);
}

message SignalValue {
int32 index = 1;
int32 value = 2;
}

message SignalResult {
int32 index = 1;
int32 value = 2;
bool ok = 3;
}

message SignalList {
repeated int32 indexes = 1;
}

// 机器人所有状态数据
message RobotData {
// 机器人模式
RobotMode robotMode = 1;
// 机器人各个关节模式
repeated JointMode jointModes = 2;
// 实际关节位置
Joint actualJoint = 3;
// 实际关节速度
Joint actualJointSpeed = 4;
// 目标关节位置
Joint targetJoint = 5;
// 目标关节速度
Joint targetJointSpeed = 6;
// 实际tcp位置
Vector actualTcpPose = 7;
// 实际tcp速度
Vector actualTcpSpeed = 8;
// 目标tcp位置
Vector targetTcpPose = 9;
// 目标tcp速度
Vector targetTcpSpeed = 10;
// 当前系统正在执行的命令状态:id + value
CmdStatus currentCmd = 11;
// 所有的io数据
IO io = 12;
// 速度因子
double velocityFactor = 13;
// 爪子信息
ClawInfo clawInfo = 14;
// 关节温度
Joint jointTemps = 15;
// 理论力矩
Joint targetTorque = 16;
// 实际力矩
Joint actualTorque = 17;
// 加速度
Joint actualJointAcc = 18;
Joint targetJointAcc = 19;
}

// 机器人需要获取数据的请求cmd
message RobotDataCmd {
// empty
}

// 机器人概要状态数据
message RobotBriefData {
// 机器人模式
RobotMode robotMode = 1;
// 实际关节位置
Joint actualJoint = 2;
// 目标关节位置
Joint targetJoint = 3;
// 实际tcp位置
Vector actualTcpPose = 4;
// 目标tcp位置
Vector targetTcpPose = 5;
// 速度因子
double velocityFactor = 6;
// 关节温度
Joint jointTemps = 7;
}

// 机器人状态枚举值
message RobotMode { int32 mode = 1; }

// dh参数
message DH {
double d = 1;
double a = 2;
double alpha = 3;
double theta = 4;
}

// 运动学动力学参数
message KDParam {
repeated DH dhParams = 1;
}

// 关节状态枚举值
message JointMode { int32 mode = 1; }

message Amplitude { double amplitude = 1; }

message HoldOn { int32 hold_on = 1; }

message Force { double force = 1; }

message Weight { double weight = 1; }

// 爪子信息
message ClawInfo {
double amplitude = 1;
double force = 2;
double weight = 3;
int32 hold_on = 4;
}

message ForceTorque { repeated double forceTorque = 1; }

message Joint { // it can represent joint angles(rad) or joint speed (rad/s) or
// torques (Nm)
repeated double joints = 1;
}

message Vector { // x, y, z, rx, ry, rz
repeated double vector = 1;
}

message Temperature { double degree = 1; }

message Current { double current = 1; }

message Factor { double value = 1; }

message Ret { bool ret = 1; }

message CmdId { int32 id = 1; }

message CmdStatus {
// 命令id
int32 id = 1;
// -1: 未执行;0: 已执行
int32 value = 2;
}

message IntRequest { int32 index = 1; }

message Logs {
// 如果没有错误,则返回空
repeated Log log = 1;
}

message Log {
// 1 - Fatal: 严重错误,无法正常运行, 2 - Error:错误,系统可能还能继续运行, 3
// - Warning: 潜在的警告类错误, 4 - Info, 信息类,5 - Debug:调试类
int32 level = 1;
int32 code = 2;
string msg = 3;
}

message SleepRequest { int32 time = 1; }
message SyncRequest { int32 type = 1; }

message SpeedJRequest {
// 单位:rad/s{base, shoulder, elbow, wrist1, wrist2, wrist3}
repeated double joint_speed = 1;
// 单位:rad/s^2
double acceleration = 2;
// 可选参数,单位:秒,设定方法多少秒后返回
double time = 3;
}

message SpeedLRequest {
// 单位:m/s {base, shoulder, elbow, wrist1, wrist2, wrist3}
repeated double velocity = 1;
// 单位:m/s^2,以移动位置长度为衡量标准的加速度
double position_acceleration = 2;
// 可选参数,单位:秒,设定方法多少秒后返回
double time = 3;
// 可选参数,单位:rad/s^2,以转动角度为衡量标准的加速度,如果没给到,则使用第二个参数;如果给到,则使用这个参数
double acceleration = 4;
}

message StopJRequest {
// deceleration 单位:rad/s^2,减速度
double deceleration = 1;
}

message StopLRequest {
// 单位:m/s^2,以移动位置长度为衡量标准的减速度
double position_deceleration = 1;
// 单位:rad/s^2,可选,以转动角度为衡量标准的减速度,如果设定了该值,则使用该值不使用第一个参数??
double deceleration = 2;
}

message MoveCRequest {
// 若 pose_is_joint_angle 为false,则是{x, y, z, rx, ry, rz};否则为{j0, j1,
// j2, j3, j4, j5}每个关节的关节角度,正向运动学会换算成对应的pose
repeated double pose_via = 1;
// 同上
repeated double pose_to = 2;
// 设定pose_via和pose_to是用{x, y, z, rx, ry,
// rz}描述末端位置和姿态还是用关节角度
bool pose_via_is_joint = 3;

bool pose_to_is_joint = 4;
// 单位:m/s^2,工具加速度
double acceleration = 5;
// 单位:m/s,工具速度
double velocity = 6;
// 单位:m,下一段的交融半径
double blend_radius = 7;
// 工作模式:0:无约束模式,Interpolate orientation from current pose to
// target pose (pose_to);1:固定方向模式,使用相对于圆弧切换固定方向的圆弧
int32 mode = 8;
// 单位:s,运动时间
double time = 9;
// 相对坐标系,仅pose_is_joint_angle=false时有效。世界坐标系为{0,0,0,0,0,0}
PR pose_base = 10;
// 弧度 (rad)
double rad = 11;
}

message MoveJRequest {
// 如果pose_is_joint_angle 为 false,反向运动学会计算成对应的关节角度;
repeated double joint_pose_to = 1;
// 设定joint_pose_to是用{x, y, z, rx, ry, rz}描述末端位置和姿态还是用关节角度
bool pose_is_joint_angle = 2;
// 单位:rad/s^2,主轴的关节加速度
double acceleration = 3;
// 单位:rad/s,主轴的关节速度
double velocity = 4;
// 单位:s,运动时间
double time = 5;
// 单位:m,下一段的交融半径
double blend_radius = 6;
// 相对坐标系,仅pose_is_joint_angle=false时有效。世界坐标系为{0,0,0,0,0,0}
PR pose_base = 7;
}

message MoveLRequest {
// 如果pose_is_joint_angle 为 false,反向运动学会计算成对应的关节角度;
repeated double pose_to = 1;
// 设定joint_pose_to是用{x, y, z, rx, ry, rz}描述末端位置和姿态还是用关节角度
bool pose_is_joint_angle = 2;
// 单位:rad/s^2,主轴的关节加速度
double acceleration = 3;
// 单位:rad/s,主轴的关节速度
double velocity = 4;
// 单位:s,运动时间
double time = 5;
// 单位:m,下一段的交融半径
double blend_radius = 6;
// 相对坐标系,仅pose_is_joint_angle=false时有效。世界坐标系为{0,0,0,0,0,0}
PR pose_base = 7;
}

message MoveLRPYRequest {
// 如果pose_is_joint_angle 为 false,反向运动学会计算成对应的关节角度;
repeated double pose_to = 1;
// 单位:rad/s^2,主轴的关节加速度,如果为-1,则表示未设置值
double acceleration = 2;
// 单位:rad/s,主轴的关节速度,如果为-1,则表示未设置值
double velocity = 3;
// 单位:s,运动时间,如果为-1,则表示未设置值
double time = 4;
// 单位:m,下一段的交融半径,如果为-1,则表示未设置值
double blend_radius = 5;
}

message MovePRequest {
repeated double pose_to = 1;
// 设定pose_to是用{x, y, z, rx, ry,
// rz}描述末端位置和姿态还是用关节角度,如果pose_is_joint_angle是true,正向运动学会计算出对应的{x,
// y, z, rx, ry, rz}
bool pose_is_joint_angle = 2;
// 单位:m/s^2,工具加速度
double acceleration = 3;
// 单位:m/s,工具速度
double velocity = 4;
// 单位:m,下一段的交融半径
double blend_radius = 5;
}

message ServoCRequest {
repeated double pose_to = 1;
// 设定pose_to是用{x, y, z, rx, ry,
// rz}描述末端位置和姿态还是用关节角度,如果pose_is_joint_angle是true,正向运动学会计算出对应的{x,
// y, z, rx, ry, rz}
bool pose_is_joint_angle = 2;
// 单位:m/s^2,工具加速度
double acceleration = 3;
// 单位:m/s,工具速度
double velocity = 4;
// 单位:m,下一段的交融半径
double blend_radius = 5;
}

message ServoJRequest {
// 如果pose_is_joint_angle 为 false,反向运动学会计算成对应的关节角度;
repeated double joint_pose_to = 1;
// 设定joint_pose_to是用{x, y, z, rx, ry, rz}描述末端位置和姿态还是用关节角度
bool pose_is_joint_angle = 2;
// 单位:rad/s^2,主轴的关节加速度
double acceleration = 3;
// 单位:rad/s,主轴的关节速度
double velocity = 4;
// 单位:s,运动时间
double time = 5;
// 单位:s,取值范围:0.03 ~ 0.2,使用预向前看的时间来让轨迹平滑
double look_ahead_time = 6;
// 取值范围:100 ~ 2000,proportinal gain for following target position,
int32 gain = 7;
}

// 微调参数
message FineTuning {
int32 mode = 1; // 1: 坐标系模式;2:关节模式
int32 base = 2; // 1: world;2: tcp
int32 coordinate = 3; // 1: 直角坐标系;2:圆柱坐标系
/*
* 需要微调的目标: 轴/关节:
* 1)关节模式下表示关节编号:0-6;
* 2)坐标系模式下
* a) 直角坐标系:0: x, 1: y, 2: z, 3: r, 4: p, 5: y
* b) 圆柱坐标系:0: ρ,1: φ,2: z, 3: r, 4: p, 5: y
*/
int32 target = 4;
int32 direction = 5; // 1: +向;-1:负向
}

message LEDStatus {
int32 mode = 1;
// LED_MODE_OFF 1 // 关闭
// LED_MODE_CONST 2 // 常亮
// LED_MODE_BREATHING 3 // 呼吸
// LED_MODE_4_PIES_ROTATE 4 // 四块旋转
// LED_MODE_SINGLE_ROTATE 5 // 同色旋转
// LED_MODE_FLASHING 6 // 闪烁
int32 speed = 2;
// LED_SPEED_HIGH 1
// LED_SPEED_NORMAL 2
// LED_SPEED_SLOW 3
repeated int32 color = 3; // 最多包含4个 0 ~ 15 之间的整数
}

message VoiceStatus {
int32 voice = 1; // 声音列表 0~10
int32 volume = 2;
// VOLUME_MUTE 0
// VOLUME_LOW 1
// VOLUME_DEFAULT 2
// VOLUME_HIGH 3
}

message FanStatus {
int32 fan = 1; // 1 关闭 2 开启
}

message CalcTcpParam {
repeated Vector poses = 1; // all the sampled frame, usually use flange frame.
double tol = 2; // tolerance for standard deviation computing,
// * if any deviation exceed tolerance, the function returns error.
}

message LuaStatus {
LuaState state = 1;
PR last_pose = 2;
JPose last_joints = 3;
}

message LampStatus {
LEDStatus led = 1;
VoiceStatus voice = 2;
FanStatus fan = 3;
}

message PVATRequest {
double duration = 1;
repeated double q = 2;
repeated double v = 3;
repeated double acc = 4;
}

message ExternalPin {
// 外置设备的id
int32 id = 1;
// pin索引
int32 pin = 2;
}

message ExternalPins {
// 外置设备的id
int32 id = 1;
// 起始地址
int32 pin = 2;
// 长度
int32 length = 3;
}

message ExternalDigital {
// 外置设备的id
int32 id = 1;
// pin索引
int32 pin = 2;
// pin索引对应的值
int32 value = 3;
}

message ExternalDigitals {
// 外置设备的id
int32 id = 1;
// 起始地址
int32 pin = 2;
// 长度
int32 length = 3;
// 值数组
repeated int32 values = 4;
}

message ExternalAnalog {
// 外置设备的id
int32 id = 1;
// pin索引
int32 pin = 2;
// pin索引对应的值
double value = 3;
}

message ExternalAnalogs {
// 外置设备的id
int32 id = 1;
// 起始地址
int32 pin = 2;
// 长度
int32 length = 3;
// 值数组
repeated double values = 4;
}

message ExternalDevice {
int32 id = 1;
}

message ExternalIOs {
repeated ExternalDigital dis = 1;
repeated ExternalDigital dos = 2;
repeated ExternalAnalog ais = 3;
repeated ExternalAnalog aos = 4;
}

+ 193
- 0
Lebai.SDK/Protos/robot_test.proto 파일 보기

@@ -0,0 +1,193 @@
syntax = "proto3";
import "messages.proto";
package robotc;

service RobotTest {
rpc InitReducerTest(Empty) returns (Result);
rpc ReducerTest(ReducerRequest) returns (ReducerResult);
rpc InitJointTest(Empty) returns (Result);
rpc JointStudy(Empty) returns (JointStudyResult);
rpc JointTest(JointRequest) returns (JointResult);
rpc TestCommand(CommandRequest) returns (CommandResult);
/// 磨合测试,返回每个周期的结果,主动断开即停止
rpc RunInTest(RunInRequest) returns(RunInResult);
/// 绝对精度测试
rpc MoveDetectTest(MoveDetectRequest) returns(MoveDetectResult);
/// 百分表读取
rpc GetDialIndicator(DeviceIds) returns(DeviceValues);
/// 量产测试
rpc StartProductTest(ProductTestRequest) returns(ProductTestResult);
/// 主机箱测试: 1, 正常;其他异常
rpc BoxTest(Empty) returns(Result);

// 初始化机器人设备信息
/**
{
"robot": {
"model": "LM6J",
"sn": "C01905010001XX"
},
"name": "lebai-Yonnie",
"mac": "B6LLYLUAQG19",
"arm": {
"sn": "R01905010001XX"
}
}
*/
rpc InitRobot(RobotInfo) returns (InitRobotResult);
rpc WriteSn(DeviceInfo) returns (WriteSnResult);
rpc ReadSn(DeviceTypeRequest) returns (DeviceInfo);
}

message Empty {}

message Result {
int32 ok = 1; // 0 正常 其他异常
int32 testError = 2;
}

message Joints {
repeated double pose = 1;
}

message ReducerRequest {
double v = 1; // 转速
}

message ReducerResult {
double voltage = 1; // 电压 V
double v = 2; // 转速 rpm
double torque = 3; // 扭矩 Nm
}

message JointStudyResult {
uint32 motor_encoder = 1; // 电机编码(磁编位置)
}

message JointRequest {
uint32 joint_type = 1; // 0 大关节 1 小关节
}

message JointResult {
double backlash = 1; // 空程 °
double pos_stable_time = 2; // 位置稳定时间 s
double pos_overshot = 3; // 位置超调量 rad
double temperature = 4; // 关节内部温度 ℃
double current = 5; // 电流 A
double voltage = 6; // 电压 V
double v = 7; // 转速 rpm
double torque = 8; // 电机扭矩 Nm
uint32 motor_encoder = 9; // 电机编码(磁编位置)
double joint_torque = 10; // 关节扭矩
double reducer_eff = 11; // 减速器效率
double motor_eff = 12; // 电机效率
}

message CommandRequest {
int32 type = 1; // 类型
int32 value_i = 2;
double value_f = 3;
}

message CommandResult {
int32 code = 1; // 返回码,默认0即可
}

message MovePoint {
// 如果pose_is_joint_angle 为 false,反向运动学会计算成对应的关节角度;
repeated double joint_pose_to = 1;
// 设定joint_pose_to是用{x, y, z, rx, ry, rz}描述末端位置和姿态还是用关节角度
bool pose_is_joint_angle = 2;
// 单位:rad/s^2,主轴的关节加速度
double acceleration = 3;
// 单位:rad/s,主轴的关节速度
double velocity = 4;
// 单位:s,运动时间
double time = 5;
// 单位:m,下一段的交融半径
double blend_radius = 6;
}
message RunInRequest {
repeated MovePoint path = 1; // 单个磨合测试周期轨迹
double equivalent_radius = 2; // 等效半径 m
double threshold_distance = 3;// 门限距离 m
double position_stable_time = 4; // 位置稳定时间(最大) s
double position_overshoot = 5; // 位置超调量(最大) m
double pose_stable_time = 6; // 姿态稳定时间(最大) s
double pose_overshoot = 7; // 姿态超调量(最大) m
}

message RunInJointInfo {
double min_velocity = 1; // 反馈速度 m/s
double max_velocity = 2; // 反馈速度
double min_voltage = 3; // 电压 V
double max_voltage = 4; // 电压
double min_temperature = 5; // 温度 ℃
double max_temperature = 6; // 温度
}

message RunInPathResult {
repeated RunInJointInfo joints = 1;
}

message RunInResult {
bool ok = 1; // 是否符合标准
repeated RunInPathResult path = 2; // 每条轨迹的抖动值
double position_stable_time = 4; // 位置稳定时间 s
double position_overshoot = 5; // 位置超调量 m
double pose_stable_time = 6; // 姿态稳定时间 s
double pose_overshoot = 7; // 姿态超调量 m
string filename = 8; // csv文件路径
}

message DeviceIds {
repeated uint32 id = 1; // 同类型的第几个设备
}

message DeviceValues {
repeated double value = 1; // 读数结果
}

message ProductTestRequest {
uint32 cmd = 1; // 测试命令
}

message ProductTestResult {
uint32 testRes = 1; // 测试结果
uint32 testError = 2;
}

message InitRobotResult {
int32 ret = 1; // 初始化Robort返回结果
string cup = 2; // 绑定hash值
}

message WriteSnResult {
int32 writeSnRes = 1; // 写sn结果
}

message DeviceTypeRequest {
int32 devType = 1; // 要读sn的设备类型
}

message DecimalInput {
int32 pin = 1;
int32 value = 2; // 1 或者 0。若为 -1 则表示没有结果(没有运行到此处)
}

message MoveDetectPath {
MovePoint path = 1; // 单个轨迹
repeated DecimalInput moving = 2; // 移动中的各传感器应有值
repeated DecimalInput cross = 3; // 移动完成后(交点)时的各传感器应有值
}

message MoveDetectRequest {
repeated MoveDetectPath req = 1;
}

message MoveDetectResult {
bool ok = 1; // 是否符合标准
repeated MoveDetectPath res = 2; // 周期内移动中的传感器值,不保证path是对的
string filename = 3; // csv文件路径
}

+ 46
- 0
Lebai.SDK/Protos/simulation.proto 파일 보기

@@ -0,0 +1,46 @@
syntax = "proto3";

import "google/protobuf/empty.proto";
import "messages.proto";

package robotc;

// 仿真-离线编程模拟服务
service SimulationController {
// 设置仿真机器人关节角
rpc SetPos(JPose) returns (SimRes);
// 硬件急停
rpc EStop(google.protobuf.Empty) returns (SimRes);
// 释放硬件急停开关
rpc EStopRelease(google.protobuf.Empty) returns (SimRes);
// 按下按钮
rpc Button(ButtonReq) returns (SimRes);
// 设置百分表值
rpc SetDialgage(DialgageReq) returns (SimRes);
// 设置模拟输入
rpc SetRobotAI(AIO) returns (SimRes);
// 设置数字输入
rpc SetRobotDI(DIO) returns (SimRes);
// 设置法兰数字输入
rpc SetFlangeDI(DIO) returns (SimRes);
// 设置仿真机器人运行速度
rpc ChangeRobotSpeed(RobotSpeed) returns (SimRes);
}

message SimRes {
int32 ret = 1;
}

message ButtonReq {
int32 id = 1;
int32 state = 2; // 1: 按钮空闲;2:长按;3:单击;4: 双击
}

message DialgageReq {
int32 id = 1; // 0, 1, 2
double value = 2;
}

message RobotSpeed {
uint32 cycle = 1; // 默认为 9,最小为 3。值越大,速度越慢
}

+ 126
- 0
Lebai.SDK/messages.proto 파일 보기

@@ -0,0 +1,126 @@
syntax = "proto3";

package robotc;

message Response {
int32 ret = 1;
}

message Coordinate {
double x = 1;
double y = 2;
double z = 3;
}

message Rotation {
double r = 1;
double p = 2;
double y = 3;
}

message PR {
Coordinate position = 1;
Rotation rotation = 2;
}

message JPose {
repeated double joints = 1;
}

message Payload { // 末端负载
double mass = 1; // 质量, default: 0
Coordinate cog = 2; // 质心,Center of gravity, default: 0
}

message PayloadMass {
double mass = 1;
}

message PayloadCog {
Coordinate cog = 1;
}

message IOPin { int32 pin = 1; }

message DIO {
int32 pin = 1;
int32 value = 2;
}

message AIO {
//提供给用户做操作的地址
int32 pin = 1;
//电流环或电压环
int32 mode = 2;
double value = 3;
}

message ModbusExternalIOState {
//设备ID
int32 id = 1;
//0表示断开,1表示连接成功
int32 state = 2;
}
//xxx
message IO {
// 所有数字量的输入值
repeated DIO robotDIOIn = 1;
// 所有数字量的输出值
repeated DIO robotDIOOut = 2;
// 所有模拟量输入值
repeated AIO robotAIOIn = 3;
// 所有模拟量输出值
repeated AIO robotAIOOut = 4;
// 所有tcp数字量的输入值
repeated DIO tcpDIOIn = 5;
// 所有tcp数字量的输出值
repeated DIO tcpDIOOut = 6;
//modbus的状态信息
repeated ModbusExternalIOState extIODevices = 7;
// 所有扩展数字量的输入值
repeated DIO extra_robotDIOIn = 8;
// 所有扩展数字量的输出值
repeated DIO extra_robotDIOOut = 9;
// 所有扩展模拟量输入值
repeated AIO extra_robotAIOIn = 10;
// 所有扩展模拟量输出值
repeated AIO extra_robotAIOOut = 11;
}

message Hardware {
string model = 1;
string sn = 2;
string driver_version = 3; // 作为传入参数时无意义
}

message RobotInfo {
Hardware robot = 1; // 机器人型号在 robot.model 里
Hardware flange = 2;
Hardware led = 3;
repeated Hardware joints = 4;
string rcVersion = 5; // 作为传入时无意义
string name = 6; // 机器人默认名称
Hardware comboard = 7; // 主控板
string mac = 8; // 机械臂整机ID号
Hardware arm = 9; // 主机箱
string appTag = 10; // release cfqmp simulate joint circuit
string typeTag = 11; // debug release
bool extra_io = 12;
//xxx
}

message DeviceInfo {
Hardware devInfo = 1; // 主控板
//2表示通信板、3表示法兰、4表示灯板、5表示关节板
int32 dev_type = 2;
}

enum LuaState {
IDLE = 0;
RUNNING = 1;
PAUSED = 2;
ABORTED = 3; // Error
STOPPED = 4; // Stop
BEGIN = 5;
END = 6;
};

+ 67
- 32
SmartClient.sln 파일 보기

@@ -3,33 +3,31 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32002.185
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.DRCoffee", "BPASmartClient.DRCoffee\BPASmartClient.DRCoffee.csproj", "{31E9DC70-5889-4BA5-A5BA-FFDE66AFF314}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.DRCoffee", "BPASmartClient.DRCoffee\BPASmartClient.DRCoffee.csproj", "{31E9DC70-5889-4BA5-A5BA-FFDE66AFF314}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "4.Driver", "4.Driver", "{666CB1A9-562E-453A-A2C7-FD9D77CFDFDD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.KLMCoffee", "BPASmartClient.KLMCoffee\BPASmartClient.KLMCoffee.csproj", "{BA543940-3C97-410D-B66C-1B928FCBB567}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.KLMCoffee", "BPASmartClient.KLMCoffee\BPASmartClient.KLMCoffee.csproj", "{BA543940-3C97-410D-B66C-1B928FCBB567}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.GSIceCream", "BPASmartClient.GSIceCream\BPASmartClient.GSIceCream.csproj", "{51E93537-DE9A-460C-B2B6-5FCB7A616A94}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.GSIceCream", "BPASmartClient.GSIceCream\BPASmartClient.GSIceCream.csproj", "{51E93537-DE9A-460C-B2B6-5FCB7A616A94}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.SCChip", "BPASmartClient.SCChip\BPASmartClient.SCChip.csproj", "{F57AF771-8514-4020-BBF3-1708388DD4B3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.Lebai", "BPASmartClient.Lebai\BPASmartClient.Lebai.csproj", "{69F90530-ADA4-4A0C-8068-AAC5584072D7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.SCChip", "BPASmartClient.SCChip\BPASmartClient.SCChip.csproj", "{F57AF771-8514-4020-BBF3-1708388DD4B3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "5.Communication", "5.Communication", "{3D1D0E04-03FD-480A-8CF8-6E01A2E28625}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.SerialPort", "BPASmartClient.SerialPort\BPASmartClient.SerialPort.csproj", "{2344EB60-1760-4DF0-961A-FA5BE5BC47CC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.SerialPort", "BPASmartClient.SerialPort\BPASmartClient.SerialPort.csproj", "{2344EB60-1760-4DF0-961A-FA5BE5BC47CC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.Http", "BPASmartClient.Http\BPASmartClient.Http.csproj", "{202763AA-4C4C-4738-B530-93A9A1ECE578}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Http", "BPASmartClient.Http\BPASmartClient.Http.csproj", "{202763AA-4C4C-4738-B530-93A9A1ECE578}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.Modbus", "BPASmartClient.Modbus\BPASmartClient.Modbus.csproj", "{13C86146-CD3C-4CD3-AB7F-7A155E222832}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Modbus", "BPASmartClient.Modbus\BPASmartClient.Modbus.csproj", "{13C86146-CD3C-4CD3-AB7F-7A155E222832}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3.Device", "3.Device", "{9FB27073-61A0-4FE3-94DB-5FDDE062332F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MorkS", "BPASmartClient.MorkS\BPASmartClient.MorkS.csproj", "{0827FA85-8180-4A85-BE58-9483AC4BB3BA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkS", "BPASmartClient.MorkS\BPASmartClient.MorkS.csproj", "{0827FA85-8180-4A85-BE58-9483AC4BB3BA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MorkD", "BPASmartClient.MorkD\BPASmartClient.MorkD.csproj", "{8878BCFD-AC5E-4D84-8C63-CA99DDE036EE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkD", "BPASmartClient.MorkD\BPASmartClient.MorkD.csproj", "{8878BCFD-AC5E-4D84-8C63-CA99DDE036EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MorkT", "BPASmartClient.MorkT\BPASmartClient.MorkT.csproj", "{B399BCFF-82E8-4940-9CE5-B7DCDDFDC696}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkT", "BPASmartClient.MorkT\BPASmartClient.MorkT.csproj", "{B399BCFF-82E8-4940-9CE5-B7DCDDFDC696}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2.Business", "2.Business", "{6CEA3385-6F62-452A-8275-033A6037235D}"
EndProject
@@ -37,25 +35,37 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "1.UI", "1.UI", "{8712125E-1
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "6.Uitility", "6.Uitility", "{1A9920BA-7C8D-4BDC-8D7D-6544A71AF3CF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.Helper", "BPASmartClient.Helper\BPASmartClient.Helper.csproj", "{A2A5CB83-11C7-4534-A65D-6F957B60EEFF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Helper", "BPASmartClient.Helper\BPASmartClient.Helper.csproj", "{A2A5CB83-11C7-4534-A65D-6F957B60EEFF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Message", "BPASmartClient.Message\BPASmartClient.Message.csproj", "{C517D33F-8800-405E-9D59-E1F6CA201431}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.DeviceProxy", "BPASmartClient.DeviceProxy\BPASmartClient.DeviceProxy.csproj", "{9D26C2D6-CF32-4FB6-A15E-8A1455DACD69}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Status", "BPASmartClient.Status\BPASmartClient.Status.csproj", "{2C8DAB92-D5EB-4462-87C1-0BED75B26C54}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.IoT", "BPASmartClient.IoT\BPASmartClient.IoT.csproj", "{D3DBCC2D-086E-4E3A-B70A-22A79FB295CF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient", "BPASmartClient\BPASmartClient.csproj", "{2BA531E8-7F85-4EBF-AE97-811CD7C83EF2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.ViewModel", "BPASmartClient.ViewModel\BPASmartClient.ViewModel.csproj", "{4E393E60-D39A-4118-8BD5-427DC72E9ACE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.Message", "BPASmartClient.Message\BPASmartClient.Message.csproj", "{C517D33F-8800-405E-9D59-E1F6CA201431}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MQTT", "BPASmartClient.MQTT\BPASmartClient.MQTT.csproj", "{7D290C8E-ACA7-4F03-91DF-D507FB3E2E87}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.DeviceProxy", "BPASmartClient.DeviceProxy\BPASmartClient.DeviceProxy.csproj", "{9D26C2D6-CF32-4FB6-A15E-8A1455DACD69}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Socket", "BPASmartClient.Socket\BPASmartClient.Socket.csproj", "{F9AD1657-7FF9-470F-BE7F-2379ADAC0BB0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.Status", "BPASmartClient.Status\BPASmartClient.Status.csproj", "{2C8DAB92-D5EB-4462-87C1-0BED75B26C54}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.OrderProxy", "BPASmartClient.OrderProxy\BPASmartClient.OrderProxy.csproj", "{D3290B30-80FC-4999-8ADF-DFEDD75AF2B4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.IoT", "BPASmartClient.IoT\BPASmartClient.IoT.csproj", "{D3DBCC2D-086E-4E3A-B70A-22A79FB295CF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Business", "BPASmartClient.Business\BPASmartClient.Business.csproj", "{DE0F8684-8F5D-4A38-BB02-1717EBE2990F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient", "BPASmartClient\BPASmartClient.csproj", "{2BA531E8-7F85-4EBF-AE97-811CD7C83EF2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Device", "BPASmartClient.Device\BPASmartClient.Device.csproj", "{031D7754-1B8C-419B-AB11-8FF61E438AD8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.ViewModel", "BPASmartClient.ViewModel\BPASmartClient.ViewModel.csproj", "{4E393E60-D39A-4118-8BD5-427DC72E9ACE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Peripheral", "BPASmartClient.Peripheral\BPASmartClient.Peripheral.csproj", "{DF8438E8-80D7-4225-BB46-735E874CF76F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.Device", "BPASmartClient.Device\BPASmartClient.Device.csproj", "{FFECD10B-FE66-4331-A915-409F5BE04480}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lebai.SDK", "Lebai.SDK\Lebai.SDK.csproj", "{FA65CD54-963C-4848-9AA7-65CC155510F5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MQTT", "BPASmartClient.MQTT\BPASmartClient.MQTT.csproj", "{7D290C8E-ACA7-4F03-91DF-D507FB3E2E87}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.Lebai", "BPASmartClient.Lebai\BPASmartClient.Lebai.csproj", "{AC84B5CD-F225-4D6F-9C28-2E05DD4573FD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.Socket", "BPASmartClient.Socket\BPASmartClient.Socket.csproj", "{F9AD1657-7FF9-470F-BE7F-2379ADAC0BB0}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MorkIC", "BPASmartClient.MorkIC\BPASmartClient.MorkIC.csproj", "{C4F2C26B-67F9-44D0-AA69-EFE443E82247}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -79,10 +89,6 @@ Global
{F57AF771-8514-4020-BBF3-1708388DD4B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F57AF771-8514-4020-BBF3-1708388DD4B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F57AF771-8514-4020-BBF3-1708388DD4B3}.Release|Any CPU.Build.0 = Release|Any CPU
{69F90530-ADA4-4A0C-8068-AAC5584072D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{69F90530-ADA4-4A0C-8068-AAC5584072D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{69F90530-ADA4-4A0C-8068-AAC5584072D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{69F90530-ADA4-4A0C-8068-AAC5584072D7}.Release|Any CPU.Build.0 = Release|Any CPU
{2344EB60-1760-4DF0-961A-FA5BE5BC47CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2344EB60-1760-4DF0-961A-FA5BE5BC47CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2344EB60-1760-4DF0-961A-FA5BE5BC47CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -135,10 +141,6 @@ Global
{4E393E60-D39A-4118-8BD5-427DC72E9ACE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4E393E60-D39A-4118-8BD5-427DC72E9ACE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4E393E60-D39A-4118-8BD5-427DC72E9ACE}.Release|Any CPU.Build.0 = Release|Any CPU
{FFECD10B-FE66-4331-A915-409F5BE04480}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFECD10B-FE66-4331-A915-409F5BE04480}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFECD10B-FE66-4331-A915-409F5BE04480}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FFECD10B-FE66-4331-A915-409F5BE04480}.Release|Any CPU.Build.0 = Release|Any CPU
{7D290C8E-ACA7-4F03-91DF-D507FB3E2E87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D290C8E-ACA7-4F03-91DF-D507FB3E2E87}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D290C8E-ACA7-4F03-91DF-D507FB3E2E87}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -147,6 +149,34 @@ Global
{F9AD1657-7FF9-470F-BE7F-2379ADAC0BB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9AD1657-7FF9-470F-BE7F-2379ADAC0BB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9AD1657-7FF9-470F-BE7F-2379ADAC0BB0}.Release|Any CPU.Build.0 = Release|Any CPU
{D3290B30-80FC-4999-8ADF-DFEDD75AF2B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3290B30-80FC-4999-8ADF-DFEDD75AF2B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3290B30-80FC-4999-8ADF-DFEDD75AF2B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3290B30-80FC-4999-8ADF-DFEDD75AF2B4}.Release|Any CPU.Build.0 = Release|Any CPU
{DE0F8684-8F5D-4A38-BB02-1717EBE2990F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE0F8684-8F5D-4A38-BB02-1717EBE2990F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE0F8684-8F5D-4A38-BB02-1717EBE2990F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DE0F8684-8F5D-4A38-BB02-1717EBE2990F}.Release|Any CPU.Build.0 = Release|Any CPU
{031D7754-1B8C-419B-AB11-8FF61E438AD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{031D7754-1B8C-419B-AB11-8FF61E438AD8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{031D7754-1B8C-419B-AB11-8FF61E438AD8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{031D7754-1B8C-419B-AB11-8FF61E438AD8}.Release|Any CPU.Build.0 = Release|Any CPU
{DF8438E8-80D7-4225-BB46-735E874CF76F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF8438E8-80D7-4225-BB46-735E874CF76F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF8438E8-80D7-4225-BB46-735E874CF76F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF8438E8-80D7-4225-BB46-735E874CF76F}.Release|Any CPU.Build.0 = Release|Any CPU
{FA65CD54-963C-4848-9AA7-65CC155510F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FA65CD54-963C-4848-9AA7-65CC155510F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA65CD54-963C-4848-9AA7-65CC155510F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA65CD54-963C-4848-9AA7-65CC155510F5}.Release|Any CPU.Build.0 = Release|Any CPU
{AC84B5CD-F225-4D6F-9C28-2E05DD4573FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC84B5CD-F225-4D6F-9C28-2E05DD4573FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC84B5CD-F225-4D6F-9C28-2E05DD4573FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC84B5CD-F225-4D6F-9C28-2E05DD4573FD}.Release|Any CPU.Build.0 = Release|Any CPU
{C4F2C26B-67F9-44D0-AA69-EFE443E82247}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C4F2C26B-67F9-44D0-AA69-EFE443E82247}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C4F2C26B-67F9-44D0-AA69-EFE443E82247}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C4F2C26B-67F9-44D0-AA69-EFE443E82247}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -156,7 +186,6 @@ Global
{BA543940-3C97-410D-B66C-1B928FCBB567} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD}
{51E93537-DE9A-460C-B2B6-5FCB7A616A94} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD}
{F57AF771-8514-4020-BBF3-1708388DD4B3} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD}
{69F90530-ADA4-4A0C-8068-AAC5584072D7} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD}
{2344EB60-1760-4DF0-961A-FA5BE5BC47CC} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
{202763AA-4C4C-4738-B530-93A9A1ECE578} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
{13C86146-CD3C-4CD3-AB7F-7A155E222832} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
@@ -170,9 +199,15 @@ Global
{D3DBCC2D-086E-4E3A-B70A-22A79FB295CF} = {6CEA3385-6F62-452A-8275-033A6037235D}
{2BA531E8-7F85-4EBF-AE97-811CD7C83EF2} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{4E393E60-D39A-4118-8BD5-427DC72E9ACE} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{FFECD10B-FE66-4331-A915-409F5BE04480} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
{7D290C8E-ACA7-4F03-91DF-D507FB3E2E87} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
{F9AD1657-7FF9-470F-BE7F-2379ADAC0BB0} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
{D3290B30-80FC-4999-8ADF-DFEDD75AF2B4} = {6CEA3385-6F62-452A-8275-033A6037235D}
{DE0F8684-8F5D-4A38-BB02-1717EBE2990F} = {6CEA3385-6F62-452A-8275-033A6037235D}
{031D7754-1B8C-419B-AB11-8FF61E438AD8} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
{DF8438E8-80D7-4225-BB46-735E874CF76F} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD}
{FA65CD54-963C-4848-9AA7-65CC155510F5} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD}
{AC84B5CD-F225-4D6F-9C28-2E05DD4573FD} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD}
{C4F2C26B-67F9-44D0-AA69-EFE443E82247} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC}


불러오는 중...
취소
저장