Lights Helper

class bosdyn.client.spot_cam.lights_helper.LightsHelper(robot, frequency, brightness, logger=None)[source]

Bases: object

Context manager that flashes Spot CAM LEDs for the duration of the context.

Use as follows:

with LightsHelper(robot, frequency, brightness):
    # Lights will flash here
# Lights will stop flashing here.
Parameters:
  • robot – Robot object for creating clients

  • frequency – Desired frequency for a complete flash cycle in Hz.

  • brightness – Desired LED brightness [0, 1]

bosdyn.client.spot_cam.lights_helper.set_lights_with_freq_and_brightness(stop_event, lighting_client, frequency, brightness)[source]

Given the threading event, lighting client, desired light frequency and brightness, this helper will blink the Spot CAM lights until threading event is set to stop. This function must be used within a thread to prevent it from running forever.

Parameters:
  • stop_event (threading.Event()) – Threading event used for stopping and returning.

  • lighting_client (LightingClient) – Lighting client from bosdyn.client

  • frequency (float) – Desired frequency (Hz) for flashing the Spot CAM lights

  • brightness (float) – Desired brightness [0, 1] for the Spot CAM lights