const classafParrotSdk2::DroneSessionConfig

sys::Obj
  afParrotSdk2::DroneSessionConfig

Drone config in the Session category. Session config relates to the current flight and encapsulates user and application data. That is, should the session be changed / reset, the user and application config changes also.

Create a new session by means of:

drone.config.session("My Session Name")

Future code may then access the same session by not passing a session name:

drone.config.session.hoveringRange = 1000
app

Source

DroneAppConfig app(Str? appicationName := null)

Gets or makes application config. If null is passed, this just returns the current config.

deleteAll

Source

Void deleteAll()

Deletes ALL session data from the drone. Use with caution.

deleteMe

Source

Void deleteMe()

Deletes this session data from the drone.

detectRoundel

Source

VideoCamera? detectRoundel

Enables black & white oriented roundel detection on the given camera. To receive detection data, enable NavOption.visionDetect in DroneAppConfig.navDataOptions() and inspect the visionDetect data in NavData

Set to null to disable detection.

Corresponds to the configuration keys:

  • DETECT:detect_type
  • DETECT:detections_select_v
  • DETECT:detections_select_h
detectRoundelLoRes

Source

Bool detectRoundelLoRes

Detection, by default, runs at 60 frames per section (fps) but by setting this to true it is reduced to 30 fps, removing unnecessary CPU load when not needed.

Corresponds to the DETECT:detections_select_v_hsync configuration key.

dump

Source

Str dump(Bool dumpToStdOut := true)

Dumps all fields to debug string.

gpsPosition

Source

Str:Float gpsPosition

The GPS position used for media tagging and userbox recording.

When setting values, all unknown values are ignored. To change, pass in a map with just the values you wish to update.

Corresponds to the configuration keys:

  • GPS:longitude
  • GPS:latitude
  • GPS:altitude
hoverMaxHeight

Source

Int hoverMaxHeight

The maximum distance (in millimetres) the drone should hover. Used when flyingMode is set to HOVER_ON_(ORIENTED_)ROUNDEL

Corresponds to the CONTROL:hovering_range configuration key.

hoverOnRoundel

Source

Bool hoverOnRoundel

Set to true to enable roundel detection and activate a semi-autonomous hover on top of an oriented roundel. Setting this also sets the detectRoundel config to vertical.

Note HOVER_ON_ROUNDEL was developed for the 2011 CES autonomous demonstration.

Corresponds to the CONTROL:flying_mode configuration key.

id

Source

Int id { private set }

The current session ID.

Corresponds to the CUSTOM:profile_id configuration key.

make

Source

new make(Drone drone)

Creates a new DroneSessionConfig instance for the given Drone. Note this class holds no state.

name

Source

Str name { private set }

The current session name.

Corresponds to the CUSTOM:profile_desc configuration key.

takePhoto

Source

Void takePhoto(Int numberOfPhotos := 1, Duration delayBetweenPhotos := 1sec)

Takes photographs with the forward facing front camera and saves it as JPEG images named /data/video/boxes/tmp_flight_<dateTime>/picture_<dateTime>.jpg.

Note delayBetweenPhotos must be in seconds.

Corresponds to the USERBOX:userbox_cmd configuration key.

user

Source

DroneUserConfig user(Str? userName := null)

Gets or makes user config.

userboxCancel

Source

Void userboxCancel()

Stops saving navigation data to flash memory and deletes the temporary files.

Corresponds to the USERBOX:userbox_cmd configuration key.

userboxStart

Source

Void userboxStart()

Starts saving navigation data to flash memory.

Creates the binary file /data/video/boxes/tmp_flight_<dateTime>/userbox_<timestamp> in flash memory containing navigation data where <timestamp> is the time since the drone booted.

Corresponds to the USERBOX:userbox_cmd configuration key.

userboxStop

Source

Void userboxStop()

Stops saving navigation data to flash memory.

Renames the directory containing the binary files to /data/video/boxes/flight_<dateTime>/.

Corresponds to the USERBOX:userbox_cmd configuration key.

videoCamera

Source

VideoCamera videoCamera

Selects which video camera on the drone to stream data back from.

Corresponds to the VIDEO:video_channel configuration key.

videoFps

Source

Int videoFps

Sets the frames per second (fps) of the live video codec. Values should be between 15 and 30.

Corresponds to the VIDEO:codec_fps configuration key.

videoMaxBitrate

Source

Int videoMaxBitrate

Maximum bitrate (kilobits per second) the device can decode. This is set as the upper bound for drone bitrate values.

Typical values for Apple iOS Device are:

  • iPhone 4S : 4000 kbps
  • iPhone 4 : 1500 kbps
  • iPhone 3GS : 500 kbps

When using the bitrate control mode in VBC_MANUAL, this maximum bitrate is ignored.

When using the bitrate control mode in VBC_MODE_DISABLED, the bitrate is fixed to this maximum bitrate.

Can only be set with a non-default session ID. Throws an Err if this is not the case.

Corresponds to the VIDEO:max_bitrate configuration key.

videoResolution

Source

VideoResolution videoResolution

Selects the resolution of the video that's streamed back.

It is generally not advised to change this whilst video is already streaming.

Can only be set with a non-default session ID. Throws an Err if this is not the case.

Corresponds to the VIDEO:video_codec configuration key.