From 41af6eb5e1b6da942269783d74d2bb4617ea38c5 Mon Sep 17 00:00:00 2001 From: Talha Date: Fri, 3 Jan 2025 22:44:17 +0200 Subject: [PATCH] create a seperate control config for simulation (#110) * create a seperate control config for simulation * remove remapping from sim bridge * use config_file param to load rosparams * add pid params for sim --- auv_bringup/launch/start.launch | 1 + auv_bringup/launch/start_navigation.launch | 2 + auv_control/auv_control/launch/start.launch | 7 ++-- .../auv_sim_bridge/config/control_config.yaml | 40 +++++++++++++++++++ .../auv_sim_bridge/simulation_mock_ros.h | 12 +----- .../launch/inc/start_bridge.launch | 1 + 6 files changed, 49 insertions(+), 14 deletions(-) create mode 100644 auv_sim/auv_sim_bridge/config/control_config.yaml diff --git a/auv_bringup/launch/start.launch b/auv_bringup/launch/start.launch index dfa212b..d03e0c8 100644 --- a/auv_bringup/launch/start.launch +++ b/auv_bringup/launch/start.launch @@ -52,6 +52,7 @@ + diff --git a/auv_bringup/launch/start_navigation.launch b/auv_bringup/launch/start_navigation.launch index 6f928ec..5d8e019 100644 --- a/auv_bringup/launch/start_navigation.launch +++ b/auv_bringup/launch/start_navigation.launch @@ -4,6 +4,7 @@ + @@ -19,6 +20,7 @@ + diff --git a/auv_control/auv_control/launch/start.launch b/auv_control/auv_control/launch/start.launch index fe58909..de6e698 100644 --- a/auv_control/auv_control/launch/start.launch +++ b/auv_control/auv_control/launch/start.launch @@ -4,6 +4,7 @@ + @@ -14,7 +15,7 @@ - + @@ -23,14 +24,14 @@ - + - + channelRemap = {1, 7, 2, 5, 0, 6, 3, 4}; - if (msg.channels.size() < kThrusterSize) { ROS_WARN("Received MotorCommand with insufficient channels."); return; } for (int i = 0; i < kThrusterSize; i++) { - if (i < channelRemap.size() && channelRemap[i] < msg.channels.size()) { - int remappedChannel = channelRemap[i]; - thrusters_[i].publish(msg.channels.at(remappedChannel), stamp); - } else { - ROS_WARN( - "Invalid channel remapping or insufficient channels for " - "remapping."); - } + thrusters_[i].publish(msg.channels.at(i), stamp); } } diff --git a/auv_sim/auv_sim_bringup/launch/inc/start_bridge.launch b/auv_sim/auv_sim_bringup/launch/inc/start_bridge.launch index c2c485b..f28cf85 100644 --- a/auv_sim/auv_sim_bringup/launch/inc/start_bridge.launch +++ b/auv_sim/auv_sim_bringup/launch/inc/start_bridge.launch @@ -35,6 +35,7 @@ +