Skip to content

Commit

Permalink
added default no param constructor to Servo class
Browse files Browse the repository at this point in the history
  • Loading branch information
VincidaB committed Apr 29, 2024
1 parent 8c47797 commit 5434c2a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ hardware_interface::CallbackReturn ActuatorsRpPicoHardware::on_init(

for (int i = 1; i <= 12; i++) {
if (cfg_.servo_names[i] != "") {
RCLCPP_INFO(
rclcpp::get_logger("ActuatorsRpPicoHardware"), "Setting up servo %s", cfg_.servo_names[i].c_str());
servos_[i].setup(cfg_.servo_names[i], i);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct Config
int baud_rate = 0;
int timeout_ms = 0;

};
};;


public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@ class Servo
double cmd = 0;
double angle = 0;

Servo() = default;
Servo()
{
}

Servo(const std::string &servo_name, int servo_number)
{
setup(servo_name, servo_number);
this->setup(servo_name, servo_number);
}


void setup(const std::string &servo_name, int servo_number)
{
name = servo_name;
this->name = servo_name;
this->servo_number = servo_number;
}

Expand Down

0 comments on commit 5434c2a

Please sign in to comment.