Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
fcfa385
feat(joy): add keyboard_joy node for keyboard-based teleoperation
kluge7 Nov 4, 2025
eec9cb3
chore(keyboard_joy_node): removed comments
kluge7 Nov 4, 2025
9386455
Made Operation Mode manager. Added to launch files. Changed dp accord…
eirisak Jan 6, 2026
f6af037
Merge remote-tracking branch 'origin' into 638-task-operation-mode-ma…
eirisak Jan 6, 2026
0421d64
Fixed launch from orca_sim + orca for operation mode manager + polish
eirisak Jan 8, 2026
df3a299
Added dependency to package.xml for operation mode manager
eirisak Jan 8, 2026
ea4fcbf
deleted operation mode python files
eirisak Jan 8, 2026
4f8cfe2
deleted keyboard joy
eirisak Jan 8, 2026
8c7c93b
Polish according to pull request comments
eirisak Jan 9, 2026
46ea553
Changed SetKillswitchSRV.srv to SetKillSwitch
eirisak Jan 9, 2026
2f24ab8
Updated in accordance to updates in vortex_msgs 32 task operation mod…
eirisak Jan 22, 2026
afc0d64
Updated in accordance to changes in vortex_msgs
eirisak Jan 28, 2026
537af9e
Pre-commit done
eirisak Jan 28, 2026
31d1ac1
fixed test operation mode and killswitch commands
eirisak Jan 28, 2026
8364f3e
Fixed more tests switching operation mode and killswitch
eirisak Jan 28, 2026
8de86af
Removed heartbeat function from joystick interface
eirisak Jan 28, 2026
676d564
Removed heartbeat include
eirisak Jan 28, 2026
f5c5356
empty commit
eirisak Jan 29, 2026
a1c0e7d
Merge branch 'main' into 638-task-operation-mode-manager
eirisak Jan 29, 2026
58d5764
Pre-commit
eirisak Jan 29, 2026
267a8f5
Pre-commit, again
eirisak Jan 29, 2026
2ce9f9b
Added operation mode launch to tests (to be removed from sim tests)
eirisak Feb 4, 2026
ce4e2c1
Updated killswitch callbacks
eirisak Feb 4, 2026
d48704f
Another pre-commit
eirisak Feb 4, 2026
fb4cfd8
Merge remote-tracking branch 'origin/main' into 638-task-operation-mo…
eirisak Feb 4, 2026
d2f355a
Fixed tests and lqr velocity controller
eirisak Feb 4, 2026
514189a
pre-commit
eirisak Feb 4, 2026
2e2fafe
fixed controls
eirisak Feb 4, 2026
166bb2c
fixed a few more tests
eirisak Feb 4, 2026
b3f63f8
Changed software_mode to operation_mode. Moved various function to vo…
eirisak Feb 11, 2026
5ff3a75
added dependencies to pid_controller
eirisak Feb 11, 2026
57e69f0
added dependencies to pid_controller euler
eirisak Feb 11, 2026
7ce5d04
Fixed operation mode manager main
eirisak Feb 11, 2026
aec9c95
Pre-commit
eirisak Feb 11, 2026
397e5b3
Updated pid_controller version
eirisak Feb 11, 2026
e1c4a5d
Pre-commit
eirisak Feb 11, 2026
f886c2a
Updated pid_controller euler version
eirisak Feb 11, 2026
3297176
Changed printf in pid controller euler
eirisak Feb 11, 2026
ac3e043
Change QoS for all instances of operation mode and killswitch to tran…
eirisak Feb 11, 2026
eccccdd
Included qos profiles in pid controller
eirisak Feb 11, 2026
e546c77
Changed back transient local to reliable, added periodic publishing t…
eirisak Feb 11, 2026
56eab71
Fixed a missing comma
eirisak Feb 11, 2026
6f733e6
Fixed operationmode initialisation in the manager
eirisak Feb 11, 2026
07525f9
Changed periodic publishing of mode to a get operation mode service a…
eirisak Feb 12, 2026
e80db6d
Uncommented in simulator tests
eirisak Feb 12, 2026
9b90021
Fixed initialization error in velocity controller
eirisak Feb 12, 2026
de32022
Resolved comments from pull request
eirisak Feb 12, 2026
549981b
pre-commit
eirisak Feb 12, 2026
5f29498
Exchanged a useless switch for simpler logic
eirisak Feb 12, 2026
bb2cd91
Merge remote-tracking branch 'origin/main' into 638-task-operation-mo…
eirisak Feb 18, 2026
3aadf59
Adapted Jorgens comments as of Feb 18 2026
eirisak Feb 18, 2026
08d1144
Fixed a logger error
eirisak Feb 18, 2026
96be19b
Fixed a logger error + pre-commit
eirisak Feb 18, 2026
4892fe8
fixed an error log
eirisak Feb 18, 2026
61bc288
Added utils dep to operation mode manager. Fixed default value in bac…
eirisak Feb 18, 2026
2955e8d
changed from rclcpp logger to spdlog
jorgenfj Feb 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions auv_setup/config/robots/orca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@
reference_filter: "reference_filter"
los: "los_guidance"

services:
set_operation_mode: "set_operation_mode"
set_killswitch: "set_killswitch"
toggle_killswitch: "toggle_killswitch"
get_operation_mode: "get_operation_mode"

fsm:
docking:
docking_station_offset: -1.0
Expand Down
8 changes: 7 additions & 1 deletion auv_setup/launch/topside.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@ def generate_launch_description() -> LaunchDescription:
)
)

return LaunchDescription([set_env_var, joy_node, joystick_interface_launch])
return LaunchDescription(
[
set_env_var,
joy_node,
joystick_interface_launch,
]
)
1 change: 1 addition & 0 deletions control/dp_adapt_backs_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ find_package(vortex_msgs REQUIRED)
find_package(fmt REQUIRED)
find_package(spdlog REQUIRED)


include_directories(include)

set(LIB_NAME "${PROJECT_NAME}_component")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
#include <std_msgs/msg/string.hpp>
#include <string>
#include <vortex/utils/types.hpp>
#include <vortex_msgs/msg/operation_mode.hpp>
#include <vortex_msgs/msg/reference_filter.hpp>
#include <vortex_msgs/srv/get_operation_mode.hpp>
#include "dp_adapt_backs_controller/dp_adapt_backs_controller.hpp"
#include "dp_adapt_backs_controller/typedefs.hpp"
#include "typedefs.hpp"
Expand All @@ -28,13 +30,18 @@ class DPAdaptBacksControllerNode : public rclcpp::Node {
const rclcpp::NodeOptions& options = rclcpp::NodeOptions());

private:
// @brief Client for the GetOperationMode service
rclcpp::Client<vortex_msgs::srv::GetOperationMode>::SharedPtr
get_operation_mode_client_;

// @brief Callback function for the killswitch topic
// @param msg: Bool message containing the killswitch status
void killswitch_callback(const std_msgs::msg::Bool::SharedPtr msg);

// @brief Callback function for the software mode topic
// @param msg: String message containing the software mode
void software_mode_callback(const std_msgs::msg::String::SharedPtr msg);
void operation_mode_callback(
const vortex_msgs::msg::OperationMode::SharedPtr msg);

// @brief Callback function for the pose topic
// @param msg: PoseWithCovarianceStamped message containing the AUV pose
Expand All @@ -55,6 +62,10 @@ class DPAdaptBacksControllerNode : public rclcpp::Node {
// @brief Set the subscriber and publisher for the node
void set_subscribers_and_publisher();

// @brief Initialize the operation mode by calling the GetOperationMode
// service
void initialize_operation_mode();

// @brief Callback function for the guidance topic
// @param msg: ReferenceFilter message containing the desired vehicle pose
// and velocity
Expand All @@ -63,7 +74,8 @@ class DPAdaptBacksControllerNode : public rclcpp::Node {

rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr killswitch_sub_{};

rclcpp::Subscription<std_msgs::msg::String>::SharedPtr software_mode_sub_{};
rclcpp::Subscription<vortex_msgs::msg::OperationMode>::SharedPtr
operation_mode_sub_{};

rclcpp::Subscription<
geometry_msgs::msg::PoseWithCovarianceStamped>::SharedPtr pose_sub_{};
Expand All @@ -88,9 +100,10 @@ class DPAdaptBacksControllerNode : public rclcpp::Node {

std::unique_ptr<DPAdaptBacksController> dp_adapt_backs_controller_{};

bool killswitch_on_{false};
bool killswitch_on_{true};

std::string software_mode_{};
vortex::utils::types::Mode operation_mode_{
vortex::utils::types::Mode::manual};
};

} // namespace vortex::control
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <string>
#include <vortex/utils/math.hpp>
#include <vortex/utils/ros/qos_profiles.hpp>
#include <vortex/utils/ros/ros_conversions.hpp>
#include <vortex/utils/types.hpp>
#include "dp_adapt_backs_controller/dp_adapt_backs_controller_utils.hpp"
#include "dp_adapt_backs_controller/typedefs.hpp"
Expand All @@ -25,6 +26,7 @@ DPAdaptBacksControllerNode::DPAdaptBacksControllerNode(
time_step_ = std::chrono::milliseconds(10);

set_subscribers_and_publisher();
initialize_operation_mode();

tau_pub_timer_ = this->create_wall_timer(
time_step_, std::bind(&DPAdaptBacksControllerNode::publish_tau, this));
Expand Down Expand Up @@ -74,10 +76,11 @@ void DPAdaptBacksControllerNode::set_subscribers_and_publisher() {
this->declare_parameter<std::string>("topics.operation_mode");
std::string software_operation_mode_topic =
this->get_parameter("topics.operation_mode").as_string();
software_mode_sub_ = this->create_subscription<std_msgs::msg::String>(
software_operation_mode_topic, qos_reliable,
std::bind(&DPAdaptBacksControllerNode::software_mode_callback, this,
std::placeholders::_1));
operation_mode_sub_ =
this->create_subscription<vortex_msgs::msg::OperationMode>(
software_operation_mode_topic, qos_reliable,
std::bind(&DPAdaptBacksControllerNode::operation_mode_callback,
this, std::placeholders::_1));

this->declare_parameter<std::string>("topics.wrench_input");
std::string control_topic =
Expand All @@ -86,6 +89,44 @@ void DPAdaptBacksControllerNode::set_subscribers_and_publisher() {
control_topic, qos_sensor_data);
}

void DPAdaptBacksControllerNode::initialize_operation_mode() {
this->declare_parameter<std::string>("services.get_operation_mode");
std::string get_operation_mode_service =
this->get_parameter("services.get_operation_mode").as_string();

get_operation_mode_client_ =
this->create_client<vortex_msgs::srv::GetOperationMode>(
get_operation_mode_service);

while (!get_operation_mode_client_->wait_for_service(
std::chrono::seconds(1))) {
spdlog::warn("Waiting for GetOperationMode service to be available...");
}

auto request =
std::make_shared<vortex_msgs::srv::GetOperationMode::Request>();
get_operation_mode_client_->async_send_request(
request,
[this](rclcpp::Client<vortex_msgs::srv::GetOperationMode>::SharedFuture
future) {
try {
auto response = future.get();
operation_mode_ =
vortex::utils::ros_conversions::convert_from_ros(
response->current_operation_mode);
killswitch_on_ = response->killswitch_status;
spdlog::info(
"Initial operation mode: {} | Killswitch status: {}",
vortex::utils::types::mode_to_string(operation_mode_),
killswitch_on_ ? "on" : "off");
} catch (const std::exception& e) {
spdlog::error("Failed to get initial operation mode: {}",
e.what());
killswitch_on_ = true;
}
});
}

void DPAdaptBacksControllerNode::killswitch_callback(
const std_msgs::msg::Bool::SharedPtr msg) {
killswitch_on_ = msg->data;
Expand All @@ -94,12 +135,14 @@ void DPAdaptBacksControllerNode::killswitch_callback(
spdlog::info("Killswitch: {}", killswitch_on_ ? "on" : "off");
}

void DPAdaptBacksControllerNode::software_mode_callback(
const std_msgs::msg::String::SharedPtr msg) {
software_mode_ = msg->data;
spdlog::info("Software mode: {}", software_mode_);
void DPAdaptBacksControllerNode::operation_mode_callback(
const vortex_msgs::msg::OperationMode::SharedPtr msg) {
operation_mode_ = vortex::utils::ros_conversions::convert_from_ros(*msg);
spdlog::info("Operation mode: {}",
vortex::utils::types::mode_to_string(operation_mode_));

if (software_mode_ == "autonomous mode") {
if (operation_mode_ == vortex::utils::types::Mode::autonomous ||
operation_mode_ == vortex::utils::types::Mode::reference) {
pose_d_ = pose_;
}
}
Expand Down Expand Up @@ -180,7 +223,8 @@ void DPAdaptBacksControllerNode::set_adap_params() {
}

void DPAdaptBacksControllerNode::publish_tau() {
if (killswitch_on_ || software_mode_ != "autonomous mode") {
if (killswitch_on_ ||
operation_mode_ == vortex::utils::types::Mode::manual) {
return;
}

Expand Down
6 changes: 5 additions & 1 deletion control/pid_controller_dp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.8)
project(pid_controller_dp)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand All @@ -16,6 +16,8 @@ find_package(geometry_msgs REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(tf2 REQUIRED)
find_package(vortex_msgs REQUIRED)
find_package(vortex_utils REQUIRED)
find_package(vortex_utils_ros REQUIRED)

include_directories(include)

Expand All @@ -34,6 +36,8 @@ ament_target_dependencies(pid_controller_node
Eigen3
tf2
vortex_msgs
vortex_utils
vortex_utils_ros
)

install(TARGETS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
#include <std_msgs/msg/string.hpp>
#include <string>
#include <variant>
#include <vortex/utils/types.hpp>
#include <vortex_msgs/msg/operation_mode.hpp>
#include <vortex_msgs/msg/reference_filter.hpp>
#include <vortex_msgs/srv/get_operation_mode.hpp>
#include "pid_controller_dp/pid_controller.hpp"
#include "pid_controller_dp/typedefs.hpp"

Expand All @@ -29,7 +32,8 @@ class PIDControllerNode : public rclcpp::Node {

// @brief Callback function for the software mode topic
// @param msg: String message containing the software mode
void software_mode_callback(const std_msgs::msg::String::SharedPtr msg);
void operation_mode_callback(
const vortex_msgs::msg::OperationMode::SharedPtr msg);

// @brief Callback function for the pose topic
// @param msg: PoseWithCovarianceStamped message containing the AUV pose
Expand All @@ -50,17 +54,25 @@ class PIDControllerNode : public rclcpp::Node {
// @brief Set the subscriber and publisher for the node
void set_subscribers_and_publisher();

// @brief Initialize the operation mode by calling the GetOperationMode
// service
void initialize_operation_mode();

// @brief Callback function for the guidance topic
// @param msg: ReferenceFilter message containing the desired vehicle pose
// and velocity
void guidance_callback(
const vortex_msgs::msg::ReferenceFilter::SharedPtr msg);

rclcpp::Client<vortex_msgs::srv::GetOperationMode>::SharedPtr
get_operation_mode_client_;

PIDController pid_controller_;

rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr killswitch_sub_;

rclcpp::Subscription<std_msgs::msg::String>::SharedPtr software_mode_sub_;
rclcpp::Subscription<vortex_msgs::msg::OperationMode>::SharedPtr
operation_mode_sub_;

rclcpp::Subscription<
geometry_msgs::msg::PoseWithCovarianceStamped>::SharedPtr pose_sub_;
Expand Down Expand Up @@ -91,9 +103,10 @@ class PIDControllerNode : public rclcpp::Node {

types::Eta eta_dot_d_;

bool killswitch_on_;
bool killswitch_on_{true};

std::string software_mode_;
vortex::utils::types::Mode operation_mode_{
vortex::utils::types::Mode::manual};
};

#endif // PID_CONTROLLER_DP__PID_CONTROLLER_ROS_HPP_
2 changes: 2 additions & 0 deletions control/pid_controller_dp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<depend>eigen</depend>
<depend>tf2</depend>
<depend>vortex_msgs</depend>
<depend>vortex_utils</depend>
<depend>vortex_utils_ros</depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
Loading