Autonomous Flight: How to Program Your Quadcopter¶
This guide introduces the core framework features designed for programming autonomous quadcopter flight. Use these functions, whether you are developing custom control algorithms or building complex mission profiles.
Below is a quick reference to the framework’s capabilities, organized by module.
Flight Control¶
arm()/disarm()— Motors start/stopland()— Auto-landis_armed()/flight_mode()— Status checknavigate_wait(frame_id, x, y, z, speed, yaw)— Targeted flight (blocking)navigate(...)— Targeted flight (non-blocking)
Camera¶
get_image(camera_name, encoding)— Retrieves a camera frame converted into a NumPy arrayget_image_msg(camera_name)— Retrieves the raw ROS Image messageget_camera_info(camera_name)— Retrieves essential calibration data
LED Strip¶
rainbow(period, brightness, duration)— Triggers a continuous rainbow animationblink(r, g, b, period, brightness, duration)— Makes the LEDs flash a specific colorsolid_color(r, g, b, brightness, duration)— Sets the LEDs to a single, steady colorclear()— Turns off the LED stripfill(r, g, b)— Fills the entire LED strip with a chosen colorsend_frame(colors, brightness)— Provides granular control (each individual LED with custom pattern)led_count— Displays the number of LEDs available in your strip
Display¶
display()— Initializes and returns the display client instancesend_image(image)— Transmits a standard ROSsensor_msgs.msg.Imagemessagesend_cv_image(image, encoding)— Transmits an image using OpenCV format or a NumPy arraywidth/height— Defines the resolution of the output framemax_fps— Sets the maximum frames per second for the streamsupported_encodings— A list of all compatible image encodings supported by the client