stage3-bg2

  • Home
    • Site Map
    • reveal
    • blog
  • about
  • stage1
    • stage1-bg3
    • stage1-bg9
      • bg9設計概念
      • bg9設計草圖
      • bg9產品展示
    • stage1-bg13
      • bg13設計概念
      • bg13設計草圖
      • bg13產品展示
    • stage1-bg18
      • bg18零件組合圖
      • bg18組合零件爆炸
      • bg18Invnetor模擬
      • bg18產品報告
      • bg18PDF
      • bg18報告
  • stage2
    • stage2-bg3
      • bg3-模擬結果
      • bg3-PDF檔案
      • bg3-參考資料
      • bg3-圖檔
      • bg3-討論
    • stage2-bg11
      • bg11模擬結果
  • stage3
    • W9 網頁操作
      • ipv4操作
      • task1測試
      • 範例task2
      • task3
    • W10 討論主題
    • W11 直播處理
    • W12 使用remote api
    • W13 小組遠距討論
    • W14 stage3進度
    • W15 stage3進度
    • W15 MTB Robot 練習
    • W16
    • W17
    • W18
  • task2
    • S1-B18
    • S2-B11
  • 直播影片
  • Youtube影片
  • 筆記
    • 更新網站
    • reveal的頁面問題
    • coppeliasim 教學
    • CoppeliaSim碰撞&動態
    • CoppeliaSim物體顏色、透明度
    • 當git pull有狀況時該如何解決
    • SSH快速版(簡單化)
    • 如何開啟leo及reveal
    • OBS黑頻問題
task2 << Previous Next >> S2-B11

S1-B18

本人是stage1-bg18成員

stage1 所完成的 coppeliasim 場景, 採 Python remote API 進行操控。

----------

(按鍵指令)

Z............拉桿續力
"空白建".....拉桿前推
esc..........結束

◾實際操作影片

----------

(程式碼)

import sim as vrep
import math
import random
import time
import keyboard

print ('Start')

# Close eventual old connections
vrep.simxFinish(-1)
# Connect to V-REP remote server
clientID = vrep.simxStart('192.168.0.12', 19997, True, True, 5000, 5)

if clientID != -1:
    print ('Connected to remote API server')
    
    res = vrep.simxAddStatusbarMessage(
        clientID, "40823210",
        vrep.simx_opmode_oneshot)
    if res not in (vrep.simx_return_ok, vrep.simx_return_novalue_flag):
        print("Could not add a message to the status bar.")

    opmode = vrep.simx_opmode_oneshot_wait
    
    vrep.simxStartSimulation(clientID, opmode)
    ret,rod_handle=vrep.simxGetObjectHandle(clientID,"joint",opmode)
    ret,ro_handle=vrep.simxGetObjectHandle(clientID,"joint1",opmode)

    #ret,main = vrep.simxGetObjectHandle(clientID, "main", opmode)
    while True:
    
        #keyboard "Z" 
        if keyboard.is_pressed("Z"):
            vrep.simxSetJointTargetVelocity(clientID,rod_handle,1,opmode)
            
        #keyboard "space" 
        if keyboard.is_pressed("space"):
            vrep.simxSetJointTargetVelocity(clientID,rod_handle,-99999,opmode)  

        #keyboard "esc" 
        if  keyboard.is_pressed("esc"):
            vrep.simxStopSimulation(clientID, opmode)
            break
        
else:
    print ('Failed connecting to remote API server')
    print ('End')

---------

影片場景之ttt檔及其他相關檔案,可至本人的個人倉儲下載:

https://github.com/40823210/cd2021

(檔案位置:task2 ➝水球發射器)


task2 << Previous Next >> S2-B11

Copyright © All rights reserved | This template is made with by Colorlib