Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions src/rov/rov_pca9685/include/pca9685/ServoDriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/rov/rov_pca9685/src/PCA9685.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/rov/rov_pca9685/src/ServoDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading