Documentation Index
Fetch the complete documentation index at: https://docs.generalrobotics.dev/llms.txt
Use this file to discover all available pages before exploring further.
MavlinkClient
Inherits from: object
No class docstring.
init
MavlinkClient.__init__(ground_control_station_ip: str, mavlink_port: str, vehicle_ip: str, communication_protocol: str, arm_enable: bool, dry_run: bool, checks_poststart: Optional[List[callable]] = None, checks_preflight: Optional[List[callable]] = None, checks_postarm: Optional[List[callable]] = None, messages_known: Optional[List[str]] = None, messages_required: Optional[List[str]] = None, offboard_control_mode_int: int = None)
Instantiates a Mavlink client for message passing and command sending with a drone,
including optional preflight/poststart checks.
ground_control_station_ip (str)
IP address of the ground control station
Port number for MAVLink connection
IP address of the drone/vehicle
communication_protocol (str)
Communication protocol, e.g., ‘udp’ or ‘tcp’
Whether arming is enabled
If True, bypasses arming exceptions
checks_poststart (Optional[List[callable]])
A list of functions to run after the client has started.
checks_preflight (Optional[List[callable]])
A list of functions to run before flight to validate system state.
checks_postarm (Optional[List[callable]])
A list of functions to run immediately after arming to validate system state.
messages_known (Optional[List[str]])
List of MAVLink message types expected (default: None)
messages_required (Optional[List[str]])
List of MAVLink message types required before proceeding (default: None)
offboard_control_mode_int (int)
Custom offboard control mode value. (default: 6)
run_checks
MavlinkClient.run_checks(checks: List[callable])
Runs a list of check functions.
A list of functions that accept the client instance and return a boolean.
get_msg
MavlinkClient.get_msg(msg_type: str)
Thread-safe retrieval of a message from the internal dictionary.
The name of the message type to retrieve.
update_setpoint
MavlinkClient.update_setpoint(controls, **kwargs)
Updates the current setpoint and control parameters.
List of control fields to update.
Values for parameters (e.g., lat, lon, alt, vx, vy, yaw, etc.)
attempt_command
MavlinkClient.attempt_command(command_name: str, command_id: int, params: List[Any], confirmation: int = 0, max_attempts: int = 3, retry_delay: float = 1.0) -> bool
Attempts to execute a command with retry logic.
Command description for logging.
List of 7 parameters for the command.
0 for initial transmission, 1-255 for confirmations.
True if the command is acknowledged successfully; False otherwise.
set_custom_msg_rates
MavlinkClient.set_custom_msg_rates(msg_id: int, interval_us: int)
Sets custom message publishing rates for a given MAVLink message.
The interval in microseconds between messages.
True if successful, False otherwise.
request_msg
MavlinkClient.request_msg(msg_id: int)
Requests a specific MAVLink message from the drone.
True if the request was successful, False otherwise.
reset_ned_origin
MavlinkClient.reset_ned_origin() -> bool
Resets the MAVLink NED origin using the current position.
True if the origin was reset successfully, False otherwise.
arm
Arms the drone (if permitted).
True if the drone was successfully armed, False otherwise.
disarm
Disarms the drone.
True if disarm was successful, False otherwise.
set_offboard_control
MavlinkClient.set_offboard_control()
Sets the drone’s control mode to OFFBOARD, enabling external setpoint control.
True if offboard control was successfully set, False otherwise.
start
Starts the drone client by resetting NED origin, arming, and setting offboard control.
terminate
MavlinkClient.terminate()
Terminates the client and shuts down all threads.