Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #17 from purduesigbots/T971-turn-bug
Browse files Browse the repository at this point in the history
Change turn to velocity, minor bugfixes, make new template
  • Loading branch information
Marsgate authored Nov 5, 2020
2 parents afabbdb + 361daa6 commit 8228082
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Binary file removed [email protected]
Binary file not shown.
Binary file added [email protected]
Binary file not shown.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ EXCLUDE_COLD_LIBRARIES:=
IS_LIBRARY:=1

LIBNAME:=ARMS
VERSION:=1.1.2
VERSION:=1.1.3
# EXCLUDE_SRC_FROM_LIB= $(SRCDIR)/unpublishedfile.c
# this line excludes opcontrol.c and similar files
EXCLUDE_SRC_FROM_LIB+=$(foreach file, $(SRCDIR)/main,$(foreach cext,$(CEXTS),$(file).$(cext)) $(foreach cxxext,$(CXXEXTS),$(file).$(cxxext)))
Expand Down
8 changes: 4 additions & 4 deletions src/ARMS/chassis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ int difference() {
right_pos = rightMotors->getPosition();
}

return (mode == ANGULAR ? 0 : left_pos - right_pos);
return (mode == ANGULAR ? 0 : (left_pos - right_pos));
}

/**************************************************/
Expand Down Expand Up @@ -177,7 +177,7 @@ bool isDriving() {
int curr = position();

int target = turnTarget;
if (mode == ANGULAR)
if (mode == LINEAR)
target = linearTarget;

if (abs(last - curr) < 3)
Expand Down Expand Up @@ -507,8 +507,8 @@ int chassisTask() {
} else {
int dif = difference() * difKP;

motorVoltage(leftMotors, (speed - dif) * mode);
motorVoltage(rightMotors, speed + dif);
motorVelocity(leftMotors, (speed - dif) * mode);
motorVelocity(rightMotors, speed + dif);
}
}
}
Expand Down

0 comments on commit 8228082

Please sign in to comment.