Ceamara#

Réamhrá#

Tá dhá Braiteoir Fís sa Drón VEX AIR a fheidhmíonn mar cheamaraí ar bord—ceann ar an tosaigh agus ceann ar an mbun. Is féidir leo seo íomhánna agus físeán a ghabháil le linn eitilte. I VEXcode AIR, tagraíonn an focal “ceamara” i gcónaí do cheann de na Braiteoirí Fís seo. Mar shampla, in ordú cosúil le drone.camera.start_recording(FORWARD_CAMERA), tagraíonn camera do na Braiteoirí Fís, agus roghnaíonn FORWARD_CAMERA an ceann atá os comhair an tosaigh.

Chun taifeadtaí físe agus íomhánna a aistriú ón Rialaitheoir Dróin VEX AIR, ceangail an rialtóir le do ríomhaire. Feicfear é mar fheiste stórála maise (cosúil le tiomántán USB), rud a ligfidh duit comhaid a chóipeáil go díreach. Tar éis tionscadal a chríochnú, fan nóiméad go dtí go mbeidh an rialtóir críochnaithe ag íoslódáil aon íomhánna nó taifeadtaí ón drón sula ndéanann tú iarracht iad a chóipeáil.

Seo thíos liosta de na modhanna uile atá ar fáil:

Gníomhartha

Múiteoirí

  • show_camera – Taispeánann sé an Braiteoir Fís roghnaithe ar Rialaitheoir Dróin VEX AIR.

  • hide_camera – Folaíonn sé fotha an Braiteora Fís ar an rialtóir.

  • set_overlay_reticle – Taispeánann nó folaíonn sé an reticle forleagan.

  • set_overlay_telemetry – Taispeánann nó folaíonn sé sonraí teileamaitreachta.

Gabhálaithe

  • is_recording – Tugann sé seo ar ais an bhfuil an Braiteoir Fís ag taifeadadh.

  • get_recording_time – Tugann sé seo an t-am a caitheadh ​​ag taifeadadh ar ais.

Gníomhartha#

start_recording#

start_recording Tosaíonn taifeadadh leis an Braiteoir Fís sonraithe.

Chun eolas a fháil faoi thaifeadtaí a fheiceáil agus a aisghabháil, téigh anseo.

Úsáid:

drone.camera.start_recording(camera)

Paraiméadair

Cur síos

camera

An Braiteoir Fís le taifeadadh leis: DOWNWARD_CAMERA nó FORWARD_CAMERA.

# Press button 7 to end recording
def end_recording():
    drone.camera.stop_recording(FORWARD_CAMERA)
    drone.land()

controller.button7.pressed(end_recording)

# Record a video as you fly around
controller.screen.show_camera(FORWARD_CAMERA)
drone.take_off(climb_to=500)
drone.camera.start_recording(FORWARD_CAMERA)
while True:
    # Move with controller
    drone.move_with_vectors(
        forward=controller.axis4.position(),
        rightward=controller.axis3.position(),
        upward=controller.axis1.position(),
        rotation=controller.axis2.position()
    )
    wait(5, MSEC)

stop_recording#

stop_recording stopann taifeadadh an Braiteora Fís shonraithe.

Chun eolas a fháil faoi thaifeadtaí a fheiceáil agus a aisghabháil, téigh anseo.

Úsáid:

drone.camera.stop_recording(camera)

Paraiméadair

Cur síos

camera

An Braiteoir Fís chun stop a chur leis an taifeadadh le: DOWNWARD_CAMERA nó FORWARD_CAMERA.

# Press button 7 to end recording
def end_recording():
    drone.camera.stop_recording(FORWARD_CAMERA)
    drone.land()

controller.button7.pressed(end_recording)

# Record a video as you fly around
controller.screen.show_camera(FORWARD_CAMERA)
drone.take_off(climb_to=500)
drone.camera.start_recording(FORWARD_CAMERA)
while True:
    # Move with controller
    drone.move_with_vectors(
        forward=controller.axis4.position(),
        rightward=controller.axis3.position(),
        upward=controller.axis1.position(),
        rotation=controller.axis2.position()
    )
    wait(5, MSEC)

capture_image#

capture_image Glacann pictiúr leis an Braiteoir Fís sonraithe.

Chun eolas a fháil faoi íomhánna gafa a fheiceáil agus a aisghabháil, téigh anseo.

Úsáid:

drone.camera.capture_image(camera)

Paraiméadair

Cur síos

camera

An Braiteoir Fís le pictiúr a thógáil leis: DOWNWARD_CAMERA nó FORWARD_CAMERA.

# Press button 7 to take pictures
def take_picture():
    drone.camera.capture_image(FORWARD_CAMERA)

controller.button7.pressed(take_picture)

# Take pictures while you control the drone
controller.screen.show_camera(FORWARD_CAMERA)
drone.take_off(climb_to=500)
while True:
    # Move with controller
    drone.move_with_vectors(
        forward=controller.axis4.position(),
        rightward=controller.axis3.position(),
        upward=controller.axis1.position(),
        rotation=controller.axis2.position()
    )
    wait(5, MSEC)

Sóiteoirí#

show_camera#

Socraíonn show_camera an modh scáileáin reatha go dtí an fotha Braiteoir Fís sonraithe.

Úsáid:

controller.screen.show_camera(camera)

Paraiméadair

Cur síos

camera

An fotha Braiteora Fís le taispeáint: DOWNWARD_CAMERA nó FORWARD_CAMERA.

# Switch camera feeds after 3 seconds
controller.screen.show_camera(DOWNWARD_CAMERA)
wait(3, SECONDS)
controller.screen.show_camera(FORWARD_CAMERA)

hide_camera#

hide_camera i bhfolach fotha an Braiteora Fís shonraithe.

Úsáid:

controller.screen.hide_camera()

Paraiméadair

Cur síos

Níl aon pharaiméadair ag an modh seo.

# Hide camera feed after 3 seconds
controller.screen.show_camera(FORWARD_CAMERA)
wait(3, SECONDS)
controller.screen.hide_camera()

set_overlay_reticle#

Cumasaíonn nó díchumasaíonn set_overlay_reticle an reticle forleagan. Is marcóir amhairc é reticle, cosúil le crosaire, a thaispeántar i radharc an cheamara chun cabhrú le rudaí a dhíriú nó a ailíniú.

De réir réamhshocraithe, socraítear forleagan an reticle go True ag tús tionscadail, ar an Braiteoir Radhairc anuas amháin.

Usage:
controller.screen.set_overlay_reticle(state)

Paraiméadair

Cur síos

state

Stádas an reitíle forleagan: True cumasaíonn an reitíle forleagan. False díchumasaíonn an reitíle forleagan.

# Hide the reticle when not aligning to a landing area
controller.screen.show_camera(DOWNWARD_CAMERA)
drone.take_off(climb_to=500)
controller.screen.set_overlay_reticle(False)
while True:
    # Move with controller
    drone.move_with_vectors(
        forward=controller.axis4.position(),
        rightward=controller.axis3.position(),
        upward=controller.axis1.position(),
        rotation=controller.axis2.position()
    )
    wait(5, MSEC)

set_overlay_telemetry#

Cumasaíonn nó díchumasaíonn set_overlay_telemetry infheictheacht shonraí teileiméadrachta an dróin ar scáileán an rialtóra. Is sonraí beo ón drón iad teileiméadracht agus é ag eitilt nó ag rith tionscadail.

De réir réamhshocraithe, socraítear an forleagan sonraí teileamaitreachta go True ag tús tionscadail.

Usage:
controller.screen.set_overlay_telemetry(state)

Paraiméadair

Cur síos

state

Stádas na sonraí teileamaitreachta: True cumasaíonn féachaint ar shonraí teileamaitreachta ar an scáileán. False díchumasaíonn féachaint ar shonraí teileamaitreachta ar an scáileán.

# Clear the camera video for better visibility
controller.screen.show_camera(FORWARD_CAMERA)
drone.take_off(climb_to=500)
controller.screen.set_overlay_telemetry(False)
while True:
    # Move with controller
    drone.move_with_vectors(
        forward=controller.axis4.position(),
        rightward=controller.axis3.position(),
        upward=controller.axis1.position(),
        rotation=controller.axis2.position()
    )
    wait(5, MSEC)

Faighteoirí#

is_recording#

Tugann is_recording luach Booleach ar ais a léiríonn an bhfuil Braiteoir Fís sonraithe ag taifeadadh faoi láthair.

  • True – Tá an Braiteoir Fís sonraithe ag taifeadadh.

  • False – Níl an Braiteoir Fís sonraithe ag taifeadadh.

Úsáid:

drone.camera.is_recording(camera)

Paraiméadair

Cur síos

camera

An Braiteoir Fís chun stádas taifeadta a sheiceáil maidir le: DOWNWARD_CAMERA nó FORWARD_CAMERA.

# Use button 7 to start and stop recording
def toggle_recording():
    if drone.camera.is_recording(FORWARD_CAMERA):
        drone.camera.stop_recording(FORWARD_CAMERA)
    else:
        drone.camera.start_recording(FORWARD_CAMERA)

controller.button7.pressed(toggle_recording)

# Make video recordings while you control the drone
controller.screen.show_camera(FORWARD_CAMERA)
drone.take_off(climb_to=500)
while True:
    # Move with controller
    drone.move_with_vectors(
        forward=controller.axis4.position(),
        rightward=controller.axis3.position(),
        upward=controller.axis1.position(),
        rotation=controller.axis2.position()
    )
    wait(5, MSEC)

get_recording_time#

get_recording_time seolann sé an méid ama a bhfuil Braiteoir Fís ar leith ag taifeadadh mar dheachúil (snámhphointe) i soicindí.

Úsáid:

drone.camera.get_recording_time(camera)

Paraiméadair

Cur síos

camera

An Braiteoir Fís chun am taifeadta a sheiceáil de: DOWNWARD_CAMERA nó FORWARD_CAMERA.

# Record a video for 10 seconds
controller.screen.show_camera(FORWARD_CAMERA)
drone.camera.start_recording(FORWARD_CAMERA)
drone.take_off(climb_to=500)
while not (drone.camera.get_recording_time(FORWARD_CAMERA)) >= 10:
    wait(5, MSEC)
drone.camera.stop_recording(FORWARD_CAMERA)