Brazo#

Inicializando la clase Arm#

Un brazo de 6 ejes se crea utilizando el siguiente constructor:

Arm

Este constructor no utiliza parámetros.

# Construct a 6-Axis Arm "arm" with the
# Arm class.
arm = Arm()

This arm object will be used in all subsequent examples throughout this API documentation when referring to Arm class methods.

Métodos de clase#

move_to()#

The move_to(x, y, z, wait) method moves the End Effector to the requested X, Y, and Z absolute position.

This can be a waiting or non-waiting method depending on if the wait parameter is used.

Parámetros

Descripción

x

La coordenada x a la que moverse, en milímetros.

y

La coordenada y a la que moverse, en milímetros.

z

La coordenada z a la que moverse, en milímetros.

wait

Optional. The wait parameter determines whether the method will block subsequent method (wait=True) or allow immediate execution (wait=False). If unspecified, the default for the wait parameter is wait==True.

Returns: True if the 6-Axis Arm has moved to the requested position when wait is True. False if it did not.

# Move the Arm to (40, 140, 210).
arm.move_to(40, 140, 210)

move_inc()#

The move_inc(x, y, z, wait) method moves the End Effector by the requested X, Y, and Z distances.

This can be a waiting or non-waiting method depending on if the wait parameter is used.

Parámetros

Descripción

x

La distancia en el eje x a recorrer, en milímetros.

y

La distancia en el eje y a recorrer, en milímetros.

z

La distancia en el eje z a mover, en milímetros.

wait

Optional. The wait parameter determines whether the method will block subsequent method (wait=True) or allow immediate execution (wait=False). If unspecified, the default for the wait parameter is wait==True.

Returns: True if the 6-Axis Arm has moved to the requested position when wait is True. False if it did not.

# Move the Arm +100 millimeters on the y axis.
arm.move_inc(0, 100, 0)

move_end_effector_to()#

The move_end_effector_to(yaw, roll, pitch, wait) method moves the End Effector to the requested absolute yaw, roll, and pitch orientation.

This can be a waiting or non-waiting method depending on if the wait parameter is used.

Parámetros

Descripción

yaw

El ángulo alrededor del eje z al que debe apuntar el efector final, en grados.

roll

El ángulo alrededor del eje x al que debe apuntar el efector final, en grados.

pitch

El ángulo alrededor del eje y al que debe apuntar el efector final, en grados.

wait

Optional. The wait parameter determines whether the method will block subsequent method (wait=True) or allow immediate execution (wait=False). If unspecified, the default for the wait parameter is wait==True.

Returns: True if the End Effector has moved to the requested orientation when wait is True. False if it has not.

# Orient the End Effector to point towards 
# 90 degrees around the x axis.
arm.move_end_effector_to(0, 90, 0)

move_end_effector_inc()#

The move_end_effector_inc(yaw, roll, pitch, wait) method moves the End Effector to the requested relative yaw, roll, and pitch orientation.

This can be a waiting or non-waiting method depending on if the wait parameter is used.

Parámetros

Descripción

yaw

El ángulo alrededor del eje z en el que debe cambiar el efector final, en grados.

roll

El ángulo alrededor del eje x en el que debe cambiar el efector final, en grados.

pitch

El ángulo alrededor del eje y en el que debe cambiar el efector final, en grados.

wait

Optional. The wait parameter determines whether the method will block subsequent method (wait=True) or allow immediate execution (wait=False). If unspecified, the default for the wait parameter is wait==True.

Returns: True if the End Effector has moved to the requested orientation when wait is True. False if it has not.

# Orient the End Effector -50 degrees on the y axis.
arm.move_end_effector_inc(0, 0, -50)

set_speed()#

The set_speed(speed) method sets the speed for moves.

Parámetros

Descripción

speed

La velocidad a la que debe moverse el brazo de 6 ejes.

Devoluciones: Ninguna.

set_end_effector_type()#

The set_end_effector_type(type) method sets the End Effector type to magnet or pen.

Parámetros

Descripción

type

A valid EndEffectorType.

Returns: True if the requested type was set. False if it was not.

# Set the End Effector type to the Magnet Pickup Tool.
arm.set_end_effector_type(MAGNET)

set_end_effector_magnet()#

The set_end_effector_magnet(state) method sets the End Effector’s Magnet Pickup Tool to enabled or disabled.

Parámetros

Descripción

state

True to enable the Magnet Pickup Tool. False to disable it.

Devoluciones: Ninguna.

# Enable the Magnet Pickup Tool.
arm.set_end_effector_magnet(True)

set_pen_offset()#

The set_pen_offset(zOffset) method sets the Pen Hold Tool’s z axis offset.

Parámetros

Descripción

zOffset

The new offset in MM. A positive z value indicates up.

Devoluciones: Ninguna.

set_control_stop()#

The set_control_stop(state) method disables the Arm and places the joint motors in brake mode.

Si la parada de control está habilitada, no se podrá deshabilitar a menos que se reinicie todo el proyecto.

Parámetros

Descripción

estado

True to disable further linear or joint moves.

Devoluciones: Ninguna.

can_arm_reach_to()#

El método can_arm_reach_to(x, y, z) method checks if the End Effector can move to the requested X, Y, and Z absolute position.

Parameters

Description

x

The x coordinate to move to, in millimeters.

y

The y coordinate to move to, in millimeters.

z

The z coordinate to move to, in millimeters.

Returns: True if the Arm can move to the requested position. False if it cannot.

# Check if the Arm can move to the (100, -20, 50).
if arm.can_arm_reach_to(100, -20, 50):
    # Move the Arm to (100, -20, 50).
    arm.move_to(100, -20, 50)

can_arm_reach_inc()#

The can_arm_reach_inc(x, y, z) method checks if the End Effector can move to the requested X, Y, and Z relative position.

Parameters

Description

x

The distance on the x axis to move for, in millimeters.

y

The distance on the y axis to move for, in millimeters.

z

The distance on the z axis to move for, in millimeters.

Returns: True if the Arm can move to the requested position. False if it cannot.

# Check if the Arm can increment its position 
# +100 mm along the x axis.
if arm.can_arm_reach_inc(100, 0, 0):
    # Increment the Arm +100 mm along the x axis.
    arm.move_inc(100, 0, 0)

can_end_effector_reach_to()#

The can_end_effector_reach_to(yaw, roll, pitch) method checks if the End Effector can move to the requested absolute yaw, roll, and pitch orientation.

Parameters

Description

yaw

The angle around the z axis that the End Effector should point to, in degrees.

roll

The angle around the x axis that the End Effector should point to, in degrees.

pitch

The angle around the y axis that the End Effector should point to, in degrees.

Returns: True if the End Effector can move to the requested orientation. False if it cannot.

# Check If the arm can orient to 90 degrees on the x axis.
if arm.can_end_effector_reach_to(0, 90, 0):
    # Orient towards 90 degrees on the x axis.
    arm.move_end_effector_to(0, 90, 0)

can_end_effector_reach_inc()#

The can_end_effector_reach_inc(yaw, roll, pitch) method checks if the End Effector can move to the requested relative yaw, roll, and pitch orientation.

Parameters

Description

yaw

The angle around the z axis that the End Effector should change by, in degrees.

roll

The angle around the x axis that the End Effector should change by, in degrees.

pitch

The angle around the y axis that the End Effector should change by, in degrees.

Returns: True if the End Effector can move to the requested orientation. False if it cannot.

# Check if the End Effector can increment its orientation
# +10 degrees on the y axis.
if arm.can_end_effector_reach_inc(0, 0, 10):
    # Increment the End Effector by +10 degrees on the y axis.
    arm.move_end_effector_inc(0, 0, 10)

is_done()#

The is_done() method is used to check if the 6-Axis Arm is currently moving or not.

Returns: True if the 6-Axis Arm is currently performing a movement. False if it is not.

def main():
    # Move the Arm to (-100, 200, 100) and let subsequent 
    # methods execute.
    arm.move_to(-100, 200, 100, False)
    # Repeat the methods until the Arm is done moving.
    while not arm.is_done():
        # Print the Arm's current y position to the Brain's
        # screen every .25 seconds.
        brain.print(arm.get_y())
        brain.next_row()
        wait(0.25, SECONDS)

get_x()#

The get_x() method returns the x position of the End Effector.

Returns: The x position of the End Effector in MM.

def main():
    # Print the current x position of the Arm in millimeters.
    brain.print(arm.get_x())

get_y()#

The get_y() method returns the y position of the End Effector.

Returns: The y position of the End Effector in MM.

def main():
    # Print the current y position of the Arm in millimeters.
    brain.print(arm.get_y())

get_z()#

The get_z() method requests the z position of the End Effector.

Returns: The z position of the End Effector in MM.

def main():
    # Print the current z position of the Arm in millimeters.
    brain.print(arm.get_z())

get_pitch()#

The get_pitch() method requests the current pitch of the End Effector.

Returns: The current pitch of the End Effector in degrees.

def main():
    # Print the current pitch of the Arm in degrees.
    brain.print(arm.get_pitch())

get_roll()#

The get_roll() method requests the current roll of the End Effector.

Returns: The current roll of the End Effector in degrees.

def main():
    # Print the current roll of the Arm in degrees.
    brain.print(arm.get_roll())

get_yaw()#

The get_yaw() method requests the current yaw of the End Effector.

Returns: The current yaw of the End Effector in degrees.

def main():
    # Print the current yaw of the Arm in degrees.
    brain.print(arm.get_yaw())