-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completed Tele-op Pipeline #8
base: main
Are you sure you want to change the base?
Conversation
322cdb5
to
0a8baf8
Compare
teleop main script barebones
415fa7e
to
9cdba8c
Compare
@@ -0,0 +1,82 @@ | |||
"""Barebones function for running tele-op tomorrow""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""Barebones function for running tele-op tomorrow""" | |
"""Tele-op script""" |
from kinematics.wrappers import translate_dir_to_motor_angles | ||
import serial.serialposix | ||
|
||
tare_timeout = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
units? add comment with unit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user_timeout
too
"""Helper function to initialize the required serial ports for tele-op | ||
|
||
Args: | ||
baudrate (int): Serial baudrate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
baudrate (int): Serial baudrate | |
baudrate (int): Serial baudrate | |
|
||
motor_serial.write(motor_output) | ||
|
||
def tare_motors(motor_serial: serial.Serial, zero_angles: tuple[float, float, float]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def tare_motors(motor_serial: serial.Serial, zero_angles: tuple[float, float, float]): | |
def tare_motors(motor_serial: serial.Serial, current_angles: tuple[float, float, float]): |
|
||
Args: | ||
motor_serial (Serial): Object representing the serial communication to the motor | ||
zero_angles (tuple of 3 floats, (motorA, motorB, motorC)): Angles of the motors' current position (rad) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zero_angles (tuple of 3 floats, (motorA, motorB, motorC)): Angles of the motors' current position (rad) | |
current_angles: (tuple of 3 floats, (motorA, motorB, motorC)): Angles of the motors' current position (rad) |
State of motor tare operation: True if Tare successful and false if unsuccessful | ||
""" | ||
# Tare motors given a tuple of angles | ||
send_encoded_motor_commands(motor_serial, 't', (zero_angles)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
send_encoded_motor_commands(motor_serial, 't', (zero_angles)) | |
send_encoded_motor_commands(motor_serial, 't', (current_angles)) |
return False | ||
|
||
def wait_for_user(joystick_serial: serial.Serial): | ||
"""Blocking funciton to wait for user start""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add in specifically waiting for joystick press
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in comments
Initial working test of tele-op