Skip to content

Commit

Permalink
Wheels can be moved by debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Chi-EEE committed Jan 10, 2024
1 parent 11dac62 commit 37c6a73
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/raspberry_pi/src/car/system/CarSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace car::system
{
this->messaging_system->initialize();
this->lidar_device->initialize();
this->movement_system->initialize();

this->messaging_system->speed_command_signal.connect([this](const SpeedCommand speed_command)
{ this->setRearWheelsSpeed(speed_command); });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ namespace car::system::movement::controller
static constexpr int MIN_PULSE_WIDTH = 900;
static constexpr int MAX_PULSE_WIDTH = 2100;
static constexpr int FREQUENCY = 50;

static constexpr int BUS_NUMBER = 1;

class CarWheelController : public AbstractWheelController
{
public:
CarWheelController() {
this->pwm = std::make_shared<PCA9685>();
this->rear_left_wheel = std::make_unique<RearWheel>(
this->pwm,
std::make_unique<TB6612>(Motor_A, PWM_A)
Expand All @@ -52,7 +56,7 @@ namespace car::system::movement::controller
~CarWheelController() {};

void initialize() override {
this->pwm->init(1, 0x40);
this->pwm->init(BUS_NUMBER, 0x40);
std::this_thread::sleep_for(std::chrono::milliseconds(100));
this->pwm->setPWMFreq(FREQUENCY);
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
Expand Down

0 comments on commit 37c6a73

Please sign in to comment.