Skip to content

Commit

Permalink
Corrected pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Aldokan committed Oct 8, 2023
1 parent 9decedb commit 49795b0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 26 deletions.
2 changes: 1 addition & 1 deletion asv_setup/launch/pc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ launch:
to: "/joystick/joy"

- include:
file: "vortex-asv/mission/joystick_interface/launch/joystick_interface_launch.yaml"
file: "src/vortex-asv/mission/joystick_interface/launch/joystick_interface_launch.yaml"
9 changes: 0 additions & 9 deletions mission/joystick_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,22 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
#find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)

# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
find_package(rclpy REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)

#ament_python_install_package("joystick_interface")
ament_python_install_package(${PROJECT_NAME})

install(PROGRAMS
joystick_interface/joystick_interface.py
DESTINATION lib/${PROJECT_NAME}
)


if(BUILD_TESTING)
find_package(ament_cmake_pytest REQUIRED)
set(_pytest_tests
joystick_interface/test/test_joystick_interface.py
# Add other test files here
)
foreach(_test_path ${_pytest_tests})
get_filename_component(_test_name ${_test_path} NAME_WE)
Expand Down
2 changes: 2 additions & 0 deletions mission/joystick_interface/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
In the launch files we need to make it able to find the yaml files without having an explicit path such as this: "src/vortex-asv/mission/joystick_interface/launch/joystick_interface_launch.yaml"
Perhaps change to python launch
8 changes: 4 additions & 4 deletions mission/joystick_interface/config/params.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/joystick_interface:
joystick_interface:
ros__parameters:
surge: 50.0
sway: 50.0
yaw: 50.0
surge_scale_factor: 50.0
sway_scale_factor: 50.0
yaw_scale_factor: 50.0


22 changes: 11 additions & 11 deletions mission/joystick_interface/joystick_interface/joystick_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,36 +47,36 @@ def __init__(self):
"dpad_vertical",
]

self.joy_subscriber = self.create_subscription(Joy, "/joystick/joy",
self.joy_subscriber = self.create_subscription(Joy, "joystick/joy",
self.joystick_cb, 1)
self.wrench_publisher = self.create_publisher(Wrench,
"/thrust/wrench_input",
"thrust/wrench_input",
1)

self.declare_parameter('surge', 100.0)
self.declare_parameter('sway', 100.0)
self.declare_parameter('yaw', 100.0)
self.declare_parameter('surge_scale_factor', 100.0)
self.declare_parameter('sway_scale_factor', 100.0)
self.declare_parameter('yaw_scale_factor', 100.0)

#Gets the scaling factors from the yaml file
self.joystick_surge_scaling = self.get_parameter('surge').value
self.joystick_sway_scaling = self.get_parameter('sway').value
self.joystick_yaw_scaling = self.get_parameter('yaw').value
self.joystick_surge_scaling = self.get_parameter('surge_scale_factor').value
self.joystick_sway_scaling = self.get_parameter('sway_scale_factor').value
self.joystick_yaw_scaling = self.get_parameter('yaw_scale_factor').value

#Killswitch publisher
self.software_killswitch_signal_publisher = self.create_publisher(
Bool, "/softWareKillSwitch", 10)
Bool, "softWareKillSwitch", 10)
self.software_killswitch_signal_publisher.publish(
Bool(data=False)) #Killswitch is not active

#Operational mode publisher
self.operational_mode_signal_publisher = self.create_publisher(
Bool, "/softWareOperationMode", 10)
Bool, "softWareOperationMode", 10)
# Signal that we are not in autonomous mode
self.operational_mode_signal_publisher.publish(Bool(data=True))

#Controller publisher
self.enable_controller_publisher = self.create_publisher(
Bool, "/controller/lqr/enable", 10)
Bool, "controller/lqr/enable", 10)

#does a linear conversion from trigger inputs (1 to -1) to (1 to 2)
def right_trigger_linear_converter(self, rt_input):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ launch:
name: joystick_interface
output: screen
param:
- from: vortex-asv/mission/joystick_interface/config/params.yaml
- from: src/vortex-asv/mission/joystick_interface/config/params.yaml




Expand Down

0 comments on commit 49795b0

Please sign in to comment.