Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

夾娃娃機設計 #6

Open
40623247 opened this issue Jun 21, 2019 · 9 comments
Open

夾娃娃機設計 #6

40623247 opened this issue Jun 21, 2019 · 9 comments

Comments

@40623247
Copy link
Contributor

40623247 commented Jun 21, 2019

將每個人負責的部分及零件介紹放上來

@40623202
Copy link
Contributor

我畫娃娃機本體

@40623249
Copy link
Contributor

這邊不能傳STL 檔 所以傳電子郵件 40623249@gm.nfu.edu.tw
40623214@gm.nfu.edu.tw
40623236@gm.nfu.edu.tw
40623220@gm.nfu.edu.tw

@40623209
Copy link
Contributor

40623209 commented Jun 21, 2019

夾爪機構設計分工
40623202 負責繪製夾娃娃機外殼
40623209 負責繪製軸套
40623215 負責繪製滑軌、爪子
40623250 負責繪製夾爪軸、組合整體機構

@40623247
Copy link
Contributor Author

40623247 commented Jun 21, 2019

記得每個人都要模擬拍影片,放到個人倉儲裡

@40623215
Copy link

爪子給47號畫

@40623215
Copy link

等組合好就開始V-rep模擬

@40623250
Copy link
Contributor

已寄出stl檔

@40623249
Copy link
Contributor

我把組裝完的都傳到你們的信箱了

@40623220
Copy link
Contributor

-- model in Solvespace 500 mm = 5000 mm in V-rep
--[[
Simulation is 10 times of realistic environment
floor in Solvespace 2.5 m x 2.5 m = 25 m x 25 m in V-rep
ball is in Solivespace 1g (0.001) = 0.01 kg in V-rep
hammer is in Solvespace 0.1 kg (100g) = 1kg in V-rep (0.1 for Inertia)
]]
--local joint_r = {'left_joint1','left_joint2','left_joint3','left_joint4',}
local slider_x ='slider_x'
local slider_y ='slider_y'
local slider_z ='slider_z'

threadFunction=function()
while sim.getSimulationState()=sim.simulation_advancing_abouttostop do
-- Read the keyboard messages (make sure the focus is on the main window, scene view):
message,auxiliaryData=sim.getSimulatorMessage()
while message
=-1 do
key=auxiliaryData[1]
sim.addStatusbarMessage('key:'..key)
if (message == sim.message_keypress) then
if (auxiliaryData[1]==2007) then
-- up key
if (sliding_x>=0.3)then else sliding_x = sliding_x + 0.005 end
sim.addStatusbarMessage('sliding_x:'..sliding_x)
end
if (auxiliaryData[1]==2008) then
-- down key
if (sliding_x<=-0.3)then else sliding_x = sliding_x - 0.005 end
sim.addStatusbarMessage('sliding_x:'..sliding_x)
end
if (auxiliaryData[1]==2009) then
-- right key
if (sliding_y>=0.3)then else sliding_y = sliding_y + 0.005 end
sim.addStatusbarMessage('sliding_y:'..sliding_y)
end
if (auxiliaryData[1]==2010) then
-- left key
if (sliding_y<=-0.3)then else sliding_y = sliding_y - 0.005 end
sim.addStatusbarMessage('sliding_y:'..sliding_y)
end
if (auxiliaryData[1]==119) then
-- z-up key
if (sliding_z>=0.3)then else sliding_z = sliding_z + 0.005 end
sim.addStatusbarMessage('sliding_z:'..sliding_z)
end
if (auxiliaryData[1]==115) then
-- z-down key
if (sliding_z<=-0.3)then else sliding_z = sliding_z - 0.005 end
sim.addStatusbarMessage('sliding_z:'..sliding_z)
end
end
message,auxiliaryData=sim.getSimulatorMessage()
end
-- We take care of setting the desired hammer position:
--sim.setJointForce(joint,torque)
sim.setJointTargetPosition(slider_x, sliding_x)
sim.setJointTargetPosition(slider_y, sliding_y)
sim.setJointTargetPosition(slider_z, sliding_z)
--Since this script is threaded, don't waste time here:
sim.switchThread() -- Resume the script at next simulation loop start
end

end
-- Put some initialization code here:
-- Retrieving of some handles and setting of some initial values:
slider_x=sim.getObjectHandle(slider_x)
slider_y=sim.getObjectHandle(slider_y)
slider_z=sim.getObjectHandle(slider_z)
velocity=0
hammer_back=0
torque=0
sliding_x = 0
sliding_y = 0
sliding_z = 0
--orientation=sim.getJointPosition(joint_all_c1, -1)
-- Here we execute the regular thread code:
res,err=xpcall(threadFunction,function(err) return debug.traceback(err) end)
if not res then
sim.addStatusbarMessage('Lua runtime error: '..err)
end

-- Put some clean-up code here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants