Skip to content

Commit

Permalink
Seemingly working hybridpath_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Mokaz committed Feb 28, 2024
1 parent 0f2ddc5 commit b04e90f
Show file tree
Hide file tree
Showing 7 changed files with 188 additions and 385 deletions.
25 changes: 25 additions & 0 deletions asv_setup/launch/hybridpath.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import os
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.actions import SetEnvironmentVariable, IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from ament_index_python.packages import get_package_share_directory

def generate_launch_description():
hybridpath_controller_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory('hybridpath_controller'), 'launch/hybridpath_controller.launch.py')
)
)

hybridpath_guidance_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory('hybridpath_guidance'), 'launch/hybridpath_guidance.launch.py')
)
)

# Return launch description
return LaunchDescription([
hybridpath_controller_launch,
hybridpath_guidance_launch
])
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/**:
ros__parameters:
hybridpath_controller:
kappa: 0.5
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
from hybridpath_controller.hybridpath import HybridPathGenerator, HybridPathSignals

class AdaptiveBackstep:
def __init__(self):
self.init_system()
def __init__(self, kappa):
self.init_system(kappa)

def init_system(self):
def init_system(self, kappa):

I = np.eye(3)

K_1 = np.diag([10, 10, 10])
kappa = 0.5
self.K_1_tilde = K_1 + kappa*I
self.K_2 = np.diag([60, 60, 30])
self.tau_max = np.array([41.0, 50.0, 55.0]) # Må tilpasses thrusterne
Expand Down Expand Up @@ -56,9 +55,6 @@ def control_law(self, eta, nu, w, v_ref, dt_v_ref, dtheta_v_ref, eta_d, dtheta_e
tau[0] = np.sign(tau[0]) * np.absolute(self.tau_max[2] / tau[2]) * np.absolute(tau[0])
tau[2] = np.sign(tau[2]) * self.tau_max[2]
return tau

def step(self, eta, nu, tau):
pass

def calculate_coriolis_matrix(self, nu):
# u = nu[0]
Expand Down
243 changes: 0 additions & 243 deletions motion/hybridpath_controller/hybridpath_controller/hybridpath.py

This file was deleted.

This file was deleted.

Loading

0 comments on commit b04e90f

Please sign in to comment.