Created by 40823108
Date today:
from controller import Robot
TIME_STEP = 1
robot = Robot()
ds = []
dsNames = ['ds_right', 'ds_left', 'ds_in']
for i in range(3):
ds.append(robot.getDevice(dsNames[i]))
ds[i].enable(TIME_STEP)
wheels = []
wheelsNames = ['wheel1', 'wheel2', 'wheel3', 'wheel4']
for i in range(4):
wheels.append(robot.getDevice(wheelsNames[i]))
wheels[i].setPosition(float('inf'))
wheels[i].setVelocity(0.0)
avoidObstacleCounter = 0
while robot.step(TIME_STEP) != -1:
leftSpeed = 10.0
rightSpeed = 10.0
if avoidObstacleCounter > 0:
avoidObstacleCounter -= 1
leftSpeed = 1.0
rightSpeed = -1.0
else: # read sensors
for i in range(3):
if ds[i].getValue() < 900.0:
avoidObstacleCounter = 90
wheels[0].setVelocity(leftSpeed)
wheels[1].setVelocity(rightSpeed)
wheels[2].setVelocity(leftSpeed)
wheels[3].setVelocity(rightSpeed)
將EV3STL黨匯入webots嘗試讓EV3避障
將EV3 STL黨匯入webots,全部的零件會變成整塊實體,所以將需要做動的輪胎部分先拆除,在webots中重建,但在webots中重建的輪胎顯示不出來,問題尚在解決當中
分組後與組員討論決定製作機械手臂夾爪,下圖為設計之概念圖。
經過設計思考機械手臂夾爪過於複雜,模擬上可能無法順利進行,決定更改主題。
討論後決定製作Lego-EV3可以透過各種不同的連桿組成所需之形狀。
下圖為參考Lego-EV3,所繪製之概念圖
開始繪製有關Lego-EV3所需之模組,首先繪製控制馬達與感測器之主機本體。
下圖為Lego-EV3主機繪製過程圖
下圖為Lego-EV3馬達繪製與主機配合樣圖
將所需之連桿繪製出來,可依想組裝之方式做組裝及設計連桿
完成所需之物件後,將連桿、主機、馬達、輪胎裝上就能夠完成一台可程式控制的小車
使用Inventor內建功能,將模型擬真,更能呈現產品之真實性
為了能夠方便模擬,我們將部分零件做簡化,讓模擬時不會因為過多的零件導致模擬失敗
第一次模擬因為零件過多,需要調整許多參數,導致在模擬過程中遇到許多問題,也導致模擬失敗
在經過零件簡化後,模擬上的問題也減少了,需要設定的參數也相對變少,最後成功讓小車可以移動
主機工程圖
爆炸圖包含BOM
完成模型
因零件過多導致模擬失敗
因零件過多導致模擬失敗
import React, { useState } from 'react';
function Example() {
const [count, setCount] = useState(0);
return (
...
);
}
Code syntax highlighting courtesy of highlight.js.
import React, { useState } from 'react';
function Example() {
const [count, setCount] = useState(0);
return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
Click me
</button>
</div>
);
}
function SecondExample() {
const [count, setCount] = useState(0);
return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
Click me
</button>
</div>
);
}
Press ESC to enter the slide overview.
Hold down the alt key (ctrl in Linux) and click on any element to zoom towards it using zoom.js. Click again to zoom back out.
(NOTE: Use ctrl + click in Linux.)
Automatically animate matching elements across slides with Auto-Animate.
Presentations look great on touch devices, like mobile phones and tablets. Simply swipe through your slides.
Hit the next arrow...
... to step through ...
... a fragmented slide.
There's different types of fragments, like:
grow
shrink
fade-out
fade-right, up, down, left
fade-in-then-out
fade-in-then-semi-out
Highlight red blue green
You can select from different transitions, like:
None -
Fade -
Slide -
Convex -
Concave -
Zoom
reveal.js comes with a few themes built in:
Black (default) -
White -
League -
Sky -
Beige -
Simple
Serif -
Blood -
Night -
Moon -
Solarized
Set data-background="#dddddd"
on a slide to change the background color. All CSS color formats are supported.
<section data-background="image.png">
<section data-background="image.png" data-background-repeat="repeat" data-background-size="100px">
<section data-background-video="video.mp4,video.webm">
Different background transitions are available via the backgroundTransition option. This one's called "zoom".
Reveal.configure({ backgroundTransition: 'zoom' })
You can override background transitions per-slide.
<section data-background-transition="zoom">
Since reveal.js runs on the web, you can easily embed other web content. Try interacting with the page in the background.
Item | Value | Quantity |
---|---|---|
Apples | $1 | 7 |
Lemonade | $2 | 18 |
Bread | $3 | 2 |
These guys come in two forms, inline: The nice thing about standards is that there are so many to choose from
and block:
“For years there has been a theory that millions of monkeys typing at random on millions of typewriters would reproduce the entire works of Shakespeare. The Internet has proven this theory to be untrue.”
You can link between slides internally, like this.
There's a speaker view. It includes a timer, preview of the upcoming slide as well as your speaker notes.
Press the S key to try it out.
Presentations can be exported to PDF, here's an example:
Set data-state="something"
on a slide and "something"
will be added as a class to the document element when the slide is open. This lets you
apply broader style changes, like switching the page background.
Additionally custom events can be triggered on a per slide basis by binding to the data-state
name.
Reveal.on( 'customevent', function() {
console.log( '"customevent" has fired' );
} );
Press B or . on your keyboard to pause the presentation. This is helpful when you're on stage and want to take distracting slides off the screen.