Skip to content

Commit

Permalink
Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Clang Robot committed Mar 17, 2024
1 parent db77559 commit 3219836
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion motion/thruster_interface/src/thruster_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// const int I2C_ADDRESS = 0x21;
const char *I2C_DEVICE = "/dev/i2c-1";
int8_t i2c_slave_addr = 0x40; //change later to 0x21
int8_t i2c_slave_addr = 0x40; // change later to 0x21
std::map<float, float> pwm_table;

//--------------------------FUNCTIONS--------------------------
Expand Down
41 changes: 21 additions & 20 deletions motion/thruster_interface/src/thruster_interface_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ class ThrusterInterface : public rclcpp::Node {
public:
ThrusterInterface() : Node("thruster_interface_node") {

subscription_thruster_forces = this->create_subscription<vortex_msgs::msg::ThrusterForces>(
"thrust/thruster_forces", 10,
std::bind(&ThrusterInterface::thrusterForcesCallback, this,
std::placeholders::_1));
subscription_thruster_forces =
this->create_subscription<vortex_msgs::msg::ThrusterForces>(
"thrust/thruster_forces", 10,
std::bind(&ThrusterInterface::thrusterForcesCallback, this,
std::placeholders::_1));

subscription_hardware_status = this->create_subscription<std_msgs::msg::Int8>(
"asv/software/killswitch", 10,
std::bind(&ThrusterInterface::SoftwareKillswitchCallback, this,
std::placeholders::_1));
subscription_hardware_status =
this->create_subscription<std_msgs::msg::Int8>(
"asv/software/killswitch", 10,
std::bind(&ThrusterInterface::SoftwareKillswitchCallback, this,
std::placeholders::_1));

//remove the /test from the topic names later
// remove the /test from the topic names later

publisher_ESC1 = this->create_publisher<std_msgs::msg::Float32>(
"/asv/temperature/ESC1/test", 10);
Expand All @@ -44,17 +46,16 @@ class ThrusterInterface : public rclcpp::Node {
"/asv/temperature/ambient1/test", 10);
publisher_ambient2 = this->create_publisher<std_msgs::msg::Float32>(
"/asv/temperature/ambient2/test", 10);
publisher_status =
this->create_publisher<std_msgs::msg::Int8>("/asv/failsafe/hardware/status", 10);
publisher_status = this->create_publisher<std_msgs::msg::Int8>(
"/asv/failsafe/hardware/status", 10);

timer_ = this->create_wall_timer(
std::chrono::seconds(1),
std::bind(&ThrusterInterface::publish_temperature_and_status, this));
}

private:

//----------------------------------------------------------
//----------------------------------------------------------

void thrusterForcesCallback(
const vortex_msgs::msg::ThrusterForces::SharedPtr msg) const {
Expand Down Expand Up @@ -82,14 +83,14 @@ class ThrusterInterface : public rclcpp::Node {
send_pwm(pwm_values, file);
}

//----------------------------------------------------------
//----------------------------------------------------------

void SoftwareKillswitchCallback(
const std_msgs::msg::Int8::SharedPtr msg) const {
void
SoftwareKillswitchCallback(const std_msgs::msg::Int8::SharedPtr msg) const {
software_killswitch = msg->data;
}
}

//----------------------------------------------------------
//----------------------------------------------------------

void publish_temperature_and_status() {

Expand Down Expand Up @@ -128,10 +129,10 @@ void SoftwareKillswitchCallback(
publisher_ambient2->publish(message_ambient2);

// HARDWARE STATUS
//int8_t hardware_status = 0;
// int8_t hardware_status = 0;
hardware_status = read_hardware_statusFromI2C(file);

//cout << "hardware status = " << (uint16_t)(hardware_status) << endl;
// cout << "hardware status = " << (uint16_t)(hardware_status) << endl;

auto message_status = std_msgs::msg::Int8();

Expand Down

0 comments on commit 3219836

Please sign in to comment.