From 8bc8490fd4068a69c27b69ab8dbb7af0b241a59e Mon Sep 17 00:00:00 2001 From: Krishna K Bharadwaj Date: Sun, 3 Nov 2024 00:20:53 +0530 Subject: [PATCH 1/7] Update thruster.hpp --- src/thruster/thruster.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/thruster/thruster.hpp b/src/thruster/thruster.hpp index ccf47a0..b6181a4 100644 --- a/src/thruster/thruster.hpp +++ b/src/thruster/thruster.hpp @@ -1,18 +1,27 @@ #ifndef SENSING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_HPP #define SENSING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_HPP + #include "thruster_info.hpp" #include +#include +#include +#include "Arduino.h" + namespace sensing_and_control_unit { class Thrusters { private: Servo thrusters_[kThrusterCount]; + ros::Subscriber pwm_sub_; + void pwmCallback(const std_msgs::Int32MultiArray &msg); + public: Thrusters(); ~Thrusters(); - void initialize(); + void initialize(); void setPWMs(int pwm_values[kThrusterCount]); }; } // namespace sensing_and_control_unit -#endif // SENSING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_HPP \ No newline at end of file + +#endif // SENSING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_HPP From 20d9b5887e95aeb0829e5288175e2a45bb58447a Mon Sep 17 00:00:00 2001 From: Krishna K Bharadwaj Date: Sun, 3 Nov 2024 00:21:07 +0530 Subject: [PATCH 2/7] Update thruster.cpp --- src/thruster/thruster.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/thruster/thruster.cpp b/src/thruster/thruster.cpp index f14bf66..11fcb01 100644 --- a/src/thruster/thruster.cpp +++ b/src/thruster/thruster.cpp @@ -2,11 +2,26 @@ namespace sensing_and_control_unit { Thrusters::Thrusters() {} - Thrusters::~Thrusters() {} -void Thrusters::initialize() {} +void Thrusters::initialize() +{ + for(int thruster_index=0;thruster_index Date: Sun, 3 Nov 2024 00:21:40 +0530 Subject: [PATCH 3/7] Update thruster_info.hpp --- include/thruster_info.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/thruster_info.hpp b/include/thruster_info.hpp index d2f7388..d56821e 100644 --- a/include/thruster_info.hpp +++ b/include/thruster_info.hpp @@ -1,4 +1,6 @@ -#ifndef SENSIING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_INFO_HPP -#define SENSIING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_INFO_HPP +#ifndef SENSING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_INFO_HPP +#define SENSING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_INFO_HPP const int kThrusterCount = 6; -#endif // SENSIING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_INFO_HPP \ No newline at end of file +const int kThrusterNeutralPWM = 1500; +const int kThrusterPins[]={2,3,4,5,6,7}; +#endif // SENSIING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_INFO_HPP From 233ce349062c2225eceda0f4dc5e7bdb676fdb0b Mon Sep 17 00:00:00 2001 From: Krishna K Bharadwaj Date: Sun, 3 Nov 2024 00:24:22 +0530 Subject: [PATCH 4/7] Update communication.hpp --- src/communication/communication.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/communication/communication.hpp b/src/communication/communication.hpp index 8c0b71b..8b90820 100644 --- a/src/communication/communication.hpp +++ b/src/communication/communication.hpp @@ -1,5 +1,5 @@ -#ifndef SENSING_AND_CONTROL_UNIT_SRC_COMMUNICATION_COMMUNICATION_HPP -#define SENSING_AND_CONTROL_UNIT_SRC_COMMUNICATION_COMMUNICATION_HPP +#ifndef SENSIING_AND_CONTROL_UNIT_SRC_COMMUNICATION_COMMUNICATION_HPP +#define SENSIING_AND_CONTROL_UNIT_SRC_COMMUNICATION_COMMUNICATION_HPP #include "error.hpp" #include "vec3.hpp" #include "thruster_info.hpp" @@ -38,4 +38,4 @@ class Communication { void recieveCommands(); }; } // namespace sensing_and_control_unit -#endif // SENSING_AND_CONTROL_UNIT_SRC_COMMUNICATION_COMMUNICATION_HPP \ No newline at end of file +#endif // SENSING_AND_CONTROL_UNIT_SRC_COMMUNICATION_COMMUNICATION_HPP From 33fef85007f223f67f92e67be8ea322f34bc0816 Mon Sep 17 00:00:00 2001 From: Krishna K Bharadwaj Date: Sun, 3 Nov 2024 00:24:43 +0530 Subject: [PATCH 5/7] Update thruster.hpp --- src/thruster/thruster.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/thruster/thruster.hpp b/src/thruster/thruster.hpp index b6181a4..39a4bfd 100644 --- a/src/thruster/thruster.hpp +++ b/src/thruster/thruster.hpp @@ -1,5 +1,5 @@ -#ifndef SENSING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_HPP -#define SENSING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_HPP +#ifndef SENSIING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_HPP +#define SENSIING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_HPP #include "thruster_info.hpp" #include From d2d144687232fe74e6f226b21c8ea01249b6e424 Mon Sep 17 00:00:00 2001 From: Krishna K Bharadwaj Date: Sun, 3 Nov 2024 00:24:57 +0530 Subject: [PATCH 6/7] Update thruster_info.hpp --- include/thruster_info.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/thruster_info.hpp b/include/thruster_info.hpp index d56821e..5686386 100644 --- a/include/thruster_info.hpp +++ b/include/thruster_info.hpp @@ -1,5 +1,5 @@ -#ifndef SENSING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_INFO_HPP -#define SENSING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_INFO_HPP +#ifndef SENSIING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_INFO_HPP +#define SENSIING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_INFO_HPP const int kThrusterCount = 6; const int kThrusterNeutralPWM = 1500; const int kThrusterPins[]={2,3,4,5,6,7}; From 3f9a7260ccef2ec5f395241b1d39d867e0d2bf82 Mon Sep 17 00:00:00 2001 From: krishna-k-b Date: Mon, 13 Jan 2025 12:26:35 +0530 Subject: [PATCH 7/7] Update thruster.hpp --- src/thruster/thruster.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/thruster/thruster.hpp b/src/thruster/thruster.hpp index 39a4bfd..b6181a4 100644 --- a/src/thruster/thruster.hpp +++ b/src/thruster/thruster.hpp @@ -1,5 +1,5 @@ -#ifndef SENSIING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_HPP -#define SENSIING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_HPP +#ifndef SENSING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_HPP +#define SENSING_AND_CONTROL_UNIT_SRC_THRUSTER_THRUSTER_HPP #include "thruster_info.hpp" #include