Skip to content

Commit

Permalink
🎨 improve formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Rezenders committed Mar 21, 2024
1 parent dc1a97d commit 442bc2e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 26 deletions.
1 change: 0 additions & 1 deletion suave/suave/recover_thrusters_lc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from rclpy.executors import MultiThreadedExecutor
from rclpy.lifecycle import Node
from rclpy.lifecycle import Publisher
from rclpy.lifecycle import State
from rclpy.lifecycle import TransitionCallbackReturn

Expand Down
2 changes: 0 additions & 2 deletions suave_missions/launch/const_distance_mission.launch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
Expand Down
15 changes: 0 additions & 15 deletions suave_missions/launch/mission_bringup.launch.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
import os

from ament_index_python.packages import get_package_share_directory

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import IncludeLaunchDescription
from launch.conditions import LaunchConfigurationEquals
from launch.conditions import LaunchConfigurationNotEquals
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


def generate_launch_description():
adaptation_manager = LaunchConfiguration('adaptation_manager')
mission_type = LaunchConfiguration('mission_type')

adaptation_manager_arg = DeclareLaunchArgument(
'adaptation_manager',
Expand All @@ -30,7 +18,4 @@ def generate_launch_description():
return LaunchDescription([
adaptation_manager_arg,
mission_type_arg,
mission_node,
metacontrol_launch,
suave_launch,
])
4 changes: 1 addition & 3 deletions suave_missions/launch/time_constrained_mission.launch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
Expand Down Expand Up @@ -54,4 +52,4 @@ def generate_launch_description():
result_filename_arg,
time_limit_arg,
mission_node,
])
])
10 changes: 5 additions & 5 deletions suave_missions/suave_missions/inspection_mission.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
from std_srvs.srv import Empty


import rclpy

from suave_missions.mission_planner import MissionPlanner

from diagnostic_msgs.msg import DiagnosticArray


class InspectionMission(MissionPlanner):
def __init__(self, node_name='inspection_mission'):
super().__init__(node_name)
Expand Down Expand Up @@ -45,7 +44,7 @@ def __init__(self, node_name='inspection_mission'):
CommandBool, 'mavros/cmd/arming')
self.set_mode_service = self.create_client(
SetMode, 'mavros/set_mode')

self.battery_sub = self.create_subscription(
DiagnosticArray,
'diagnostics',
Expand Down Expand Up @@ -79,7 +78,7 @@ def perform_mission(self):

self.perform_task('search_pipeline', lambda: self.pipeline_detected)
self.perform_task('inspect_pipeline', lambda: self.pipeline_inspected)

def battery_level_cb(self, msg):
battery_constraint_arg = self.get_parameter('battery_constraint').value
if battery_constraint_arg is True:
Expand All @@ -94,7 +93,8 @@ def battery_level_cb(self, msg):
"Low battery! Mission abort.")
self.abort_mission = True
self.call_service(
self.save_mission_results_cli, Empty.Request()
self.save_mission_results_cli,
Empty.Request()
)
self.destroy_subscription(self.battery_sub)
break
Expand Down

0 comments on commit 442bc2e

Please sign in to comment.