40823131 cd2021

  • Home
    • Site Map
    • reveal
    • blog
  • about
  • Stage1
    • W1
      • 建立網頁
      • Blog建立
    • W2
      • 分組(二人專案小組)
      • 利用Hamachi建立虛擬區域網路
      • 利用虛擬主機建立Ethercalc伺服器
    • W3
      • 初代機(version 1.0.0) ฅ^•ω•^ฅ
      • 貳代機(version 2.0.0) ^ↀᴥↀ^
      • 参代機(version 3.0.0) ଲ(^ⓛ ω ⓛ^)ଲ
      • 肆代機(version 4.0.0) V(=^・ω・^=)v
    • W4
      • 利用程式方法更改影片檔名
  • Stage2
    • W5
      • 分組組員
    • W6
      • Heroku小組網站
      • 運輸小車繪製
    • W7
      • push more easily
      • 程式控制
    • W8
      • 使用鍵盤程式控制小車移動
    • W9
      • 成果(自動化生產線速率程式控制小車ver.)
      • 成果(自動化生產線鍵盤程式控制小車ver.)
      • 心得
  • Stage3
    • W10
      • task1
      • task2-1
    • W11
      • task2-2
    • W12
      • 直播教學影片
    • W13
      • task3-About OBS setting videos
      • Use aegisub to edit and generate subtitles
    • Final專案進度
  • W14
    • 使用QT based GUI介面改寫 legacy GUI介面
    • 改用 CoppeliaSim 制式的 Lua Script 編寫與原先取放方塊零件相同的操控流程
  • Basic teaching
    • Create SSH KEY
    • Setting up putty for ssh
    • Use Leo Editor to create a web blog
    • Android phone camera instead of webcam teaching
  • W15
  • W16
  • Github帳號解除Flagged過程分享
  • Python grammar sort out
task1 << Previous Next >> W11

task2-1

將個人在 stage1 與 stage2 所完成的 coppeliasim 場景, 採 Python remote API 進行操控.

Python remote API程式:

import sim as vrep
import sys
# child threaded script: 
#simExtRemoteApiStart(19997)
 
vrep.simxFinish(-1)
 
clientID = vrep.simxStart('192.168.50.154', 19997, True, True, 5000, 5)
 
if clientID!= -1:
    print("Connected to remote server")
else:
    print('Connection not successful')
    sys.exit('Could not connect')
 
errorCode,U_motor_handle=vrep.simxGetObjectHandle(clientID,'U',vrep.simx_opmode_oneshot_wait)
 
errorCode,D_motor_handle=vrep.simxGetObjectHandle(clientID,'D',vrep.simx_opmode_oneshot_wait)
 
if errorCode == -1:
    print('Can not find U or D motor')
    sys.exit()
 
errorCode=vrep.simxSetJointTargetVelocity(clientID,U_motor_handle,0, vrep.simx_opmode_oneshot_wait)
errorCode=vrep.simxSetJointTargetVelocity(clientID,D_motor_handle,0, vrep.simx_opmode_oneshot_wait)

task1 << Previous Next >> W11

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