The px4_ros2 module¶
Python bindings for px4_ros2_cpp.
Main Classes¶
- class px4_ros2.Node¶
- __init__(self: px4_ros2.px4_ros2_py.Node, node_name: str, debug_output: bool = False) None¶
- spin(self: px4_ros2.px4_ros2_py.Node) None¶
Execute the node (blocking)
- spin_non_blocking(self: px4_ros2.px4_ros2_py.Node) None¶
Execute the node (non-blocking in a background thread)
Components¶
- class px4_ros2.px4_ros2_py.components.ModeBase¶
- __init__(self: px4_ros2.px4_ros2_py.components.ModeBase, node: px4_ros2.px4_ros2_py.Node, mode_name: str, activate_even_while_disarmed: bool = False, replace_internal_mode: int = 255, prevent_arming: bool = False, user_selectable: bool = True) None¶
- completed(self: px4_ros2.px4_ros2_py.components.ModeBase, result: px4_ros2.px4_ros2_py.components.Result = <Result.success: 0>) None¶
- id(self: px4_ros2.px4_ros2_py.components.ModeBase) int¶
- on_activate(self: px4_ros2.px4_ros2_py.components.ModeBase) None¶
- on_deactivate(self: px4_ros2.px4_ros2_py.components.ModeBase) None¶
- register(self: px4_ros2.px4_ros2_py.components.ModeBase) bool¶
- update_setpoint(self: px4_ros2.px4_ros2_py.components.ModeBase, arg0: float) None¶
- class px4_ros2.px4_ros2_py.components.ModeExecutorBase¶
- __init__(self: px4_ros2.px4_ros2_py.components.ModeExecutorBase, mode: px4_ros2.px4_ros2_py.components.ModeBase) None¶
- land(self: px4_ros2.px4_ros2_py.components.ModeExecutorBase, arg0: Callable[[px4_ros2.px4_ros2_py.components.Result], None]) None¶
- on_activate(self: px4_ros2.px4_ros2_py.components.ModeExecutorBase) None¶
- on_deactivate(self: px4_ros2.px4_ros2_py.components.ModeExecutorBase, arg0: px4_ros2.px4_ros2_py.components.ModeExecutorDeactivateReason) None¶
- register(self: px4_ros2.px4_ros2_py.components.ModeExecutorBase) bool¶
- rtl(self: px4_ros2.px4_ros2_py.components.ModeExecutorBase, arg0: Callable[[px4_ros2.px4_ros2_py.components.Result], None]) None¶
- schedule_mode(self: px4_ros2.px4_ros2_py.components.ModeExecutorBase, mode_id: int, on_completed: Callable[[px4_ros2.px4_ros2_py.components.Result], None], forced: bool = False) None¶
- takeoff(self: px4_ros2.px4_ros2_py.components.ModeExecutorBase, on_completed: Callable[[px4_ros2.px4_ros2_py.components.Result], None], altitude: float = nan, heading: float = nan) None¶
- class px4_ros2.px4_ros2_py.components.ModeExecutorDeactivateReason¶
Members:
failsafe_activated
other
- __init__(self: px4_ros2.px4_ros2_py.components.ModeExecutorDeactivateReason, value: int) None¶
- failsafe_activated = <ModeExecutorDeactivateReason.failsafe_activated: 0>¶
- property name¶
- other = <ModeExecutorDeactivateReason.other: 1>¶
- property value¶
- class px4_ros2.px4_ros2_py.components.Result¶
Members:
deactivated
interrupted
mode_failure_other
rejected
success
timeout
- __init__(self: px4_ros2.px4_ros2_py.components.Result, value: int) None¶
- deactivated = <Result.deactivated: 4>¶
- interrupted = <Result.interrupted: 2>¶
- mode_failure_other = <Result.mode_failure_other: 100>¶
- property name¶
- rejected = <Result.rejected: 1>¶
- success = <Result.success: 0>¶
- timeout = <Result.timeout: 3>¶
- property value¶
Control¶
- class px4_ros2.px4_ros2_py.control.MulticopterGotoSetpointType¶
- __init__(self: px4_ros2.px4_ros2_py.control.MulticopterGotoSetpointType, context: px4_ros2.px4_ros2_py.components.Context) None¶
Geometry¶
- px4_ros2.px4_ros2_py.geometry.euler_rpy_to_quaternion(roll: float, pitch: float, yaw: float) tuple¶
Convert Euler angles (roll, pitch, yaw) to quaternion (w, x, y, z)
- px4_ros2.px4_ros2_py.geometry.quaternion_to_euler_rpy(quaternion: tuple) tuple¶
Convert quaternion (w, x, y, z) to Euler angles (roll, pitch, yaw) as a tuple
- px4_ros2.px4_ros2_py.geometry.quaternion_to_pitch(quaternion: tuple) float¶
Extract pitch angle from quaternion (w, x, y, z)
- px4_ros2.px4_ros2_py.geometry.quaternion_to_roll(quaternion: tuple) float¶
Extract roll angle from quaternion (w, x, y, z)
Odometry¶
- class px4_ros2.px4_ros2_py.odometry.LocalPosition¶
- __init__(self: px4_ros2.px4_ros2_py.odometry.LocalPosition, context: px4_ros2.px4_ros2_py.components.Context, local_position_is_optional: bool = False) None¶
- on_update(self: px4_ros2.px4_ros2_py.odometry.LocalPosition, arg0: Callable[[], None]) None¶
- position_ned(self: px4_ros2.px4_ros2_py.odometry.LocalPosition) numpy.ndarray[numpy.float32[3, 1]]¶
- position_xy_valid(self: px4_ros2.px4_ros2_py.odometry.LocalPosition) bool¶
- position_z_valid(self: px4_ros2.px4_ros2_py.odometry.LocalPosition) bool¶