程序接口定义
Python->Unity
代码仓库:
https://github.com/Chen-Yulin/Unity-Python-UDP-Communication
传输的数据为字符串:
1 2 3
| def SendData(self, strToSend): # Use this function to send string to C# self.udpSock.sendto(bytes(strToSend,'utf-8'), (self.udpIP, self.udpSendPort))
|
物体识别信息
需要包含的信息:物体种类,物体的三轴方位,三轴旋转,三轴尺寸。
格式:
1 2 3 4 5 6 7 8 9 10 11
| {Object Detection} category position.x position.y position.z eulerRotation.x eulerRotation.y eulerRotation.z scale.x scale.y scale.z
|
示例:
1 2 3 4 5 6 7 8 9 10 11
| {Object Detection} Handle 0.1 0.052 0.026 0 90 0 0.5 0.3 1
|
机械臂实时角度
需要包含的信息:6 个 joint 角度(单位为度)
格式:
1 2 3 4 5 6 7 8
| {Current Joint} j0 j1 j2 j3 j4 j5 j6
|
Unity->Python
机械臂需要旋转的角度
需要包含的信息:6 个 joint 角度(单位为度)
格式:
1 2 3 4 5 6 7 8
| {Target Joint} j0 j1 j2 j3 j4 j5 j6
|