Lua <<
Previous Next >> Examples
Foosball
cad2022_foosball_w16_with_ball_python_script.7z
在 CoppeliaSim Python script 導入外部 .py 程式檔案 (為了在倉儲中留下程式版次), 必須使用:
#python
include solvespace_ex
其中, 外部檔案 solvespace_ex.py 內容如下:
#python
def sysCall_thread():
sim.setThreadAutomaticSwitch(True)
print( "From threaded Python child script, threadMain")
joint=sim.getObject('./left_joint')
hammer=sim.getObject('./left_player')
slider=sim.getObject('./left_slider')
velocity = 0
hammer_back = 0
torque = 0
sliding = 0
orientation=sim.getJointPosition(joint,sim.handle_world)
position=sim.getObjectPosition(hammer,sim.handle_world)
slider_position=sim.getJointPosition(slider,sim.handle_world)
while sim.getThreadExistRequest() == False:
message, auxiliaryData, auxiliaryData2 = sim.getSimulatorMessage()
if (message == sim.message_keypress):
if (auxiliaryData[0] == ord("w")):
print("w is pressed")
velocity=100
torque=200
hammer_back = 0
if (auxiliaryData[0] == ord("s")):
print("s is pressed")
hammer_back = 1
torque=-200
velocity = -100
if (auxiliaryData[0] == ord("a")):
print("a is pressed")
sliding = sliding + 0.05
if (auxiliaryData[0] == ord("d")):
print("d is pressed")
sliding = sliding - 0.05
if hammer_back == 1:
sim.setJointPosition(joint, -1, orientation)
sim.setJointTargetPosition(joint, velocity)
sim.setJointTargetPosition(slider, sliding)
foosball keyword searching on IEEE
Development Of Robotic Foosball As A Versatile Platform For Robotics Research and Contests (2003)
Kiro (2006)
Space Foosball: Coupling Tangible Interfaces with a Real-time Game Physics Engine (2009)
Automated Foosball Table (2013)
https://2019wcm.blogspot.com/search/label/foosball
https://www.ximea.com/en/corporate-news/foosball-table-robot-camera
Foosball tracking (2012)
Foose (2012)
https://cduck.me/2015/robotic-foosball-table/ (2015)
https://www.siliconrepublic.com/machines/chess-go-and-now-foosball-ai-is-coming-for-you (2016)
https://www.thestar.com/news/insight/2016/05/12/can-a-computer-beat-you-at-foosball-yes-yes-it-can.html (2016)
Low latency vision-based control for robotics (2018)
KIcker (2021)
https://youtu.be/Hu7LFrP43tA
https://forum.allaboutcircuits.com/threads/automated-foosball-hardware-advice-for-crazy-speeds.137860/
foosball_solvespace_vrep.7z
Lua <<
Previous Next >> Examples