Skip to content

Commit

Permalink
Use camel casing for method names
Browse files Browse the repository at this point in the history
  • Loading branch information
Chi-EEE committed Jan 9, 2024
1 parent 00e2768 commit daa2b6e
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 58 deletions.
6 changes: 3 additions & 3 deletions app/raspberry_pi/src/car/display/CarConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ namespace car::display {
#pragma region Lidar Scan Map
auto renderer_line_block = Renderer([&] {
auto c = Canvas(100, 100);
for (auto& point : this->car_system->get_scan_data()) {
for (auto& point : this->car_system->getScanData()) {
const double angle = point.angle;
const double distance = point.distance;
const double angleInRadians = angle * (3.14159265f / 180.0f);
Expand Down Expand Up @@ -216,12 +216,12 @@ namespace car::display {
lidar_signal.connect([&](bool connected)
{
if (connected) {
this->car_system->start_lidar_device();
this->car_system->startLidarDevice();
lidar_status = LIDAR_ENABLED_MESSAGE;
lidar_loading_debounce = false;
}
else {
this->car_system->stop_lidar_device();
this->car_system->stopLidarDevice();
lidar_status = LIDAR_DISABLED_MESSAGE;
lidar_loading_debounce = false;
}
Expand Down
32 changes: 16 additions & 16 deletions app/raspberry_pi/src/car/system/CarSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ namespace car::system
this->lidar_device->initialize();

this->messaging_system->speed_command_signal.connect([this](const SpeedCommand speed_command)
{ this->set_rear_wheels_speed(speed_command); });
{ this->setRearWheelsSpeed(speed_command); });

this->messaging_system->angle_command_signal.connect([this](const AngleCommand angle_command)
{ this->set_front_wheels_angle(angle_command); });
{ this->setFrontWheelsAngle(angle_command); });
}

void CarSystem::start()
Expand Down Expand Up @@ -66,43 +66,43 @@ namespace car::system
this->messaging_system->sendMessage(output_json.dump());
}

void CarSystem::start_lidar_device()
void CarSystem::startLidarDevice()
{
this->lidar_device->start();
}

void CarSystem::stop_lidar_device()
void CarSystem::stopLidarDevice()
{
this->lidar_device->stop();
}

void CarSystem::set_rear_wheels_speed(const SpeedCommand& speed_command)
void CarSystem::setRearWheelsSpeed(const SpeedCommand& speed_command)
{
this->movement_system->set_rear_wheels_speed(speed_command);
this->movement_system->setRearWheelsSpeed(speed_command);
}

void CarSystem::set_front_wheels_angle(const AngleCommand& angle_command)
void CarSystem::setFrontWheelsAngle(const AngleCommand& angle_command)
{
this->movement_system->set_front_wheels_angle(angle_command);
this->movement_system->setFrontWheelsAngle(angle_command);
}

void CarSystem::set_rear_left_wheel_speed(const SpeedCommand& speed_command)
void CarSystem::setRearLeftWheelSpeed(const SpeedCommand& speed_command)
{
this->movement_system->set_rear_left_wheel_speed(speed_command);
this->movement_system->setRearLeftWheelSpeed(speed_command);
}

void CarSystem::set_rear_right_wheel_speed(const SpeedCommand& speed_command)
void CarSystem::setRearRightWheelSpeed(const SpeedCommand& speed_command)
{
this->movement_system->set_rear_right_wheel_speed(speed_command);
this->movement_system->setRearRightWheelSpeed(speed_command);
}

void CarSystem::set_front_left_wheel_angle(const AngleCommand& angle_command)
void CarSystem::setFrontLeftWheelAngle(const AngleCommand& angle_command)
{
this->movement_system->set_front_left_wheel_angle(angle_command);
this->movement_system->setFrontLeftWheelAngle(angle_command);
}

void CarSystem::set_front_right_wheel_angle(const AngleCommand& angle_command)
void CarSystem::setFrontRightWheelAngle(const AngleCommand& angle_command)
{
this->movement_system->set_front_right_wheel_angle(angle_command);
this->movement_system->setFrontRightWheelAngle(angle_command);
}
}
18 changes: 9 additions & 9 deletions app/raspberry_pi/src/car/system/CarSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ namespace car::system {

void update();

void start_lidar_device();
void stop_lidar_device();
void startLidarDevice();
void stopLidarDevice();

void set_rear_wheels_speed(const SpeedCommand& speed_command);
void set_front_wheels_angle(const AngleCommand& angle_command);
void setRearWheelsSpeed(const SpeedCommand& speed_command);
void setFrontWheelsAngle(const AngleCommand& angle_command);

void set_rear_left_wheel_speed(const SpeedCommand& speed_command);
void set_rear_right_wheel_speed(const SpeedCommand& speed_command);
void setRearLeftWheelSpeed(const SpeedCommand& speed_command);
void setRearRightWheelSpeed(const SpeedCommand& speed_command);

void set_front_left_wheel_angle(const AngleCommand& angle_command);
void set_front_right_wheel_angle(const AngleCommand& angle_command);
void setFrontLeftWheelAngle(const AngleCommand& angle_command);
void setFrontRightWheelAngle(const AngleCommand& angle_command);

const std::vector<Measure>& get_scan_data() const { return this->scan_data; }
const std::vector<Measure>& getScanData() const { return this->scan_data; }

private:
std::unique_ptr<LidarDevice> lidar_device;
Expand Down
24 changes: 12 additions & 12 deletions app/raspberry_pi/src/car/system/movement/MovementSystem.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,32 @@ namespace car::system::movement {
}

#pragma region Wheels
void set_rear_wheels_speed(const SpeedCommand& speed_command) {
this->wheel_controller->set_rear_wheels_speed(speed_command);
void setRearWheelsSpeed(const SpeedCommand& speed_command) {
this->wheel_controller->setRearWheelsSpeed(speed_command);
}

void set_front_wheels_angle(const AngleCommand& angle_command) {
this->wheel_controller->set_front_wheels_angle(angle_command);
void setFrontWheelsAngle(const AngleCommand& angle_command) {
this->wheel_controller->setFrontWheelsAngle(angle_command);
}

void set_rear_left_wheel_speed(const SpeedCommand& speed_command)
void setRearLeftWheelSpeed(const SpeedCommand& speed_command)
{
this->wheel_controller->set_rear_left_wheel_speed(speed_command);
this->wheel_controller->setRearLeftWheelSpeed(speed_command);
}

void set_rear_right_wheel_speed(const SpeedCommand& speed_command)
void setRearRightWheelSpeed(const SpeedCommand& speed_command)
{
this->wheel_controller->set_rear_right_wheel_speed(speed_command);
this->wheel_controller->setRearRightWheelSpeed(speed_command);
}

void set_front_left_wheel_angle(const AngleCommand& angle_command)
void setFrontLeftWheelAngle(const AngleCommand& angle_command)
{
this->wheel_controller->set_front_left_wheel_angle(angle_command);
this->wheel_controller->setFrontLeftWheelAngle(angle_command);
}

void set_front_right_wheel_angle(const AngleCommand& angle_command)
void setFrontRightWheelAngle(const AngleCommand& angle_command)
{
this->wheel_controller->set_front_right_wheel_angle(angle_command);
this->wheel_controller->setFrontRightWheelAngle(angle_command);
}
#pragma endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ namespace car::system::movement::controller
public:
virtual void initialize() = 0;

virtual void set_rear_wheels_speed(const SpeedCommand &speed_command) = 0;
virtual void set_front_wheels_angle(const AngleCommand &angle_command) = 0;
virtual void setRearWheelsSpeed(const SpeedCommand &speed_command) = 0;
virtual void setFrontWheelsAngle(const AngleCommand &angle_command) = 0;

virtual void set_rear_left_wheel_speed(const SpeedCommand& speed_command) = 0;
virtual void set_rear_right_wheel_speed(const SpeedCommand& speed_command) = 0;
virtual void setRearLeftWheelSpeed(const SpeedCommand& speed_command) = 0;
virtual void setRearRightWheelSpeed(const SpeedCommand& speed_command) = 0;

virtual void set_front_left_wheel_angle(const AngleCommand& angle_command) = 0;
virtual void set_front_right_wheel_angle(const AngleCommand& angle_command) = 0;
virtual void setFrontLeftWheelAngle(const AngleCommand& angle_command) = 0;
virtual void setFrontRightWheelAngle(const AngleCommand& angle_command) = 0;
};
} // namespace car::system::movement::controller

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,27 @@ namespace car::system::movement::controller
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
}

void set_rear_wheels_speed(const SpeedCommand& speed_command) override {
void setRearWheelsSpeed(const SpeedCommand& speed_command) override {

}

void set_front_wheels_angle(const AngleCommand& angle_command) override {
void setFrontWheelsAngle(const AngleCommand& angle_command) override {

}

void set_rear_left_wheel_speed(const SpeedCommand& speed_command) override {
void setRearLeftWheelSpeed(const SpeedCommand& speed_command) override {

}

void set_rear_right_wheel_speed(const SpeedCommand& speed_command) override {
void setRearRightWheelSpeed(const SpeedCommand& speed_command) override {

}

void set_front_left_wheel_angle(const AngleCommand& angle_command) override {
void setFrontLeftWheelAngle(const AngleCommand& angle_command) override {

}

void set_front_right_wheel_angle(const AngleCommand& angle_command) override {
void setFrontRightWheelAngle(const AngleCommand& angle_command) override {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@ namespace car::system::movement::controller
public:
void initialize(){};

void set_rear_wheels_speed(const SpeedCommand &speed_command) override {
void setRearWheelsSpeed(const SpeedCommand &speed_command) override {

}

void set_front_wheels_angle(const AngleCommand &angle_command) override {
void setFrontWheelsAngle(const AngleCommand &angle_command) override {

}

void set_rear_left_wheel_speed(const SpeedCommand& speed_command) override {
void setRearLeftWheelSpeed(const SpeedCommand& speed_command) override {

}

void set_rear_right_wheel_speed(const SpeedCommand& speed_command) override {
void setRearRightWheelSpeed(const SpeedCommand& speed_command) override {

}

void set_front_left_wheel_angle(const AngleCommand& angle_command) override {
void setFrontLeftWheelAngle(const AngleCommand& angle_command) override {

}

void set_front_right_wheel_angle(const AngleCommand& angle_command) override {
void setFrontRightWheelAngle(const AngleCommand& angle_command) override {

}
private:
Expand Down

0 comments on commit daa2b6e

Please sign in to comment.