1.進入2b Task 1的 #14 ,準備操作。
2.開啟start_mdecoursr,進入web_vrep2。
3.編輯templates裡面的controls.html。
4.加入start 和 stop 的botton,直接複製改。
5.編輯vrep_linefollower.py,if加入判斷式。
if direction == 'start':
vrep.simxStartSimulation(self.clientID, vrep.simx_opmode_oneshot)
if direction == 'stop':
vrep.simxStopSimulation(self.clientID, vrep.simx_opmode_oneshot)
6.補上else: ,完成後儲存,記得語法要排好。
7.開啟v-rep程式,將two_wheeler.ttt檔案拖入。
8.再開啟app.py 的go進入網址localhost:5000。
9.這樣子就可以進行start 以及 stop的操作了。
我的教學影片(有字幕):https://youtu.be/fsWnXIUaZN8
沒有留言:
張貼留言