1 運行roscore
$ roscore
2 運行rosbridge_websocket
如未按照rosbridge,要先進行安裝,安裝方式爲:
$ sudo apt-get install ros-kinetic-rosbridge-server
若已安裝則直接運行:
$ roslaunch rosbridge_server rosbridge_websocket.launch
3 安裝並啓動rocos-agent
依次運行如下程序:
$ echo "deb https://packages.rocos.cloud/apt stable main" | sudo tee -a /etc/apt/sources.list.d/rocos.list
$ curl https://packages.rocos.cloud/apt/docs/key.gpg | sudo apt-key add -
$ sudo apt-get update && sudo apt-get install rocos-agent -y
按照過程中如果按照緩慢,可以切換ros源爲國內清華大學或163源來確保網絡和源可用且速度快,安裝完成後,運行如下程序啓動:
$ sudo rocos-agent
運行完成後會出現交互界面,需要先輸入密鑰,這個是和您賬戶綁定的.直接打開那個隨機鏈接,然後登錄後就會出現一個密鑰,複製然後粘貼到這個終端即可.
sudo: unable to resolve host destop
Rocos Agent v0.0.10-5863-cn
Starting setup.
Click on the URL below, or copy and paste it into a browser to authenticate yourself.
Once you have a code come back and enter it below
https://portal-cn.rocos.cloud/agent-login?code_challenge=1M-hQmcUEZtMujt07dxmP6o9pbXIN8waEbgOVjrqQKs
> Code: 5dc22f1d2209b0001873303d
接着,終端會繼續運行,讓您選擇項目project
sudo: unable to resolve host destop
Rocos Agent v0.0.10-5863-cn
Starting setup.
Click on the URL below, or copy and paste it into a browser to authenticate yourself.
Once you have a code come back and enter it below
https://portal-cn.rocos.cloud/agent-login?code_challenge=1M-hQmcUEZtMujt07dxmP6o9pbXIN8waEbgOVjrqQKs
> Code: 5dc22f1d2209b0001873303d
This robot needs to belong to a project. To start with, choose which account your target project belongs to.
[1] IFLYTEK_SZ (iflytek-sz)
[2] Rocos (rocos-481445)
> Enter the number of the account: 1
Do you want to:
[1] Add this as a new robot
[2] Link this robot to an existing robot in this project
> You choose: 2
[1] ifly-car - Ifly Car
[2] ifly-arm - ifly Arm
Enter the number of the robot:
> You choose: 2
Linking this robot to existing callsign xarm
The Rocos Agent has been configured successfully.
It is now running as a service, and will restart on reboot.
You can view this robot's details at https://portal-cn.rocos.cloud/project/1024/robots/xarm/dashboard
jetbot@destop:~$
至此agent已啓動.
4)在機器人端或本地端運行ros節點
在本地運行你想要的ros節點即可.
5)打開rocos網站查看
打開rocos網站,可以看到你的機器人,然後通過設置button,command等可以監控機器人