mirror of
https://github.com/OSURoboticsClub/Rover_2017_2018.git
synced 2025-11-08 10:11:14 +00:00
Inverted axes and set default values
This commit is contained in:
@@ -38,7 +38,7 @@ class LogitechJoystick(QtCore.QThread):
|
|||||||
|
|
||||||
self.controller_states = {
|
self.controller_states = {
|
||||||
"left_stick_x_axis": 0,
|
"left_stick_x_axis": 0,
|
||||||
"y_axis": 0,
|
"y_axis": 512,
|
||||||
"left_stick_center_pressed": 0,
|
"left_stick_center_pressed": 0,
|
||||||
|
|
||||||
"right_stick_x_axis": 0,
|
"right_stick_x_axis": 0,
|
||||||
@@ -48,7 +48,7 @@ class LogitechJoystick(QtCore.QThread):
|
|||||||
"left_trigger_z_axis": 0,
|
"left_trigger_z_axis": 0,
|
||||||
"left_bumper_pressed": 0,
|
"left_bumper_pressed": 0,
|
||||||
|
|
||||||
"z_axis": 0,
|
"z_axis": 128,
|
||||||
"right_bumper_pressed": 0,
|
"right_bumper_pressed": 0,
|
||||||
|
|
||||||
"dpad_x": 0,
|
"dpad_x": 0,
|
||||||
@@ -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) / 512.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) / 128.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"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user