Made pistol grip controller work with the drivetrain.
Change-Id: Id5ede34e9a9981c338aaa6118eb5085578a8ecd3
diff --git a/frc971/autonomous/base_autonomous_actor.cc b/frc971/autonomous/base_autonomous_actor.cc
index 5311810..abb91a7 100644
--- a/frc971/autonomous/base_autonomous_actor.cc
+++ b/frc971/autonomous/base_autonomous_actor.cc
@@ -30,7 +30,7 @@
drivetrain_queue.goal.MakeWithBuilder()
.control_loop_driving(false)
.highgear(true)
- .steering(0.0)
+ .wheel(0.0)
.throttle(0.0)
.left_goal(initial_drivetrain_.left)
.left_velocity_goal(0)
@@ -58,7 +58,7 @@
auto drivetrain_message = drivetrain_queue.goal.MakeMessage();
drivetrain_message->control_loop_driving = true;
drivetrain_message->highgear = true;
- drivetrain_message->steering = 0.0;
+ drivetrain_message->wheel = 0.0;
drivetrain_message->throttle = 0.0;
drivetrain_message->left_goal = initial_drivetrain_.left;
drivetrain_message->left_velocity_goal = 0;
diff --git a/frc971/control_loops/drivetrain/drivetrain.q b/frc971/control_loops/drivetrain/drivetrain.q
index 76f5ec6..a756ad2 100644
--- a/frc971/control_loops/drivetrain/drivetrain.q
+++ b/frc971/control_loops/drivetrain/drivetrain.q
@@ -40,10 +40,14 @@
message Goal {
// Position of the steering wheel (positive = turning left when going
// forwards).
- double steering;
+ double wheel;
+ double wheel_velocity;
+ double wheel_torque;
// Position of the throttle (positive forwards).
double throttle;
+ double throttle_velocity;
+ double throttle_torque;
// True to shift into high, false to shift into low.
bool highgear;
diff --git a/frc971/control_loops/drivetrain/drivetrain_lib_test.cc b/frc971/control_loops/drivetrain/drivetrain_lib_test.cc
index 5cc15d1..594d504 100644
--- a/frc971/control_loops/drivetrain/drivetrain_lib_test.cc
+++ b/frc971/control_loops/drivetrain/drivetrain_lib_test.cc
@@ -468,7 +468,7 @@
TEST_F(DrivetrainTest, OpenLoopThenClosed) {
my_drivetrain_queue_.goal.MakeWithBuilder()
.control_loop_driving(false)
- .steering(0.0)
+ .wheel(0.0)
.throttle(1.0)
.highgear(true)
.quickturn(false)
@@ -478,7 +478,7 @@
my_drivetrain_queue_.goal.MakeWithBuilder()
.control_loop_driving(false)
- .steering(0.0)
+ .wheel(0.0)
.throttle(-0.3)
.highgear(true)
.quickturn(false)
@@ -488,7 +488,7 @@
my_drivetrain_queue_.goal.MakeWithBuilder()
.control_loop_driving(false)
- .steering(0.0)
+ .wheel(0.0)
.throttle(0.0)
.highgear(true)
.quickturn(false)
diff --git a/frc971/control_loops/drivetrain/polydrivetrain.cc b/frc971/control_loops/drivetrain/polydrivetrain.cc
index f61083b..a842f50 100644
--- a/frc971/control_loops/drivetrain/polydrivetrain.cc
+++ b/frc971/control_loops/drivetrain/polydrivetrain.cc
@@ -108,7 +108,7 @@
void PolyDrivetrain::SetGoal(
const ::frc971::control_loops::DrivetrainQueue::Goal &goal) {
- const double wheel = goal.steering;
+ const double wheel = goal.wheel;
const double throttle = goal.throttle;
const bool quickturn = goal.quickturn;
const bool highgear = goal.highgear;