Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 25, 2025
1 parent b5a956f commit 35b8287
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 11 additions & 8 deletions src/surface/flight_control/flight_control/manual_control_node.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from dataclasses import dataclass
from enum import IntEnum
from typing import TYPE_CHECKING
from dataclasses import dataclass

import rclpy
from mavros_msgs.srv import CommandBool
Expand Down Expand Up @@ -55,35 +55,38 @@ class ControllerMode(IntEnum):
ARM = 0
TOGGLE_CAMERAS = 1


@dataclass
class ControllerProfile:
manip_left: int = O_BUTTON
manip_right: int = X_BUTTON
valve_clockwise: int = TRI_BUTTON
valve_counterclockwise: int = SQUARE_BUTTON
roll_left: int = L1 # positive roll
roll_right: int = R1 # negative roll
roll_left: int = L1 # positive roll
roll_right: int = R1 # negative roll
cam_toggle_left: int = PAIRING_BUTTON
cam_toggle_right: int = MENU
arm_button: int = MENU
disarm_button: int = PAIRING_BUTTON
lateral: int = LJOYX
forward: int = LJOYY
vertical_down: int = L2PRESS_PERCENT # negative vertical value
vertical_up: int = R2PRESS_PERCENT # positive vertical value
vertical_down: int = L2PRESS_PERCENT # negative vertical value
vertical_up: int = R2PRESS_PERCENT # positive vertical value
yaw: int = RJOYX
pitch: int = RJOYY


CONTROLLER_PROFILES = [
ControllerProfile(),
ControllerProfile(
manip_left=L1,
manip_right=R1,
roll_left=X_BUTTON,
manip_left=L1,
manip_right=R1,
roll_left=X_BUTTON,
roll_right=O_BUTTON,
),
]


class ManualControlNode(Node):
def __init__(self) -> None:
super().__init__('manual_control_node')
Expand Down
2 changes: 1 addition & 1 deletion src/surface/flight_control/launch/flight_control_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def generate_launch_description() -> LaunchDescription:
executable='manual_control_node',
parameters=[
{'controller_mode': LaunchConfiguration('controller_mode', default=0)},
{'controller_profile': LaunchConfiguration('controller_profile', default=0)}
{'controller_profile': LaunchConfiguration('controller_profile', default=0)},
],
remappings=[
('/surface/manipulator_control', '/tether/manipulator_control'),
Expand Down

0 comments on commit 35b8287

Please sign in to comment.