diff --git a/src/rov/rov_pca9685/include/pca9685/ServoDriver.hpp b/src/rov/rov_pca9685/include/pca9685/ServoDriver.hpp index c78d4dd..47498b3 100644 --- a/src/rov/rov_pca9685/include/pca9685/ServoDriver.hpp +++ b/src/rov/rov_pca9685/include/pca9685/ServoDriver.hpp @@ -15,13 +15,13 @@ struct ServoBase { }; struct Servo : ServoBase { - uint16_t us_minimum = 1000; - uint16_t us_maximum = 2000; + uint16_t us_minimum = 1100; + uint16_t us_maximum = 1900; }; struct ContinuousServo : ServoBase { - uint16_t us_minimum = 1000; - uint16_t us_maximum = 2000; + uint16_t us_minimum = 1100; + uint16_t us_maximum = 1900; }; class ServoDriver { diff --git a/src/rov/rov_pca9685/src/PCA9685.cpp b/src/rov/rov_pca9685/src/PCA9685.cpp index c387950..3ea4f9f 100644 --- a/src/rov/rov_pca9685/src/PCA9685.cpp +++ b/src/rov/rov_pca9685/src/PCA9685.cpp @@ -82,7 +82,7 @@ void PCA9685::reset() { } void PCA9685::setFrequency(uint16_t frequency) { - static const uint16_t NUM_COUNTS = 3932; // scaling factor since clock sucks balls lol + static const uint16_t NUM_COUNTS = 4123; // scaling factor since clock sucks balls lol static const uint16_t MIN_FREQUENCY = 24; // Hz static const uint16_t MAX_FREQUENCY = 1526; // Hz // if given frequency is not valid, do nothing diff --git a/src/rov/rov_pca9685/src/ServoDriver.cpp b/src/rov/rov_pca9685/src/ServoDriver.cpp index 5b2878e..95f04cb 100644 --- a/src/rov/rov_pca9685/src/ServoDriver.cpp +++ b/src/rov/rov_pca9685/src/ServoDriver.cpp @@ -28,14 +28,14 @@ void ServoDriver::registerServo(uint8_t channel, ServoType type) { case ServoType::POSITIONAL: servos[channel] = Servo(); RCLCPP_INFO(rclcpp::get_logger("ServoDriver"), "Registered positional servo on channel %d", channel); - setUSBounds(channel, 1000, 2000); + setUSBounds(channel, 1100, 1900); setAngle(channel, 90.0f); break; case ServoType::CONTINUOUS: continuous_servos[channel] = ContinuousServo(); RCLCPP_INFO(rclcpp::get_logger("ServoDriver"), "Registered continuous servo on channel %d", channel); - setUSBounds(channel, 1000, 2000); + setUSBounds(channel, 1100, 1900); setThrottle(channel, 0.0f); break; }