Skip to content

blueye.sdk.motion

motion

Classes:

  • Motion –

    Control the motion of the drone, and set automatic control modes.

Motion

Motion(parent_drone)

Control the motion of the drone, and set automatic control modes.

Motion can be set one degree of freedom at a time by using the motion setters (set_surge, set_sway, set_heave and set_yaw, and on the Blueye X7 also set_roll and set_pitch) or for all degrees of freedom in one go through the send_thruster_setpoint method.

A setpoint of 1 or -1 is full stick, not the most the thrusters can give. The force it asks for depends on set_boost and set_slow; see Control from a Python script for the levels per axis. The drone holds the last setpoint until it gets a new one, or until it zeroes the input 3 seconds after the client in control stops sending its watchdog.

Only the Blueye X7 has thrusters that can produce roll and pitch moments. The other models ignore roll and pitch input, so the setters are safe to call on any drone.

Methods:

Attributes:

Source code in blueye/sdk/motion.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
def __init__(self, parent_drone):
    self._parent_drone = parent_drone
    self.thruster_lock = threading.Lock()
    self._current_thruster_setpoints = {
        "surge": 0,
        "sway": 0,
        "heave": 0,
        "yaw": 0,
        "roll": 0,
        "pitch": 0,
    }
    self._current_boost_setpoints = {"slow": 0, "boost": 0}
    # Set while disconnect() is leaving, see _stop_input
    self._input_stopped = False

current_thruster_setpoints property writable

current_thruster_setpoints

Deprecated, use get_current_thruster_setpoints instead.

enable_auto_altitude

enable_auto_altitude(enable: bool)

Enable or disable the auto altitude control mode

When auto altitude is active, the drone will attempt to maintain its current altitude above the seabed. Heave input (set_heave or send_thruster_setpoint) specifies a speed set point instead of a force set point. A control loop on the drone will then attempt to maintain the wanted speed in the heave direction as long as auto altitude is active.

Auto altitude needs a valid altitude, which comes from a DVL or a downward-facing Ping sonar on a guest port. get_altitude() returns None while there is none. Without it the drone drops the request and only logs it on its own side, so check is_auto_altitude_active() afterwards. Enabling auto altitude turns auto depth off, also when the auto altitude request itself is dropped. If the altitude becomes invalid while auto altitude is active, the drone switches to auto depth.

Parameters:

  • enable (bool) –

    Activate auto altitude mode if true, de-activate if false.

Source code in blueye/sdk/motion.py
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
def enable_auto_altitude(self, enable: bool):
    """Enable or disable the auto altitude control mode

    When auto altitude is active, the drone will attempt to maintain its current altitude above
    the seabed. Heave input (`set_heave` or `send_thruster_setpoint`) specifies a
    speed set point instead of a force set point. A control loop on the drone will then attempt
    to maintain the wanted speed in the heave direction as long as auto altitude is active.

    Auto altitude needs a valid altitude, which comes from a DVL or a downward-facing Ping
    sonar on a guest port. `get_altitude()` returns `None` while there is none. Without it the
    drone drops the request and only logs it on its own side, so check
    `is_auto_altitude_active()` afterwards. Enabling auto altitude turns auto depth off, also
    when the auto altitude request itself is dropped. If the altitude becomes invalid while
    auto altitude is active, the drone switches to auto depth.

    Args:
        enable (bool): Activate auto altitude mode if true, de-activate if false.
    """
    self._parent_drone._ctrl_client.set_auto_altitude_state(enable)

enable_auto_depth

enable_auto_depth(enable: bool)

Enable or disable the auto depth control mode

When auto depth is active, heave input (set_heave or send_thruster_setpoint) specifies a speed set point instead of a force set point. A control loop on the drone will then attempt to maintain the wanted speed in the heave direction as long as auto depth is active.

Auto depth needs no extra sensor. Enabling it turns auto altitude off, since the two hold the same axis.

Parameters:

  • enable (bool) –

    Activate auto depth mode if true, de-activate if false.

Source code in blueye/sdk/motion.py
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
def enable_auto_depth(self, enable: bool):
    """Enable or disable the auto depth control mode

    When auto depth is active, heave input (`set_heave` or `send_thruster_setpoint`)
    specifies a speed set point instead of a force set point. A control loop on the drone will
    then attempt to maintain the wanted speed in the heave direction as long as auto depth is
    active.

    Auto depth needs no extra sensor. Enabling it turns auto altitude off, since the two hold
    the same axis.

    Args:
        enable (bool): Activate auto depth mode if true, de-activate if false.
    """
    self._parent_drone._ctrl_client.set_auto_depth_state(enable)

enable_auto_heading

enable_auto_heading(enable: bool)

Enable or disable the auto heading control mode

When auto heading is active, yaw input (set_yaw or send_thruster_setpoint) specifies an angular speed set point instead of a moment set point. A control loop on the drone will then attempt to maintain the wanted angular velocity in the yaw direction as long as auto heading is active.

Parameters:

  • enable (bool) –

    Activate auto heading mode if true, de-activate if false.

Source code in blueye/sdk/motion.py
425
426
427
428
429
430
431
432
433
434
435
436
def enable_auto_heading(self, enable: bool):
    """Enable or disable the auto heading control mode

    When auto heading is active, yaw input (`set_yaw` or `send_thruster_setpoint`)
    specifies an angular speed set point instead of a moment set point. A control loop on the
    drone will then attempt to maintain the wanted angular velocity in the yaw direction as
    long as auto heading is active.

    Args:
        enable (bool): Activate auto heading mode if true, de-activate if false.
    """
    self._parent_drone._ctrl_client.set_auto_heading_state(enable)

enable_station_keeping

enable_station_keeping(enable: bool)

Enable or disable the station keeping control mode

When station keeping is active, the drone will attempt to maintain its current position and orientation in the water as long as the mode is active.

Station keeping needs a valid position from a DVL or from the drone's own Blueye GNSS. Topside positioning (UGPS, USBL or NMEA input over UDP) is used for the map position but does not count here: those fixes jump between samples, and the drone would chase every jump. Without a valid position the drone drops the request and only logs it on its own side, so check is_station_keeping_active() afterwards. An active hold is released when the position has been invalid for 3 seconds. PositionEstimateTel.position_estimate.navigation_sensors lists each sensor with its validity.

Parameters:

  • enable (bool) –

    Activate station keeping mode if true, de-activate if false.

Source code in blueye/sdk/motion.py
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
def enable_station_keeping(self, enable: bool):
    """Enable or disable the station keeping control mode

    When station keeping is active, the drone will attempt to maintain its current position
    and orientation in the water as long as the mode is active.

    Station keeping needs a valid position from a DVL or from the drone's own Blueye GNSS.
    Topside positioning (UGPS, USBL or NMEA input over UDP) is used for the map position but
    does not count here: those fixes jump between samples, and the drone would chase every
    jump. Without a valid position the drone drops the request and only logs it on
    its own side, so check `is_station_keeping_active()` afterwards. An active hold is released
    when the position has been invalid for 3 seconds.
    `PositionEstimateTel.position_estimate.navigation_sensors` lists each sensor with its
    validity.

    Args:
        enable (bool): Activate station keeping mode if true, de-activate if false.
    """
    self._parent_drone._ctrl_client.set_station_keeping_state(enable)

enable_weather_vaning

enable_weather_vaning(enable: bool)

Enable or disable the weather vaning control mode

When weather vaning is active, the drone will attempt to maintain its current position in the water and orient itself parallel to the current.

Weather vaning is station keeping with a free heading, so it has the same requirement: a valid position from a DVL or the drone's own Blueye GNSS, see enable_station_keeping. Enabling it also turns station keeping on, and turning station keeping off turns weather vaning off. An altitude reading is not needed.

Parameters:

  • enable (bool) –

    Activate weather vaning mode if true, de-activate if false.

Source code in blueye/sdk/motion.py
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
def enable_weather_vaning(self, enable: bool):
    """Enable or disable the weather vaning control mode

    When weather vaning is active, the drone will attempt to maintain its current position
    in the water and orient itself parallel to the current.

    Weather vaning is station keeping with a free heading, so it has the same requirement: a
    valid position from a DVL or the drone's own Blueye GNSS, see `enable_station_keeping`.
    Enabling it also turns station keeping on, and turning station keeping off turns weather
    vaning off. An altitude reading is not needed.

    Args:
        enable (bool): Activate weather vaning mode if true, de-activate if false.
    """
    self._parent_drone._ctrl_client.set_weather_vaning_state(enable)

get_boost

get_boost() -> float

Get the boost gain.

Returns:

  • float –

    The boost gain the SDK last sent, from 0 to 1.

Source code in blueye/sdk/motion.py
322
323
324
325
326
327
328
def get_boost(self) -> float:
    """Get the boost gain.

    Returns:
        The boost gain the SDK last sent, from 0 to 1.
    """
    return self._current_boost_setpoints["boost"]

get_current_thruster_setpoints

get_current_thruster_setpoints() -> Dict[str, float]

Get the setpoints the SDK last sent, per axis.

The SDK keeps them because every motion message carries all axes at once.

Returns:

  • Dict[str, float] –

    A dictionary with the surge, sway, heave, yaw, roll and pitch setpoints. Change them with the setters or send_thruster_setpoint, not through this dictionary.

Source code in blueye/sdk/motion.py
43
44
45
46
47
48
49
50
51
52
53
def get_current_thruster_setpoints(self) -> Dict[str, float]:
    """Get the setpoints the SDK last sent, per axis.

    The SDK keeps them because every motion message carries all axes at once.

    Returns:
        A dictionary with the surge, sway, heave, yaw, roll and pitch setpoints. Change them
        with the setters or `send_thruster_setpoint`, not through this dictionary.
    """

    return self._current_thruster_setpoints

get_heave

get_heave() -> float

Get the force reference for the heave direction

Returns:

  • float –

    Force set point in the heave direction in range <-1, 1>.

Source code in blueye/sdk/motion.py
132
133
134
135
136
137
138
def get_heave(self) -> float:
    """Get the force reference for the heave direction

    Returns:
        Force set point in the heave direction in range <-1, 1>.
    """
    return self._current_thruster_setpoints["heave"]

get_pitch

get_pitch() -> float

Get the moment reference for the pitch direction

Only the Blueye X7 acts on pitch input, see set_pitch.

Returns:

  • float –

    Moment set point in the pitch direction in range <-1, 1>.

Source code in blueye/sdk/motion.py
212
213
214
215
216
217
218
219
220
def get_pitch(self) -> float:
    """Get the moment reference for the pitch direction

    Only the Blueye X7 acts on pitch input, see `set_pitch`.

    Returns:
        Moment set point in the pitch direction in range <-1, 1>.
    """
    return self._current_thruster_setpoints["pitch"]

get_roll

get_roll() -> float

Get the moment reference for the roll direction

Only the Blueye X7 acts on roll input, see set_roll.

Returns:

  • float –

    Moment set point in the roll direction in range <-1, 1>.

Source code in blueye/sdk/motion.py
174
175
176
177
178
179
180
181
182
def get_roll(self) -> float:
    """Get the moment reference for the roll direction

    Only the Blueye X7 acts on roll input, see `set_roll`.

    Returns:
        Moment set point in the roll direction in range <-1, 1>.
    """
    return self._current_thruster_setpoints["roll"]

get_slow

get_slow() -> float

Get the slow gain.

Returns:

  • float –

    The slow gain the SDK last sent, from 0 to 1.

Source code in blueye/sdk/motion.py
347
348
349
350
351
352
353
def get_slow(self) -> float:
    """Get the slow gain.

    Returns:
        The slow gain the SDK last sent, from 0 to 1.
    """
    return self._current_boost_setpoints["slow"]

get_surge

get_surge() -> float

Get the force reference for the surge direction

Returns:

  • float –

    Force set point in the surge direction in range <-1, 1>.

Source code in blueye/sdk/motion.py
90
91
92
93
94
95
96
def get_surge(self) -> float:
    """Get the force reference for the surge direction

    Returns:
        Force set point in the surge direction in range <-1, 1>.
    """
    return self._current_thruster_setpoints["surge"]

get_sway

get_sway() -> float

Get the force reference for the sway direction

Returns:

  • float –

    Force set point in the sway direction in range <-1, 1>.

Source code in blueye/sdk/motion.py
111
112
113
114
115
116
117
def get_sway(self) -> float:
    """Get the force reference for the sway direction

    Returns:
        Force set point in the sway direction in range <-1, 1>.
    """
    return self._current_thruster_setpoints["sway"]

get_yaw

get_yaw() -> float

Get the moment reference for the yaw direction

Returns:

  • float –

    Moment set point in the yaw direction in range <-1, 1>.

Source code in blueye/sdk/motion.py
153
154
155
156
157
158
159
def get_yaw(self) -> float:
    """Get the moment reference for the yaw direction

    Returns:
        Moment set point in the yaw direction in range <-1, 1>.
    """
    return self._current_thruster_setpoints["yaw"]

is_auto_altitude_active

is_auto_altitude_active() -> Optional[bool]

Get the state of the auto altitude control mode

When auto altitude is active, the drone will attempt to maintain its current altitude above the seabed. Heave input (set_heave or send_thruster_setpoint) specifies a speed set point instead of a force set point. A control loop on the drone will then attempt to maintain the wanted speed in the heave direction as long as auto altitude is active.

Returns:

  • Optional[bool] –

    Auto altitude state (bool): True if auto altitude is active, false if not. None if no telemetry message has been received.

Source code in blueye/sdk/motion.py
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
def is_auto_altitude_active(self) -> Optional[bool]:
    """Get the state of the auto altitude control mode

    When auto altitude is active, the drone will attempt to maintain its current altitude above
    the seabed. Heave input (`set_heave` or `send_thruster_setpoint`) specifies a
    speed set point instead of a force set point. A control loop on the drone will then attempt
    to maintain the wanted speed in the heave direction as long as auto altitude is active.

    Returns:
        Auto altitude state (bool): True if auto altitude is active, false if not. None if no
        telemetry message has been received.
    """
    control_mode_tel = self._parent_drone.telemetry.get(blueye.protocol.ControlModeTel)
    if control_mode_tel is None:
        return None
    else:
        return control_mode_tel.state.auto_altitude

is_auto_depth_active

is_auto_depth_active() -> Optional[bool]

Get the state of the auto depth control mode

When auto depth is active, heave input (set_heave or send_thruster_setpoint) specifies a speed set point instead of a force set point. A control loop on the drone will then attempt to maintain the wanted speed in the heave direction as long as auto depth is active.

Returns:

  • Optional[bool] –

    Auto depth state (bool): True if auto depth is active, false if not. None if no telemetry message has been received.

Source code in blueye/sdk/motion.py
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
def is_auto_depth_active(self) -> Optional[bool]:
    """Get the state of the auto depth control mode

    When auto depth is active, heave input (`set_heave` or `send_thruster_setpoint`)
    specifies a speed set point instead of a force set point. A control loop on the drone will
    then attempt to maintain the wanted speed in the heave direction as long as auto depth is
    active.

    Returns:
        Auto depth state (bool): True if auto depth is active, false if not. None if no
        telemetry message has been received.
    """
    control_mode_tel = self._parent_drone.telemetry.get(blueye.protocol.ControlModeTel)
    if control_mode_tel is None:
        return None
    else:
        return control_mode_tel.state.auto_depth

is_auto_heading_active

is_auto_heading_active() -> Optional[bool]

Get the state of the auto heading control mode

When auto heading is active, yaw input (set_yaw or send_thruster_setpoint) specifies an angular speed set point instead of a moment set point. A control loop on the drone will then attempt to maintain the wanted angular velocity in the yaw direction as long as auto heading is active.

Returns:

  • Optional[bool] –

    Auto heading state (bool): True if auto heading mode is active, false if not. None if no telemetry message has been received.

Source code in blueye/sdk/motion.py
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
def is_auto_heading_active(self) -> Optional[bool]:
    """Get the state of the auto heading control mode

    When auto heading is active, yaw input (`set_yaw` or `send_thruster_setpoint`)
    specifies an angular speed set point instead of a moment set point. A control loop on the
    drone will then attempt to maintain the wanted angular velocity in the yaw direction as
    long as auto heading is active.

    Returns:
        Auto heading state (bool): True if auto heading mode is active, false if not. None if no
        telemetry message has been received.
    """
    control_mode_tel = self._parent_drone.telemetry.get(blueye.protocol.ControlModeTel)
    if control_mode_tel is None:
        return None
    else:
        return control_mode_tel.state.auto_heading

is_station_keeping_active

is_station_keeping_active() -> Optional[bool]

Get the state of the station keeping control mode

When station keeping is active, the drone will attempt to maintain its current position and orientation in the water as long as the mode is active.

Returns:

  • Optional[bool] –

    Station keeping state (bool): True if station keeping mode is active, false if not. None if no telemetry message has been received.

Source code in blueye/sdk/motion.py
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
def is_station_keeping_active(self) -> Optional[bool]:
    """Get the state of the station keeping control mode

    When station keeping is active, the drone will attempt to maintain its current position
    and orientation in the water as long as the mode is active.

    Returns:
        Station keeping state (bool): True if station keeping mode is active, false if not. None
        if no telemetry message has been received.
    """
    control_mode_tel = self._parent_drone.telemetry.get(blueye.protocol.ControlModeTel)
    if control_mode_tel is None:
        return None
    else:
        return control_mode_tel.state.station_keeping

is_weather_vaning_active

is_weather_vaning_active() -> Optional[bool]

Get the state of the weather vaning control mode

When weather vaning is active, the drone will attempt to maintain its current position in the water and orient itself parallel to the current.

Returns:

  • Optional[bool] –

    Weather vaning state (bool): True if weather vaning mode is active, false if not. None if no telemetry message has been received.

Source code in blueye/sdk/motion.py
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
def is_weather_vaning_active(self) -> Optional[bool]:
    """Get the state of the weather vaning control mode

    When weather vaning is active, the drone will attempt to maintain its current position
    in the water and orient itself parallel to the current.

    Returns:
        Weather vaning state (bool): True if weather vaning mode is active, false if not. None
        if no telemetry message has been received.
    """
    control_mode_tel = self._parent_drone.telemetry.get(blueye.protocol.ControlModeTel)
    if control_mode_tel is None:
        return None
    else:
        return control_mode_tel.state.weather_vaning

send_thruster_setpoint

send_thruster_setpoint(
    surge, sway, heave, yaw, *, roll=0.0, pitch=0.0
)

Set the setpoint of every axis in one message.

Each setpoint is between -1 and 1 and scales the force (or, for yaw, roll and pitch, the moment) linearly. A setpoint of 1 or -1 is full stick, whose force depends on set_boost and set_slow, not the most the thrusters can give.

Roll and pitch are keyword-only and default to 0, so a call that leaves them out clears any roll or pitch set earlier. Only the Blueye X7 acts on them, and with auto heading off they are open-loop moments that nothing on the drone limits. See set_roll and set_pitch for how auto heading changes their meaning and why the autopilot ignores them.

Parameters:

  • surge (float) –

    Force set point in the surge direction in range <-1, 1>, a positive set point makes the drone move forward.

  • sway (float) –

    Force set point in the sway direction in range <-1, 1>, a positive set point makes the drone move to the right.

  • heave (float) –

    Force set point in the heave direction in range <-1, 1>, a positive set point makes the drone move down.

  • yaw (float) –

    Moment set point in the yaw direction in range <-1, 1>, a positive set point makes the drone rotate clockwise.

  • roll (float, default: 0.0 ) –

    Moment set point in the roll direction in range <-1, 1>, a positive set point rolls the drone to the right. X7 only.

  • pitch (float, default: 0.0 ) –

    Moment set point in the pitch direction in range <-1, 1>, a positive set point pitches the nose of the drone up. X7 only.

Source code in blueye/sdk/motion.py
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
def send_thruster_setpoint(self, surge, sway, heave, yaw, *, roll=0.0, pitch=0.0):
    """Set the setpoint of every axis in one message.

    Each setpoint is between -1 and 1 and scales the force (or, for yaw, roll and pitch, the
    moment) linearly. A setpoint of 1 or -1 is full stick, whose force depends on
    [`set_boost`][blueye.sdk.motion.Motion.set_boost] and
    [`set_slow`][blueye.sdk.motion.Motion.set_slow], not the most the thrusters can give.

    Roll and pitch are keyword-only and default to 0, so a call that leaves them out clears any
    roll or pitch set earlier. Only the Blueye X7 acts on them, and with auto heading off they
    are open-loop moments that nothing on the drone limits. See `set_roll` and `set_pitch` for
    how auto heading changes their meaning and why the autopilot ignores them.

    Args:
        surge (float): Force set point in the surge direction in range <-1, 1>,
                       a positive set point makes the drone move forward.
        sway (float): Force set point in the sway direction in range <-1, 1>,
                      a positive set point makes the drone move to the right.
        heave (float): Force set point in the heave direction in range <-1, 1>,
                       a positive set point makes the drone move down.
        yaw (float): Moment set point in the yaw direction in range <-1, 1>,
                     a positive set point makes the drone rotate clockwise.
        roll (float): Moment set point in the roll direction in range <-1, 1>,
                      a positive set point rolls the drone to the right. X7 only.
        pitch (float): Moment set point in the pitch direction in range <-1, 1>,
                       a positive set point pitches the nose of the drone up. X7 only.
    """
    with self.thruster_lock:
        self._current_thruster_setpoints["surge"] = surge
        self._current_thruster_setpoints["sway"] = sway
        self._current_thruster_setpoints["heave"] = heave
        self._current_thruster_setpoints["yaw"] = yaw
        self._current_thruster_setpoints["roll"] = roll
        self._current_thruster_setpoints["pitch"] = pitch
        self._send_motion_input_message()

set_boost

set_boost(boost_gain: float)

Set the boost gain.

Boost raises the force a full-stick setpoint asks for, up to the drone's boosted level at 1. Values up to 0.1 count as 0 and 0.1 to 1 is stretched over the whole range, so 0.55 is halfway. The drone uses boost minus slow after that, so boost and slow at 1 together give the normal level.

Parameters:

  • boost_gain (float) –

    Range from 0 to 1.

Source code in blueye/sdk/motion.py
330
331
332
333
334
335
336
337
338
339
340
341
342
343
def set_boost(self, boost_gain: float):
    """Set the boost gain.

    Boost raises the force a full-stick setpoint asks for, up to the drone's boosted level at
    1. Values up to 0.1 count as 0 and 0.1 to 1 is stretched over the whole range, so 0.55 is
    halfway. The drone uses boost minus slow after that, so boost and slow at 1 together give
    the normal level.

    Args:
        boost_gain (float): Range from 0 to 1.
    """
    with self.thruster_lock:
        self._current_boost_setpoints["boost"] = boost_gain
        self._send_motion_input_message()

set_heave

set_heave(heave_value: float)

Set force reference for the heave direction

Parameters:

  • heave_value (float) –

    Force set point in the heave direction in range <-1, 1>, a positive set point makes the drone move downwards.

Source code in blueye/sdk/motion.py
140
141
142
143
144
145
146
147
148
149
def set_heave(self, heave_value: float):
    """Set force reference for the heave direction

    Args:
        heave_value (float): Force set point in the heave direction in range <-1, 1>,
                             a positive set point makes the drone move downwards.
    """
    with self.thruster_lock:
        self._current_thruster_setpoints["heave"] = heave_value
        self._send_motion_input_message()

set_pitch

set_pitch(pitch_value: float)

Set moment reference for the pitch direction

Only the Blueye X7 has thrusters that can produce a pitch moment. Other models ignore this input.

With auto heading off the value is an open-loop moment set point, like yaw, and nothing on the drone limits the resulting angle. The drone settles where the thruster moment is balanced by its righting moment, and a large input held for a few seconds can tip it over. The drone keeps acting on the last setpoint for as long as the SDK is connected, so set it back to 0 when the manoeuvre is done.

With auto heading on the drone instead holds a pitch angle. The value is then an angular speed set point for that angle, which is bounded to 45 degrees either side of level, and the drone keeps the angle it has reached when the input returns to 0. Engaging auto heading resets the held roll and pitch angles to level.

While the autopilot is running a mission the drone holds level and ignores pitch input. Starting the autopilot also switches auto heading off.

Parameters:

  • pitch_value (float) –

    Moment set point in the pitch direction in range <-1, 1>, a positive set point pitches the nose of the drone up.

Source code in blueye/sdk/motion.py
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
def set_pitch(self, pitch_value: float):
    """Set moment reference for the pitch direction

    Only the Blueye X7 has thrusters that can produce a pitch moment. Other models ignore this
    input.

    With auto heading off the value is an open-loop moment set point, like yaw, and nothing on
    the drone limits the resulting angle. The drone settles where the thruster moment is
    balanced by its righting moment, and a large input held for a few seconds can tip it over.
    The drone keeps acting on the last setpoint for as long as the SDK is connected, so set it
    back to 0 when the manoeuvre is done.

    With auto heading on the drone instead holds a pitch angle. The value is then an angular
    speed set point for that angle, which is bounded to 45 degrees either side of level, and
    the drone keeps the angle it has reached when the input returns to 0. Engaging auto heading
    resets the held roll and pitch angles to level.

    While the autopilot is running a mission the drone holds level and ignores pitch input.
    Starting the autopilot also switches auto heading off.

    Args:
        pitch_value (float): Moment set point in the pitch direction in range <-1, 1>,
                             a positive set point pitches the nose of the drone up.
    """
    with self.thruster_lock:
        self._current_thruster_setpoints["pitch"] = pitch_value
        self._send_motion_input_message()

set_roll

set_roll(roll_value: float)

Set moment reference for the roll direction

Only the Blueye X7 has thrusters that can produce a roll moment. Other models ignore this input.

With auto heading off the value is an open-loop moment set point, like yaw, and nothing on the drone limits the resulting angle. The drone settles where the thruster moment is balanced by its righting moment, and a large input held for a few seconds can roll it over. The drone keeps acting on the last setpoint for as long as the SDK is connected, so set it back to 0 when the manoeuvre is done.

With auto heading on the drone instead holds a roll angle. The value is then an angular speed set point for that angle, which is bounded to 45 degrees either side of level, and the drone keeps the angle it has reached when the input returns to 0. Engaging auto heading resets the held roll and pitch angles to level.

While the autopilot is running a mission the drone holds level and ignores roll input. Starting the autopilot also switches auto heading off.

Parameters:

  • roll_value (float) –

    Moment set point in the roll direction in range <-1, 1>, a positive set point rolls the drone to the right.

Source code in blueye/sdk/motion.py
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
def set_roll(self, roll_value: float):
    """Set moment reference for the roll direction

    Only the Blueye X7 has thrusters that can produce a roll moment. Other models ignore this
    input.

    With auto heading off the value is an open-loop moment set point, like yaw, and nothing on
    the drone limits the resulting angle. The drone settles where the thruster moment is
    balanced by its righting moment, and a large input held for a few seconds can roll it over.
    The drone keeps acting on the last setpoint for as long as the SDK is connected, so set it
    back to 0 when the manoeuvre is done.

    With auto heading on the drone instead holds a roll angle. The value is then an angular
    speed set point for that angle, which is bounded to 45 degrees either side of level, and
    the drone keeps the angle it has reached when the input returns to 0. Engaging auto heading
    resets the held roll and pitch angles to level.

    While the autopilot is running a mission the drone holds level and ignores roll input.
    Starting the autopilot also switches auto heading off.

    Args:
        roll_value (float): Moment set point in the roll direction in range <-1, 1>,
                            a positive set point rolls the drone to the right.
    """
    with self.thruster_lock:
        self._current_thruster_setpoints["roll"] = roll_value
        self._send_motion_input_message()

set_slow

set_slow(slow_gain: float)

Set the slow gain.

Slow lowers the force a full-stick setpoint asks for, down to the drone's slow level at 1, for fine positioning. Values up to 0.1 count as 0, and the drone uses boost minus slow, see set_boost.

Parameters:

  • slow_gain (float) –

    Range from 0 to 1.

Source code in blueye/sdk/motion.py
355
356
357
358
359
360
361
362
363
364
365
366
367
def set_slow(self, slow_gain: float):
    """Set the slow gain.

    Slow lowers the force a full-stick setpoint asks for, down to the drone's slow level at 1,
    for fine positioning. Values up to 0.1 count as 0, and the drone uses boost minus slow,
    see [`set_boost`][blueye.sdk.motion.Motion.set_boost].

    Args:
        slow_gain (float): Range from 0 to 1.
    """
    with self.thruster_lock:
        self._current_boost_setpoints["slow"] = slow_gain
        self._send_motion_input_message()

set_surge

set_surge(surge_value: float)

Set force reference for the surge direction

Parameters:

  • surge_value (float) –

    Force set point in the surge direction in range <-1, 1>, a positive set point makes the drone move forward.

Source code in blueye/sdk/motion.py
 98
 99
100
101
102
103
104
105
106
107
def set_surge(self, surge_value: float):
    """Set force reference for the surge direction

    Args:
        surge_value (float): Force set point in the surge direction in range <-1, 1>,
                             a positive set point makes the drone move forward.
    """
    with self.thruster_lock:
        self._current_thruster_setpoints["surge"] = surge_value
        self._send_motion_input_message()

set_sway

set_sway(sway_value: float)

Set force reference for the sway direction

Parameters:

  • sway_value (float) –

    Force set point in the sway direction in range <-1, 1>, a positive set point makes the drone move to the right.

Source code in blueye/sdk/motion.py
119
120
121
122
123
124
125
126
127
128
def set_sway(self, sway_value: float):
    """Set force reference for the sway direction

    Args:
        sway_value (float): Force set point in the sway direction in range <-1, 1>,
                            a positive set point makes the drone move to the right.
    """
    with self.thruster_lock:
        self._current_thruster_setpoints["sway"] = sway_value
        self._send_motion_input_message()

set_yaw

set_yaw(yaw_value: float)

Set moment reference for the yaw direction

Parameters:

  • yaw_value (float) –

    Moment set point in the yaw direction in range <-1, 1>, a positive set point makes the drone rotate clockwise.

Source code in blueye/sdk/motion.py
161
162
163
164
165
166
167
168
169
170
def set_yaw(self, yaw_value: float):
    """Set moment reference for the yaw direction

    Args:
        yaw_value (float): Moment set point in the yaw direction in range <-1, 1>,
                           a positive set point makes the drone rotate clockwise.
    """
    with self.thruster_lock:
        self._current_thruster_setpoints["yaw"] = yaw_value
        self._send_motion_input_message()

zero_setpoints

zero_setpoints()

Set every setpoint to zero and send it.

Covers surge, sway, heave, yaw, roll and pitch as well as slow and boost. The drone keeps the last motion input it received until a new one arrives or its watchdog times out, so this is what disconnect sends before letting go.

Source code in blueye/sdk/motion.py
250
251
252
253
254
255
256
257
258
def zero_setpoints(self):
    """Set every setpoint to zero and send it.

    Covers surge, sway, heave, yaw, roll and pitch as well as slow and boost. The drone keeps
    the last motion input it received until a new one arrives or its watchdog times out, so
    this is what [`disconnect`][blueye.sdk.drone.Drone.disconnect] sends before letting go.
    """
    with self.thruster_lock:
        self._zero_setpoints()