Skip to content

Commit 7106666

Browse files
committed
fix Motor::setAngle
1 parent 649b750 commit 7106666

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hardware/Motor/Motor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ int Motor::setAngle(Angle angle) {
107107
// get the raw position
108108
const int ticks = pros::c::motor_get_raw_position(m_port, NULL);
109109
if (ticks == INT_MAX) return INT_MAX;
110-
// get the number of times the motor rotated
111-
const Angle raw = from_stRot(ticks / 3600.0);
110+
// get the number of times the internal motor rotated
111+
const Angle raw = from_stRot(ticks / 50.0);
112112
// calculate position after using the gear ratio
113113
const Angle position = raw * (m_outputVelocity / 3600_rpm);
114114
// calculate offset

0 commit comments

Comments
 (0)