Simple change to keep values in range for now.

This commit is contained in:
2018-02-26 23:07:06 -08:00
parent 8cc7048b9e
commit b358919221

View File

@@ -175,8 +175,8 @@ class RoverDriveSender(QtCore.QThread):
def __update_and_publish(self): def __update_and_publish(self):
drive_message = DriveCommandMessage() drive_message = DriveCommandMessage()
drive_message.drive_twist.linear.x = -(self.joystick.controller_states["y_axis"] - 512) / 512.0 drive_message.drive_twist.linear.x = -(self.joystick.controller_states["y_axis"] - 512) / 1024.0
drive_message.drive_twist.angular.z = -(self.joystick.controller_states["z_axis"] - 128) / 128.0 drive_message.drive_twist.angular.z = -(self.joystick.controller_states["z_axis"] - 128) / 512.0
self.drive_command_publisher.publish(drive_message) self.drive_command_publisher.publish(drive_message)
# print self.joystick.controller_states["y_axis"], self.joystick.controller_states["z_axis"] # print self.joystick.controller_states["y_axis"], self.joystick.controller_states["z_axis"]