Skip to content
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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Completed Tele-op Pipeline #8

wants to merge 13 commits into from

Conversation

vxncent1
Copy link
Collaborator

@vxncent1 vxncent1 commented Nov 10, 2024

Initial working test of tele-op

@@ -0,0 +1,82 @@
"""Barebones function for running tele-op tomorrow"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""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
Copy link
Collaborator

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

Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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]):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"""
Copy link
Collaborator

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants