0%

libfreenect2:https://github.com/OpenKinect/libfreenect2
iai_kinect2:https://github.com/code-iai/iai_kinect2#opencl-with-amd

注意

安装的是kinect2

主要参照的教程:

https://blog.csdn.net/lvxobrkszd/article/details/75142503

测试时:

1
2
3
./bin/Protonect cpu
./bin/Protonect gl
./bin/Protonect cl

这里注意加上sudo
且cl处一开始可能不行,由于电脑使用的是intel显卡(使用lspci | grep -i vga查看显卡类型)
opencl配置一方面参照原github上教程,另一方面参照:https://blog.csdn.net/qingsong1001/article/details/92761773(这里的sudo alien *.rpm 是指,在上面5个wget下来的文件的文件夹里,把所有.rpm变成.deb,如果已经是.deb就不需要转了;sudo dpkg -i *.deb 则表示安装)

rosdep install -r –from-paths报错解决方法:

https://blog.csdn.net/qq_37611824/article/details/80136989

source devel/setup.bash

该命令注意在catkin_ws文件夹里进行

roslaunch kinect2_bridge kinect2_bridge.launch

该命令需要管理员权限,可以先使用sudo su进入root再调用此命令,sudo su具体要参照:https://blog.csdn.net/qq_16775293/article/details/81138904

rosrun kinect2_viewer kinect2_viewer

该命令需要再开一个终端

默认的ros运行kinect2是gpu模式,转换成cpu模式

rosrun kinect2_bridge kinect2_bridge _depth_method:=cpu _reg_method:=cpu,这里和6一样也需要权限而且不要忘了source devel/setup.bash

如果依然出现问题

可以先试试把usb口拔了再试试

随着cmake的学习过程持续更新。

下载安装

下载网址:https://cmake.org/download/
.msi提供的是命令行版的cmake,安装时添加到PATH里,然后在cmd里即可使用cmake的功能(例如cmake .等)
.zip下载后提供的是GUI版的cmake

作用简介

通过一个名为CMakeLists.txt的文件(文件中有cmake脚本)起到编译链接的作用,将零散的源文件整合成一个工程。
makefile也可起到这个作用,但cmake更简单一些。
如果使用的VS这种大型IDE的话,IDE会自动帮你完成编译链接,这时就用不到cmake了。

写第一个cmake脚本

https://blog.csdn.net/zhangyiant/article/details/51289404

进阶

中文:https://blog.csdn.net/weixin_39408343/article/details/102951335
官方文档:https://cmake.org/cmake/help/v3.16/guide/tutorial/index.html

遇到的一些bug记录

VERSION not allowed unless CMP0048 is set to NEW

解决方案:
在“project (Tutorial VERSION 1.0)”语句之前添加如下语句:

1
2
3
if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif (POLICY CMP0048)

解决方案原网址:https://github.com/Tencent/rapidjson/issues/1154

一个范例CMakeLists.txt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
cmake_minimum_required (VERSION 2.6)

# specify the C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

#防止“project (Tutorial VERSION 1.0)”中的“VERSION 1.0”产生CMP0048相关bug
if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif (POLICY CMP0048)


project (Tutorial VERSION 1.0)

configure_file(TutorialConfig.h.in TutorialConfig.h)

#使得主程序在include文件时也进入这个文件夹(即工程所在文件夹)搜索,从而将TutorialConfig.h添加入工程
include_directories("${PROJECT_BINARY_DIR}")

#如下两行为TutorialConfig.h.in的内容,在CMakeLists里不起作用
#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@



add_executable (Tutorial tutorial.cpp)

在此简单记录在Ubuntu16.04系统下安装ROS的过程

安装过程:
https://blog.csdn.net/hunter___/article/details/90734708?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_title-3&spm=1001.2101.3001.4242
采用其中的“桌面完整安装(推荐采用)”

遇到的bug:sudo apt-get install ros-kinetic-desktop-full无法定位软件包
解决方案:https://blog.csdn.net/victoria_pierce/article/details/81638319

记录点云处理库PCL的相关要点,长期更新。

PCL的安装和环境配置

VS2019+PCL1.11.1,windows,c++:

https://zhuanlan.zhihu.com/p/142955614
(链接中为1.10.1,但这两个版本的步骤是一样的,不同点在于:包含目录中头文件路径和库目录中库文件路径会有所不同,需要仔细比对)

项目属性表的配置可以参考下面的链接:
https://blog.csdn.net/weixin_42059276/article/details/106149359
配置完成后可以使用如下代码检验是否成功:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma warning(disable:4996)
#include<iostream>
#include<pcl/io/pcd_io.h>
#include<pcl/point_types.h>
#include <pcl/visualization/cloud_viewer.h>

/*
(用于粘贴用)
#pragma warning(disable:4996)
#include<iostream>
#include<pcl/io/pcd_io.h>
#include<pcl/point_types.h>
#include <pcl/visualization/cloud_viewer.h>
*/

int main(int argc, char** argv) {
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);

//
//*打开点云文件
if (pcl::io::loadPCDFile<pcl::PointXYZ>("rabbit.pcd", *cloud) == -1) {
PCL_ERROR("Couldn't read file rabbit.pcd\n");
return(-1);
}
std::cout << cloud->points.size() << std::endl;
pcl::visualization::CloudViewer viewer("cloud viewer");
viewer.showCloud(cloud);
while (!viewer.wasStopped()) {

}
system("pause");
return 0;
}

成功后会显示出“兔子”形状的三维点云,如下图所示。

代码运行效果图

rabbit.pcd的下载地址:https://pan.baidu.com/s/1Gsnsb4AllcJxjdsYbGw-Cw

PCL的一些小程序

将ply文件转化为pcd文件

原网址:https://blog.csdn.net/peach_blossom/article/details/78354641

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>
#include <pcl/common/io.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/PolygonMesh.h>
#include <vtkSmartPointer.h>
#include <vtkPolyData.h>
#include <pcl/io/pcd_io.h>
#include <pcl/io/vtk_lib_io.h>

using namespace std;

int main()
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>());
pcl::PolygonMesh mesh;
vtkSmartPointer<vtkPolyData> polydata = vtkSmartPointer<vtkPolyData>::New();
pcl::io::loadPolygonFilePLY("/projects/pcddata/horse.ply", mesh);
pcl::io::mesh2vtk(mesh, polydata);
pcl::io::vtkPolyDataToPointCloud(polydata, *cloud);
pcl::io::savePCDFileASCII("/projects/pcddata/horse.pcd", *cloud);
return 0;
}

显示窗口同时显示多个点云

原网址:https://blog.csdn.net/weixin_45377028/article/details/104564467

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/filters/statistical_outlier_removal.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/filters/passthrough.h>


/************************
关键
****************************/
pcl::visualization::PCLVisualizer viewer("双窗口学习");
//添加坐标系
//viewer.addCoordinateSystem(0,0);

int v1(0); //设置左右窗口
int v2(1);

viewer.createViewPort(0.0, 0.0, 0.5, 1, v1);
viewer.setBackgroundColor(0, 0, 0, v1);

viewer.createViewPort(0.5, 0.0, 1, 1, v2);
viewer.setBackgroundColor(0.5, 0.5, 0.5, v2);

pcl::visualization::PointCloudColorHandlerCustom<pcl::PointXYZ> cloud_out_blue(cloud, 0, 0, 255); // 显示蓝色点云
viewer.addPointCloud(cloud, cloud_out_blue, "cloud_out1", v1);

pcl::visualization::PointCloudColorHandlerCustom<pcl::PointXYZ> cloud_out_orage(cloud_filtered, 250, 128, 10); //显示橘色点云
viewer.addPointCloud(cloud_filtered, cloud_out_orage, "cloud_out2", v2);
//viewer.setSize(960, 780);
while (!viewer.wasStopped())
{
viewer.spinOnce();
}
return 0;


}

长期更新,记录一些关于深度学习的有趣应用。

游戏制作相关

GANSynth:使用 GAN 制作音乐:
https://mp.weixin.qq.com/s?__biz=MzU1OTMyNDcxMQ==&mid=2247488957&idx=1&sn=12d10e583354b7a579767018ad8c6149&chksm=fc185ef5cb6fd7e3d2885ae5c73e024c3573ef2eee01c23e2c2decb63b6625c01f8e283aad75&mpshare=1&scene=1&srcid=12281eb4xoKvRCIQ0BHx8xLQ&sharer_sharetime=1609170079581&sharer_shareid=dcd4930ac1422bbe0aa82bf70c083b50&exportkey=Aywgx2WlaX%2BxBCytASUbuM0%3D&pass_ticket=LRNCO%2B%2BtPZ%2FCuLg6iRaDt0lYATJvYhdSAyFIVz4jMgQmFuRk1kgOTvPuh3wcE0V8&wx_header=0#rd

Chimera Painter:使用 GAN 构建大量风格奇幻的卡牌游戏图像:
https://mp.weixin.qq.com/s?__biz=MzU1OTMyNDcxMQ==&mid=2247492290&idx=1&sn=30ad88ca299e98fab56764ec4d84b36a&chksm=fc1ba98acb6c209cfe998fc54cd79539db60ad0ccadba32833f2df6876ecb7266fe3171581a4&mpshare=1&scene=1&srcid=122862MT6msL972I6DYAIeBi&sharer_sharetime=1609170089659&sharer_shareid=dcd4930ac1422bbe0aa82bf70c083b50&exportkey=A23VoQDqUron%2BKR9NOTZVw8%3D&pass_ticket=LRNCO%2B%2BtPZ%2FCuLg6iRaDt0lYATJvYhdSAyFIVz4jMgQmFuRk1kgOTvPuh3wcE0V8&wx_header=0#rd

解决方案网址:https://foxypanda.me/tcp-client-in-a-uwp-unity-app-on-hololens/
使用hololens2和PC端进行socket通讯的编程方法,其中前者是客户端而后者是服务器端。
这项任务实现有困难,根源在于hololens2的UWP和unity中运行的c#程序不兼容,一些库只能在unity中运行而不能在UWP中运行。
服务器端按照一般方式编写即可,不受影响。

接收服务器端消息的代码处有//TODO:这里的received就是接收到的信息
从而便于VS中查找(查找TODO的方法:先按下Ctrl+\,再按下T)

代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using System.IO;
using System.Threading;
using System.Text;
using UnityEngine.UI;
using System.Threading.Tasks;


#if !UNITY_EDITOR
using System.Threading.Tasks;
#endif

public class TCPSocketScript : MonoBehaviour//hololens为客户端连接电脑
{
public string host;
public int port;
public string replyStr;
public static string textStr;
private bool firstReply = true;

[System.NonSerialized]
public static string[] textStrArray;

private Text tips;
#if !UNITY_EDITOR
private bool _useUWP = true;
private Windows.Networking.Sockets.StreamSocket socket;
private Task exchangeTask;
#endif

//笔记:
//这个是用来判断平台的语句。内部的内容只会在unity编辑器中执行。如果你打包了,他就不会被执行。
#if UNITY_EDITOR
private bool _useUWP = false;
System.Net.Sockets.TcpClient client;
System.Net.Sockets.NetworkStream stream;
private Thread exchangeThread;
private Text text;

#endif

private byte[] bytes = new byte[256];
private StreamWriter writer;
private StreamReader reader;

public static float needle_x;
public static float needle_y;
public static float needle_z;

public static float needle_q0;
public static float needle_qx;
public static float needle_qy;
public static float needle_qz;

public static float ribs339_x;
public static float ribs339_y;
public static float ribs339_z;

public static float ribs339_q0;
public static float ribs339_qx;
public static float ribs339_qy;
public static float ribs339_qz;

public static float probe340_x;
public static float probe340_y;
public static float probe340_z;

public static float probe340_q0;
public static float probe340_qx;
public static float probe340_qy;
public static float probe340_qz;

public static Quaternion needle_qua;
public static Quaternion ribs339_qua;
public static Quaternion probe340_qua;

public static Vector3 needle_posi;
public static Vector3 ribs339_posi;
public static Vector3 probe340_posi;

public static Matrix4x4 Tptmodel_ndi;//工具端
public static Matrix4x4 Tprobe_ndi;
public static Matrix4x4 T339_ndi;
public static Matrix4x4 Tndi_ptmodel;

public void Connect(string host, int port)
{

if (_useUWP)
{
ConnectUWP(host, port);
}
else
{
ConnectUnity(host, port);
}
}


#if UNITY_EDITOR
private void ConnectUWP(string host, int port)
#else
private async void ConnectUWP(string host, int port)
#endif

{
#if UNITY_EDITOR
print("UWP TCP clinet used in Unity!");
#else

try
{
//笔记:UWP,异步,TCP
if (exchangeTask != null) StopExchange();

socket = new Windows.Networking.Sockets.StreamSocket();
Windows.Networking.HostName serverHost = new Windows.Networking.HostName(host);
string portStr = Convert.ToString(port);

await socket.ConnectAsync(serverHost, portStr);

Stream streamOut = socket.OutputStream.AsStreamForWrite();
writer = new StreamWriter(streamOut) { AutoFlush = true };

Stream streamIn = socket.InputStream.AsStreamForRead();
reader = new StreamReader(streamIn);

RestartExchange();

}


catch (Exception e)
{
print("error"+e);
}
#endif
}

private void ConnectUnity(string host, int port)
{
#if !UNITY_EDITOR
print("Unity TCP client used in UWP!");

#else
try
{
if (exchangeThread != null) StopExchange();

client = new System.Net.Sockets.TcpClient(host, port);
stream = client.GetStream();
reader = new StreamReader(stream);
writer = new StreamWriter(stream) { AutoFlush = true };

RestartExchange();
print("Connected!");


}
catch (Exception e)
{
//TODO:
print("error" + e);
}

#endif
}


private bool exchanging = false;
private bool exchangeStopRequested = false;
private string lastPacket = null;



public void RestartExchange()
{
#if UNITY_EDITOR
//笔记:多线程
if (exchangeThread != null) StopExchange();
exchangeStopRequested = false;
exchangeThread = new System.Threading.Thread(ExchangePackets);

exchangeThread.Start();



#else
if (exchangeTask != null) StopExchange();
exchangeStopRequested = false;
exchangeTask = Task.Run(() => ExchangePackets());


#endif
}


public void ExchangePackets()
{
while (!exchangeStopRequested)
{
if (writer == null || reader == null) continue;
exchanging = true;

string received = "";
received = reader.ReadLine();//Server一定要发送有\n的内容!!
textStr = received;
print(received);
//TODO:这里的received就是接收到的信息
writer.Write(replyStr+"\n");
//Debug.Log("Sent data!");

#if UNITY_EDITOR
//byte[] bytes = new byte[client.SendBufferSize];
//int recv = 0;

//recv = stream.Read(bytes, 0, client.SendBufferSize);
//received += Encoding.UTF8.GetString(bytes, 0, recv);


#else
//笔记:读取发送来的信息
//TODO:没有接收到数据
//received = reader.ReadLine();


#endif

lastPacket = received;
// Debug.Log("Read data:" + received);
exchanging = false;

}

}



private void ReportDataToTrackingManager(string data)
{
if (data == null)
{
Debug.Log("Received a frame but data was null");
return;
}

if (firstReply == true)
{


//text.text = textStr;

firstReply = false;
}




//笔记:ndi发送的位姿数据
string[] ccc = data.Split(new string[] { "\t" }, StringSplitOptions.None);
int c_length = ccc.GetLength(0);
//print(c_length);

if (c_length > 0)
{
for (int i = 0; i < c_length; i++)
{
try
{
textStrArray[i] = ccc[i];
ReportStringToTrackingManager(ccc);
}

catch (Exception e)
{
Debug.Log(" ReportDataToTrackingManager" + e);

}

}
}
}

//NDI右手坐标系的四元数——Unity左手坐标系的四元数——左手坐标系的矩阵
//Quaternion ConvertToUnity(Quaternion input)
//{
// return new Quaternion(
// input.y, // -( right = -left )
// -input.z, // -( up = up )
// -input.x, // -(forward = forward)
// input.w
// );
//}

private void ReportStringToTrackingManager(string[] rigidBodyString)
{
//var ddd=rigidBodyString[].Split(new string[] { "," }, StringSplitOptions.None);
if (rigidBodyString.Length > 3)//过滤掉\n等字符
{
try
{
////肺部
//if (rigidBodyString[1+0*8] != "MISSING")
//{
// //转化成m
// ribs339_x = float.Parse(rigidBodyString[6 + 0 * 8]) / 1000;
// ribs339_y = float.Parse(rigidBodyString[7 + 0 * 8]) / 1000;
// ribs339_z = float.Parse(rigidBodyString[8 + 0 * 8]) / 1000;

// ribs339_q0 = float.Parse(rigidBodyString[2 + 0 * 8]);
// ribs339_qx = float.Parse(rigidBodyString[3 + 0 * 8]);
// ribs339_qy = float.Parse(rigidBodyString[4 + 0 * 8]);
// ribs339_qz = float.Parse(rigidBodyString[5 + 0 * 8]);

// ribs339_qua = new Quaternion(ribs339_qx, ribs339_qy, ribs339_qz, ribs339_q0).normalized;
// ribs339_posi = new Vector3(ribs339_x, ribs339_y, ribs339_z);
// T339_ndi = Matrix4x4.TRS(ribs339_posi, ribs339_qua, new Vector3(1, 1, 1));


// //T339_ndi
// //Vector3 trans_339 = ribs339_posi;
// //Quaternion qua_339 = ribs339_qua.normalized;


//}

//针
if (rigidBodyString[1 + 0 * 8] != "MISSING")
{
//转化成m
probe340_x = float.Parse(rigidBodyString[6 + 0 * 8]) / 1000;
probe340_y = float.Parse(rigidBodyString[7 + 0 * 8]) / 1000;
probe340_z = float.Parse(rigidBodyString[8 + 0 * 8]) / 1000;

probe340_q0 = float.Parse(rigidBodyString[2 + 0 * 8]);
probe340_qx = float.Parse(rigidBodyString[3 + 0 * 8]);
probe340_qy = float.Parse(rigidBodyString[4 + 0 * 8]);
probe340_qz = float.Parse(rigidBodyString[5 + 0 * 8]);

probe340_qua = new Quaternion(probe340_qx, probe340_qy, probe340_qz, probe340_q0).normalized;
probe340_posi = new Vector3(probe340_x, probe340_y, probe340_z);
Tprobe_ndi = Matrix4x4.TRS(probe340_posi,probe340_qua,new Vector3(1,1,1));

//Tprobe_ndi
//Vector3 trans_340 = probe340_posi;
//Quaternion qua_340 = probe340_qua.normalized;

}

//工具端
if (rigidBodyString[1 + 1 * 8] != "MISSING")
{

needle_x = float.Parse(rigidBodyString[6 + 1 * 8]) / 1000;
needle_y = float.Parse(rigidBodyString[7 + 1 * 8]) / 1000;
needle_z = float.Parse(rigidBodyString[8 + 1 * 8]) / 1000;

needle_q0 = float.Parse(rigidBodyString[2 + 1 * 8]);
needle_qx = float.Parse(rigidBodyString[3 + 1 * 8]);
needle_qy = float.Parse(rigidBodyString[4 + 1 * 8]);
needle_qz = float.Parse(rigidBodyString[5 + 1 * 8]);


needle_qua = new Quaternion(needle_qx, needle_qy, needle_qz, needle_q0).normalized;
needle_posi = new Vector3(needle_x, needle_y, needle_z);

// Tptmodel_ndi
//Vector3 trans_pt = needle_posi;
//Quaternion qua_pt = needle_qua.normalized;


//Tndi_ptmodel
Tptmodel_ndi = Matrix4x4.TRS(needle_posi, needle_qua, new Vector3(1, 1, 1));
Tndi_ptmodel = Tptmodel_ndi.inverse;

tips.text = needle_posi.x.ToString() + ","
+ needle_posi.y.ToString() + ","
+ needle_posi.z.ToString() + ","
+ needle_qua.w.ToString() + ","
+ needle_qua.x.ToString() + ","
+ needle_qua.y.ToString() + ","
+ needle_qua.z.ToString();

}


}
catch (Exception err)
{
Debug.Log("ReportStringToTrackingManager" + err.ToString());
}


}

}

public void StopExchange()
{
exchangeStopRequested = true;

#if UNITY_EDITOR
if (exchangeThread != null)
{
exchangeThread.Abort();
stream.Close();
client.Close();
writer.Close();
reader.Close();

stream = null;
exchangeThread = null;

}
#else
if (exchangeTask != null) {
exchangeTask.Wait();
socket.Dispose();
writer.Dispose();
reader.Dispose();

socket = null;
exchangeTask = null;
}
#endif
writer = null;
reader = null;
}



// Start is called before the first frame update
public void Start()
{
print("UDP!!!");
//tips = GameObject.Find("ModelTarget/PolarisProbe/Canvas/Text").GetComponent<Text>();
//string port = "26";
//string host = "192.168.3.10"; //连电脑的IP地址 SYBT
//string host = "10.135.217.20"; //连电脑的IP地址

//text = GameObject.Find("TextMeshPro11").GetComponent<Text>();
Connect(host, port);

}

// Update is called once per frame
public void Update()
{

//笔记:解析lastPacket
ReportDataToTrackingManager(lastPacket);
//tips = GameObject.Find("ModelTarget/PolarisProbe/Canvas/Text").GetComponent<Text>();

}

public void OnDestroy()
{
StopExchange();
}
}

长期更新,将找到的unity游戏开发资源网站汇总在此

其它网站的汇总

indienova上的汇总:

https://indienova.com/sp/gameDevResource#3d

知乎上的汇总,其专栏也值得一看:

https://zhuanlan.zhihu.com/c_1101849362937880576

humble bundle

销售优惠包的网站,有时候能淘到一些有用的资源:
https://www.humblebundle.com/

itch

游戏开发网站,有独立游戏;美术资源;音乐资源;书籍:
https://itch.io/

Fanatical

类似于humble bundle,但是相对更便宜,而且音频资源更多:
https://www.fanatical.com/en/

秦无邪对游戏开发工具总结:

https://www.bilibili.com/video/BV1Qa4y1Y716

3D模型

mixamo

给3D模型绑定动作,傻瓜式网站,只要不是直接拿本体出来卖而是作为游戏的一部分商用完全免费:
https://www.mixamo.com/#/

sketchfab

3D模型;AR,VR模型下载:
https://sketchfab.com/

itch.io的附件区

有许多免费模型:
https://itch.io/game-assets

maxparata

免费模型,大多为体素风格,包含机器人,赛博朋克等主题:
https://maxparata.itch.io/

DeepMotion

能将视频中人物的动作绑定到虚拟人物模型上。
https://www.deepmotion.com/

音乐和音效

audiomachine

提供罐头音乐:
https://audiomachine.com/

dark fantasy studio

通过humble bundle了解到的音乐制作工作室,可以付费购买罐头音乐:
http://darkfantasystudio.com/

audiojungle:

优点:内容多;缺点:国外网站,付费流程较复杂。
https://audiojungle.net/

adobe

adobe的音效库——几十k一个音效全部音效一共有十几个G种类丰富可见一斑,重点是mixamo和adobe的音效库只要不是直接拿本体出来卖而是作为游戏的一部分商用完全免费(对应网址:https://www.zhihu.com/question/278269186/answer/1306113806):
https://www.adobe.com/products/audition/offers/audition_dlc.html

artlist

按年付费。
版权:
可以用于任意平台:
Yes! You can use the music on YouTube, Facebook and any platform worldwide. There are absolutely no limitations or channel view counting and you can monetize your videos.
可以商用:
Yes! Artlist’s license covers you for everything, even commercial and branded projects. If you’re hired to create a project, your clients are covered too.
介绍视频:
https://www.youtube.com/watch?v=pDbgsGXkPDk
网址:
https://artlist.io/

AIVA

AI制作bgm,如果不商用的话,只要备注上出自aiva就可,一个月三首音乐下载:
https://aiva.ai/

audiotrimmer

剪辑音乐,或者改变音乐的音量
https://audiotrimmer.com/cn/

独立游戏作曲入门:

https://www.bilibili.com/video/BV1Fx411i7NW/

Royalty Free Music:

非商用免费,商用需要交一笔固定的钱,bgm:
https://www.fesliyanstudios.com/

freesound:

声效网站,所有声效均免费,但是否商用需要具体看声效本身的协议:
https://freesound.org/

协议:
https://freesound.org/help/faq/#what-do-i-need-to-do-to-legally-use-the-files-on-freesound

magenta-studio:

深度学习作曲,已经下载放在G盘ms文件夹

2D美术

nvidia canvas:

使用GAN生成2D风景画,需要nvidia的GPU
https://www.nvidia.com/en-us/studio/canvas/

其他

字体下载网站:
https://www.1001freefonts.com/

方法较多,长期更新。
CSDN上的汇总:https://blog.csdn.net/weixin_44821644/article/details/107574297

仓库的git clone

方法1

https://www.zhihu.com/question/27159393
Don.Hub的回答。

使用github的镜像网站:github.com.cnpmjs.org

https://github.com/代码库地址
改为:
https://github.com.cnpmjs.org/代码库地址

方法2

从gitee下载。
搜索:gitee极速下载\项目名

如果gitee极速下载没有,就新建仓库->导入已有仓库->输入项目在github中的地址(但当项目较大时就不好用了)

方法3

访问镜像:https://hub.fastgit.org/
然后在cmd中指定下载地址,并git clone
注意不要登录

github中任意文件下载(如release中的文件下载)

在对应文件下载的链接处右键“复制链接”,并粘贴到这些网站中进行下载。
相关汇总:
https://blog.csdn.net/sunrundong/article/details/105120529

方法1

https://www.offcloud.com

方法2

https://d.serctl.com/