Skip to content

Commit c6e20d3

Browse files
authored
[andino_firmware] Fix several formatting and style linting issues (#328)
Signed-off-by: Javier Balloffet <javier.balloffet@gmail.com>
1 parent 9bca4b8 commit c6e20d3

23 files changed

Lines changed: 131 additions & 64 deletions

andino_firmware/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ A serial port connection must be created at 57600 bauds. You can use the serial
7676
| `o` | Set open-loop speed for the motors[pwm] | left_pwm right_pwm | `o 255 255` | |
7777
| `u` | Set PID values | kp kd ki offset | `u 1.0 0.1 0.01 0` | |
7878
| `h` | Get if IMU is connected | | `h` | `0` if not connected, `1` if connected |
79-
| `i` | Get IMU data and encoder tick values | | `i` | `<left> <right> <orientation_X> <orientation_Y> <orientation_Z> <orientation_W> <angular_velocity_X> <angular_velocity_Y> <angular_velocity_Z> <linear_acceleration_X> <linear_acceleration_Y> <linear_acceleration_Z>` |
79+
| `i` | Get IMU data and encoder tick values | | `i` | `<left> <right> <orientation_X> <orientation_Y> <orientation_Z> <orientation_W> <angular_velocity_X> <angular_velocity_Y> <angular_velocity_Z> <linear_acceleration_X> <linear_acceleration_Y> <linear_acceleration_Z>` |

andino_firmware/docker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The Docker Compose configuration is set up with:
5454
- `/dev:/dev` mount
5555
- `network_mode: host`
5656

57-
This allows the container full access to USB devices connected to the host machine.
57+
This allows the container full access to USB devices connected to the host machine.
5858

5959
To upload/flash your firmware to the Arduino board:
6060

andino_firmware/include/andino/app/app.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@
3131

3232
#include <Adafruit_BNO055.h>
3333

34-
#include "andino/hal/serial_stream.h"
35-
#include "andino/hal/clock.h"
36-
#include "andino/hal/digital_out.h"
37-
#include "andino/hal/pwm_out.h"
38-
#include "andino/hal/interrupt_in.h"
39-
#include "andino/drivers/motor.h"
40-
#include "andino/drivers/encoder.h"
4134
#include "andino/app/constants.h"
4235
#include "andino/app/pid.h"
4336
#include "andino/app/shell.h"
37+
#include "andino/drivers/encoder.h"
38+
#include "andino/drivers/motor.h"
39+
#include "andino/hal/clock.h"
40+
#include "andino/hal/digital_out.h"
41+
#include "andino/hal/interrupt_in.h"
42+
#include "andino/hal/pwm_out.h"
43+
#include "andino/hal/serial_stream.h"
4444

4545
namespace andino {
4646

@@ -64,11 +64,10 @@ class App {
6464
* @param right_encoder_b The right encoder channel B interrupt input.
6565
* @param bno055_imu The Adafruit BNO055 IMU sensor.
6666
*/
67-
App(const Clock& clock, SerialStream& serial_stream,
68-
DigitalOut& left_motor_enable, PwmOut& left_motor_forward, PwmOut& left_motor_backward,
69-
DigitalOut& right_motor_enable, PwmOut& right_motor_forward, PwmOut& right_motor_backward,
70-
InterruptIn& left_encoder_a, InterruptIn& left_encoder_b,
71-
InterruptIn& right_encoder_a, InterruptIn& right_encoder_b,
67+
App(const Clock& clock, SerialStream& serial_stream, DigitalOut& left_motor_enable,
68+
PwmOut& left_motor_forward, PwmOut& left_motor_backward, DigitalOut& right_motor_enable,
69+
PwmOut& right_motor_forward, PwmOut& right_motor_backward, InterruptIn& left_encoder_a,
70+
InterruptIn& left_encoder_b, InterruptIn& right_encoder_a, InterruptIn& right_encoder_b,
7271
Adafruit_BNO055& bno055_imu)
7372
: clock_(clock),
7473
serial_stream_(serial_stream),
@@ -78,9 +77,10 @@ class App {
7877
right_encoder_(&right_encoder_a, &right_encoder_b),
7978
bno055_imu_(bno055_imu),
8079
left_pid_controller_(Constants::kPidKp, Constants::kPidKd, Constants::kPidKi,
81-
Constants::kPidKo, -Constants::kPwmMax, Constants::kPwmMax),
80+
Constants::kPidKo, -Constants::kPwmMax, Constants::kPwmMax),
8281
right_pid_controller_(Constants::kPidKp, Constants::kPidKd, Constants::kPidKi,
83-
Constants::kPidKo, -Constants::kPwmMax, Constants::kPwmMax) {}
82+
Constants::kPidKo, -Constants::kPwmMax, Constants::kPwmMax) {
83+
}
8484

8585
// Delete copy and move operations to enforce unique reference ownership.
8686
App(const App&) = delete;

andino_firmware/include/andino/app/pid.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ class Pid {
4343
/// @param output_min Output minimum limit.
4444
/// @param output_max Output maximum limit.
4545
Pid(int kp, int kd, int ki, int ko, int output_min, int output_max)
46-
: kp_(kp), kd_(kd), ki_(ki), ko_(ko), output_min_(output_min), output_max_(output_max) {}
46+
: kp_(kp), kd_(kd), ki_(ki), ko_(ko), output_min_(output_min), output_max_(output_max) {
47+
}
4748

4849
/// @brief Resets the PID controller.
4950
///

andino_firmware/include/andino/bsp/digital_out_arduino.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ class DigitalOutArduino : public DigitalOut {
3939
/// @brief Constructs a DigitalOutArduino using the specified GPIO pin.
4040
///
4141
/// @param gpio_pin GPIO pin.
42-
explicit DigitalOutArduino(const int gpio_pin) : gpio_pin_(gpio_pin) {}
42+
explicit DigitalOutArduino(const int gpio_pin) : gpio_pin_(gpio_pin) {
43+
}
4344

4445
void begin() const override;
4546

andino_firmware/include/andino/bsp/interrupt_in_arduino.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ class InterruptInArduino : public InterruptIn {
3939
/// @brief Constructs a InterruptInArduino using the specified GPIO pin.
4040
///
4141
/// @param gpio_pin GPIO pin.
42-
explicit InterruptInArduino(const int gpio_pin) : gpio_pin_(gpio_pin) {}
42+
explicit InterruptInArduino(const int gpio_pin) : gpio_pin_(gpio_pin) {
43+
}
4344

4445
void begin() const override;
4546

andino_firmware/include/andino/bsp/pwm_out_arduino.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ class PwmOutArduino : public PwmOut {
3939
/// @brief Constructs a PwmOutArduino using the specified GPIO pin.
4040
///
4141
/// @param gpio_pin GPIO pin.
42-
explicit PwmOutArduino(const int gpio_pin) : gpio_pin_(gpio_pin) {}
42+
explicit PwmOutArduino(const int gpio_pin) : gpio_pin_(gpio_pin) {
43+
}
4344

4445
void begin() const override;
4546

andino_firmware/include/andino/bsp/serial_stream_arduino.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ namespace andino {
3939
class SerialStreamArduino : public SerialStream {
4040
public:
4141
/// @brief Constructs a SerialStreamArduino.
42-
explicit SerialStreamArduino() : SerialStream() {}
42+
explicit SerialStreamArduino() : SerialStream() {
43+
}
4344

4445
void begin(unsigned long baud) const override;
4546

andino_firmware/include/andino/drivers/encoder.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ class Encoder {
8181
/// @param channel_b_interrupt_in Digital interrupt input connected to encoder channel B pin.
8282
Encoder(const InterruptIn* channel_a_interrupt_in, const InterruptIn* channel_b_interrupt_in)
8383
: channel_a_interrupt_in_(channel_a_interrupt_in),
84-
channel_b_interrupt_in_(channel_b_interrupt_in) {}
84+
channel_b_interrupt_in_(channel_b_interrupt_in) {
85+
}
8586

8687
/// @brief Initializes the encoder.
8788
void begin();

andino_firmware/include/andino/drivers/motor.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ class Motor {
8383
const PwmOut* backward_pwm_out)
8484
: enable_digital_out_(enable_digital_out),
8585
forward_pwm_out_(forward_pwm_out),
86-
backward_pwm_out_(backward_pwm_out) {}
86+
backward_pwm_out_(backward_pwm_out) {
87+
}
8788

8889
/// @brief Initializes the motor.
8990
void begin();

0 commit comments

Comments
 (0)