Skip to content

Commit 2523794

Browse files
pabnassantiago barragan
andauthored
Issue#305 (#306)
Signed-off-by: Santiago Barragan <sbarraganp19@gmail.com> Co-authored-by: santiago barragan <santiago.barragan@ekumenlabs.com>
1 parent f7af556 commit 2523794

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

andino_firmware/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,17 @@ A serial port connection must be created at 57600 bauds. You can use the serial
6363

6464
* Closed loop verification
6565
- Send `m <tps> <tps>` where `tps` stands for `ticks per second`. For example if your motor-encoder system gets 700 ticks per revolution then sending `m 700 700` will rotate both motors at 1 rev per sec. (~3.14rad/sec)
66+
67+
## Commands
68+
69+
| Command | Description | Args | Example | Result |
70+
| --- | --- | --- | --- | --- |
71+
| `a` | Read Analog GPIO pin | pin_number | `a 0` | |
72+
| `d` | Read Digital GPIO pin | pin_number | `d 2` | |
73+
| `e` | Get encoder tick values | | `e` | `<left> <right>` |
74+
| `r` | Reset encoder values | | `r` | |
75+
| `m` | Set closed-loop speed for the motors[ticks/sec] | left_tps right_tps | `m 700 700` | |
76+
| `o` | Set open-loop speed for the motors[pwm] | left_pwm right_pwm | `o 255 255` | |
77+
| `u` | Set PID values | kp kd ki offset | `u 1.0 0.1 0.01 0` | |
78+
| `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>` |

andino_firmware/src/app.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ void App::cmd_set_motors_pwm_cb(int argc, char** argv) {
278278
// Sneaky way to temporarily disable the PID.
279279
left_pid_controller_.disable();
280280
right_pid_controller_.disable();
281+
282+
// Reset the auto stop timer.
283+
last_set_motors_speed_cmd_ = millis();
284+
281285
left_motor_.set_speed(left_motor_pwm);
282286
right_motor_.set_speed(right_motor_pwm);
283287
Serial.println("OK");

0 commit comments

Comments
 (0)