40823213/CD2021

  • Home
    • Site Map
    • reveal
    • blog
  • About
  • work(第一階段)
    • w1
      • stage1
      • w1 video 工作介紹
      • w1 video for leo
    • w2
      • 初步作動方式
      • 零件繪製步驟
    • w3
      • 機構構想與參考圖
      • 機構繪製和模擬-2
    • w4
      • 2種轉動方式和凸輪型式
  • work(第二階段)
    • w5
    • w6
    • w7
    • w8
    • w9
  • work(第三階段)
    • w10
    • stage3-bg1圖檔
    • w11
      • 直播
    • task1
    • w14~15
    • robodk 練習
    • task2
    • task3
  • 期末考 final
    • 心得
    • 影片
  • 筆記
    • 建立網站
    • ssh
    • gogs編輯
  • 小組gitter
    • 八人小組
    • 兩人組
robodk 練習 << Previous Next >> task3

task2

藉由以前的基礎,透過程式驅動。

import sim as vrep
import math
import random
import time
  
print ('Start')
  
# Close eventual old connections
vrep.simxFinish(-1)
# Connect to V-REP remote server
clientID = vrep.simxStart('192.168.192.115', 19997, True, True, 5000, 5)
  
if clientID != -1:
    print ('Connected to remote API server')
  
    res = vrep.simxAddStatusbarMessage(
        clientID, "40823232",
        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.")
    # Communication operating mode with the remote API : wait for its answer before continuing (blocking mode)
    # http://www.coppeliarobotics.com/helpFiles/en/remoteApiConstants.htm
    opmode = vrep.simx_opmode_oneshot_wait
  
    # Try to retrieve motors and robot handlers
    # http://www.coppeliarobotics.com/helpFiles/en/remoteApiFunctionsPython.htm#simxGetObjectHandle
    vrep.simxStartSimulation(clientID,opmode)
    ret1,front_handle = vrep.simxGetObjectHandle(clientID, "Revolute_joint", opmode)
     
 
else:
    print ('Failed connecting to remote API server')


robodk 練習 << Previous Next >> task3

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