-
Notifications
You must be signed in to change notification settings - Fork 1
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
Low-code refactorization #20
Comments
Record positionsThis feature is possible using the def record_state(self, state):
"""Record a new state for the arm and gripper"""
print(f"Recording state: {state}")
self.arm.set_mode(2) # Joint teaching mode
self.arm.set_state(0)
print("The arm is now in MANUAL mode, press enter to record the position...")
input() Then, the user is guided by the terminal to save the desired state in print("Do you want to record a joint or lineal position? (J/L)")
movement_type = input()
if movement_type.upper() == "J": # Joint position
joint_position = self.arm.get_servo_angle()
print("Joint position recorded, paste the following line in the ARM_STATES dictionary:")
print(f"\"{state}\": [\"Y\", \"J\", {joint_position[1][0]}, {joint_position[1][1]}, {joint_position[1][2]}, {joint_position[1][3]}, {joint_position[1][4]}, {joint_position[1][5]}, 10],")
elif movement_type.upper() == "L": # Lineal position
print("Which is the desired TCP, board or wire gripper? (B/W)")
desired_tcp = input()
if desired_tcp.upper() == "B":
self.arm.set_tcp_offset(BOARD_TCP)
elif desired_tcp.upper() == "W":
self.arm.set_tcp_offset(WIRE_TCP)
else:
self.arm.set_tcp_offset([0,0,0,0,0,0])
lineal_position = self.arm.get_position()
print("Lineal position recorded, paste the following line in the ARM_STATES dictionary:")
print(f"\"{state}\": [\"Y\", \"L\", {lineal_position[1][0]}, {lineal_position[1][1]}, {lineal_position[1][2]}, {lineal_position[1][3]}, {lineal_position[1][4]}, {lineal_position[1][5]}, 10, \"{desired_tcp.upper()}\"],") An element to add to the dictionary is displayed in the terminal to be copied and pasted. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Refactorization of the main code implementation for easier use by mechatronic engineering students.
Goals:
The text was updated successfully, but these errors were encountered: