Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implementation of a pid dp controller #499

Open
wants to merge 79 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
3260506
feat: adding in the setup for dp controller, dosent build, need to fix
Talhanc Sep 27, 2024
a3da7f6
feat: adding in pid parts
Talhanc Oct 11, 2024
0705602
Develop (#481)
kluge7 Oct 11, 2024
b218088
self.reference_mode erstattes med States.REFERENCE_MODE
malenef Oct 13, 2024
3180183
Some formatting
Andeshog Oct 13, 2024
821c846
feat: add pid gains
Talhanc Oct 13, 2024
cb24307
refactor: move controller to control
Andeshog Oct 13, 2024
6c93dfe
refactor: change function name from J to create_J to avoid conflict w…
Andeshog Oct 13, 2024
2e66778
Vinklene restarter seg ikke til null når du slipper opp kontrolleren
malenef Oct 18, 2024
76249d7
feat: added a new main.cpp file with ros2 node class
Talhanc Oct 18, 2024
5de507d
feat: add pid controller for dp
Andeshog Oct 18, 2024
5ca0457
feat: add possiblity to tune the PID during runtime by publishing Flo…
Andeshog Oct 18, 2024
7f16b07
feat: add config file for parameters
Andeshog Oct 19, 2024
f21369f
remove unnecessary typedef
Andeshog Oct 19, 2024
ff279e0
refactor: move eta, eta_d and nu over to ros node
Andeshog Oct 19, 2024
ee91ca5
feat: add launch file
Andeshog Oct 19, 2024
59b362c
feat: add eta_dot_d as reference state
Andeshog Oct 19, 2024
7a71543
build fix
Andeshog Oct 19, 2024
23c313e
feat: add reference filter
Andeshog Oct 19, 2024
4dcf9f6
added zeta and omega as ros params
jorgenfj Oct 19, 2024
3c56eea
feat: initialized action server
Andeshog Oct 20, 2024
d13fca8
feat: action server for reference filter
Andeshog Oct 20, 2024
18ded87
feat: add odom subscriber for reference filter
Andeshog Oct 20, 2024
0063806
Add parameter file
malenef Oct 20, 2024
c486401
Add ssa
malenef Oct 20, 2024
bbbe77e
Add better formating and cleaner code
malenef Oct 20, 2024
30c3bd8
Add documentation
malenef Oct 20, 2024
5327a63
feat: adding joystick input
Talhanc Oct 20, 2024
c5dea38
Add documentation and remove spamming in terminal
malenef Oct 20, 2024
c46ba1e
fix: some issues with pid_controller_ros.hpp file
Talhanc Oct 20, 2024
5ffb4a2
Merge branch '434-task-dp-controller' into 432-task-expand-joystick-i…
Talhanc Oct 20, 2024
487830d
Merge pull request #490 from vortexntnu/432-task-expand-joystick-inte…
Talhanc Oct 20, 2024
79fc2aa
feat: add multithreaded executor
Andeshog Oct 20, 2024
af96056
Merge branch '434-task-dp-controller' of github.com:vortexntnu/vortex…
Andeshog Oct 20, 2024
7406b3a
feat: make new goals overwrite the old goal
Andeshog Oct 22, 2024
06662e1
feat: add rotation of velocity from body to NED
Andeshog Oct 22, 2024
a442e88
feat: tuning reference filter
Andeshog Oct 22, 2024
28e4e71
fix: fix conversions between quat and euler using tf2
Andeshog Oct 22, 2024
cfa688b
refactor: use tf2 for conversion between euler and quat
Andeshog Oct 22, 2024
8d0d38b
feat: init tuning process
Andeshog Oct 22, 2024
121c638
feat: added anti windup
Talhanc Oct 23, 2024
c1df6f9
fix: variable issue in controller input
Talhanc Oct 23, 2024
3a2076f
refactor: Update include order in pid_controller_utils.hpp
Talhanc Oct 23, 2024
5f46ee1
feat: added in quaternions instead of euler
Talhanc Oct 24, 2024
9a69032
feat: added quaternion normalization to fix error
Talhanc Oct 31, 2024
188efa2
fix: changed pid params
Talhanc Nov 1, 2024
ed2115e
refactor(dp_controller): removed previous version
Talhanc Nov 8, 2024
ad55492
docs: added documentation
Talhanc Nov 8, 2024
614bc3e
docs: added documentation
Talhanc Nov 8, 2024
b280119
Merge remote-tracking branch 'origin/develop' into 434-task-dp-contro…
Talhanc Nov 8, 2024
8ced2af
hey
Talhanc Nov 8, 2024
00a2424
hey
Talhanc Nov 8, 2024
d159315
refactor: applied formatting changes
Talhanc Nov 8, 2024
9ca02ca
refactor: did some changes asked by anders
Talhanc Nov 8, 2024
ddfd003
fix(pid_controller_utils): forgot ; in one line
Talhanc Nov 8, 2024
ca73be3
feat: add methods for filling vectors
Andeshog Nov 10, 2024
1c65a96
refactor: remove redundant code
Andeshog Nov 10, 2024
4a2d2e8
feat: add tf2_geometry_msgs dependency
Andeshog Nov 10, 2024
b2d8df1
fix: fix methods
Andeshog Nov 10, 2024
b6d17b8
refactor: make precommit hook happy
Andeshog Nov 10, 2024
99e859a
make pre-commit hook happy
Andeshog Nov 10, 2024
fbf26e8
fix: fix parameter names
Andeshog Nov 10, 2024
2a75ea4
feat: added struct elements for the quaternions and position
Talhanc Nov 10, 2024
cc0b3b6
Merge branch 'feat/dp_controller_euler' into 434-task-dp-controller
Andeshog Nov 18, 2024
69b4c3a
feat: add correct qos profile for odom sug
Andeshog Nov 18, 2024
0ac8b2e
fix: structure fix
Andeshog Nov 18, 2024
7717907
fix: make pre-commit guy habby
Andeshog Nov 18, 2024
ba23237
fix:something wrong
Talhanc Jan 7, 2025
87d0a4a
fix:something wrong
Talhanc Jan 7, 2025
ab7fd8b
fix: fixing the control input computation
Talhanc Jan 7, 2025
2e07a59
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 7, 2025
222302b
fix: variabel error in guidance callback
Talhanc Jan 8, 2025
2868b8a
fix: some merge errors
Talhanc Jan 8, 2025
fde5507
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 8, 2025
6683733
feat: added topics into config file for the euler pid controller
Talhanc Jan 9, 2025
2031df1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 9, 2025
25c245a
fix: Adeed kill switch and remove the msgs error
Talhanc Jan 9, 2025
3499682
fix: change in reference filter parameter
Talhanc Jan 9, 2025
0cf0c30
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 9, 2025
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
Prev Previous commit
Next Next commit
feat: added topics into config file for the euler pid controller
  • Loading branch information
Talhanc committed Jan 9, 2025
commit 66837335d439d6f1d9e874629e889083dfa7056c
5 changes: 5 additions & 0 deletions control/pid_controller_dp_euler/config/pid_params.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
pid_controller_euler_node:
ros__parameters:
control_topic: /thrust/wrench_input
dp_reference_topic: /dp/reference
nucleus_odom_topic: /orca/odom
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nucleus is not used anymore, also add twist and pose

software_kill_switch_topic: /softwareKillSwitch
software_operation_mode_topic: /softwareOperationMode
Kp: [70.0, 70.0, 70.0, 15.0, 15.0, 15.0]
Ki: [9.0, 9.0, 9.0, 1.0, 1.5, 1.5]
Kd: [20.0, 20.0, 20.0, 0.1, 1.0, 1.0]
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ class PIDControllerNode : public rclcpp::Node {

void odometry_callback(const nav_msgs::msg::Odometry::SharedPtr msg);

void guidance_callback(
const vortex_msgs::msg::ReferenceFilter::SharedPtr msg);
void guidance_callback(const vortex_msgs::msg::ReferenceFilter::SharedPtr msg);

void publish_tau();

Expand All @@ -44,8 +43,7 @@ class PIDControllerNode : public rclcpp::Node {

rclcpp::Subscription<nav_msgs::msg::Odometry>::SharedPtr odometry_sub_;

rclcpp::Subscription<vortex_msgs::msg::ReferenceFilter>::SharedPtr
guidance_sub_;
rclcpp::Subscription<vortex_msgs::msg::ReferenceFilter>::SharedPtr guidance_sub_;

rclcpp::Subscription<std_msgs::msg::Float64MultiArray>::SharedPtr kp_sub_;

Expand Down
40 changes: 35 additions & 5 deletions control/pid_controller_dp_euler/src/pid_controller_ros.cpp
Original file line number Diff line number Diff line change
@@ -1,26 +1,56 @@
#include <pid_controller_dp_euler/pid_controller_ros.hpp>
#include <pid_controller_dp_euler/pid_controller_utils.hpp>
#include <string>

PIDControllerNode::PIDControllerNode() : Node("pid_controller_euler_node") {
time_step_ = std::chrono::milliseconds(10);
rmw_qos_profile_t qos_profile = rmw_qos_profile_sensor_data;

this->declare_parameter("nucleus_odom_topic", "/orca/odom");
this->declare_parameter("dp_reference_topic", "/dp/reference");
this->declare_parameter("control_topic", "/thrust/wrench_input");
this->declare_parameter("software_kill_switch_topic", "/softwareKillSwitch");
this->declare_parameter("software_operation_mode_topic", "/softwareOperationMode");

std::string nucleus_odom_topic =
this->get_parameter("nucleus_odom_topic").as_string();
std::string dp_reference_topic =
this->get_parameter("dp_reference_topic").as_string();
std::string control_topic =
this->get_parameter("control_topic").as_string();
std::string software_kill_switch_topic =
this->get_parameter("software_kill_switch_topic").as_string();
std::string software_operation_mode_topic =
this->get_parameter("software_operation_mode_topic").as_string();

std::string nucleus_odom_topic =
this->get_parameter("nucleus_odom_topic").as_string();
std::string dp_reference_topic =
this->get_parameter("dp_reference_topic").as_string();
std::string control_topic =
this->get_parameter("control_topic").as_string();
std::string software_kill_switch_topic =
this->get_parameter("software_kill_switch_topic").as_string();
std::string software_operation_mode_topic =
this->get_parameter("software_operation_mode_topic").as_string();

auto qos_sensor_data = rclcpp::QoS(
rclcpp::QoSInitialization(qos_profile.history, 1), qos_profile);
killswitch_sub_ = this->create_subscription<std_msgs::msg::Bool>(
"/softwareKillSwitch", 10,
software_kill_switch_topic, 10,
std::bind(&PIDControllerNode::killswitch_callback, this,
std::placeholders::_1));
software_mode_sub_ = this->create_subscription<std_msgs::msg::String>(
"/softwareOperationMode", 10,
software_operation_mode_topic, 10,
std::bind(&PIDControllerNode::software_mode_callback, this,
std::placeholders::_1));
odometry_sub_ = this->create_subscription<nav_msgs::msg::Odometry>(
"/nucleus/odom", qos_sensor_data,
nucleus_odom_topic, qos_sensor_data,
std::bind(&PIDControllerNode::odometry_callback, this,
std::placeholders::_1));
guidance_sub_ =
this->create_subscription<vortex_msgs::msg::ReferenceFilter>(
"/dp/reference", 10,
dp_reference_topic, 10,
std::bind(&PIDControllerNode::guidance_callback, this,
std::placeholders::_1));
kp_sub_ = this->create_subscription<std_msgs::msg::Float64MultiArray>(
Expand All @@ -36,7 +66,7 @@ PIDControllerNode::PIDControllerNode() : Node("pid_controller_euler_node") {
std::bind(&PIDControllerNode::kd_callback, this,
std::placeholders::_1));
tau_pub_ = this->create_publisher<geometry_msgs::msg::Wrench>(
"/thrust/wrench_input", 10);
control_topic, 10);
tau_pub_timer_ = this->create_wall_timer(
time_step_, std::bind(&PIDControllerNode::publish_tau, this));
set_pid_params();
Expand Down
Loading