Brazo de 6 ejes#
Introducción#
El brazo robótico VEX de 6 ejes mueve un efector final en el espacio tridimensional, controla la orientación del efector final y funciona con herramientas acopladas, como la herramienta de recogida magnética o la herramienta de sujeción de bolígrafos.
A continuación se muestra una lista de todos los métodos disponibles:
Acciones: Mueva el brazo de 6 ejes a posiciones u orientaciones.
move_to— Moves the end effector to a specified x, y, and z coordinate.move_inc— Moves the end effector by a specified distance from its current position.move_end_effector_to— Rotates the end effector to a specified yaw, roll, and pitch orientation.move_end_effector_inc— Rotates the end effector by a specified yaw, roll, and pitch amount.
Motadores: configura el movimiento, las herramientas y los ajustes de control.
set_speed— Sets the movement speed used by the 6-Axis Arm.set_end_effector_type— Sets the type of end effector attached to the 6-Axis Arm.set_end_effector_magnet— Engages or releases the Magnet Pickup Tool.set_pen_offset— Sets the z-axis offset used with the Pen Holder Tool.set_control_stop— Enables control stop for the 6-Axis Arm.set_timeout— Sets the timeout used by 6-Axis Arm movement methods.
Obtenedores: Devuelven el estado del movimiento, la posición, la orientación y los valores de conexión.
is_done— Returns whether the 6-Axis Arm has finished moving.get_x— Returns the current x position of the end effector.get_y— Returns the current y position of the end effector.get_z— Returns the current z position of the end effector.get_pitch— Returns the current pitch of the end effector.get_roll— Returns the current roll of the end effector.get_yaw— Returns the current yaw of the end effector.can_arm_reach_to— Returns whether the 6-Axis Arm can reach a specified position.can_arm_reach_inc— Returns whether the 6-Axis Arm can move by a specified distance.can_end_effector_reach_to— Returns whether the end effector can reach a specified orientation.can_end_effector_reach_inc— Returns whether the end effector can rotate by a specified amount.get_timeout— Returns the current timeout value used by movement methods.is_connected— Returns whether the 6-Axis Arm is connected to the Brain.
Funciones de devolución de llamada: ejecutan funciones cuando ocurren eventos en el brazo.
control_stopped— Registers a function to run when control stop is enabled.
Constructor: crea manualmente un objeto de brazo de 6 ejes.
Arm— Creates a 6-Axis Arm object.
Esta página sirve para usar el brazo de 6 ejes de forma independiente con el módulo CTE. Para usar el brazo de 6 ejes con otros componentes de la celda de trabajo CTE, como sistemas neumáticos o transportadores, conecte el brazo de 6 ejes a un módulo EXP y utilice la página EXP Arm correspondiente.
Comportamiento#
move_to#
move_to moves the 6-Axis Arm to a specified x, y, and z coordinate.
The x, y, and z coordinates describe the position of the end effector in three-dimensional space. Use can_arm_reach_to before this method if the target position may be outside the 6-Axis Arm’s reachable workspace.
Usage:
arm.move_to(x, y, z, wait)
Parámetro |
Descripción |
|---|---|
|
La coordenada x de la posición objetivo en milímetros. |
|
La coordenada y de la posición objetivo en milímetros. |
|
La coordenada z de la posición objetivo en milímetros. |
|
Optional. |
# Move the 6-Axis Arm to (40, 140, 210)
arm.move_to(40, 140, 210)
# Start moving, then print the y-position while the arm moves
arm.move_to(-100, 200, 100, wait=False)
while not arm.is_done():
brain.print(arm.get_y())
brain.next_line()
wait(0.25, SECONDS)
move_inc#
move_inc moves the 6-Axis Arm by a specified distance from its current position along the x, y, and z axes.
Use this method to move relative to where the end effector is now. Use can_arm_reach_inc before this method if the movement may place the 6-Axis Arm outside its reachable workspace.
Usage:
arm.move_inc(x, y, z, wait)
Parámetro |
Descripción |
|---|---|
|
La distancia a recorrer a lo largo del eje x en milímetros. |
|
La distancia a recorrer a lo largo del eje y en milímetros. |
|
La distancia a recorrer a lo largo del eje z en milímetros. |
|
Optional. |
# Move the 6-Axis Arm 100 millimeters along the y-axis
arm.move_inc(0, 100, 0)
move_end_effector_to#
move_end_effector_to rotates the 6-Axis Arm’s end effector to a specified yaw, roll, and pitch orientation.
Orientation describes how the end effector is rotated. yaw rotates around the z-axis, roll rotates around the x-axis, and pitch rotates around the y-axis.
Usage:
arm.move_end_effector_to(yaw, roll, pitch, wait)
Parámetro |
Descripción |
|---|---|
|
El ángulo de guiñada objetivo, en grados. |
|
El ángulo de balanceo objetivo, en grados. |
|
El ángulo de cabeceo objetivo, en grados. |
|
Optional. |
# Rotate the end effector to 90 degrees of roll
arm.move_end_effector_to(0, 90, 0)
move_end_effector_inc#
move_end_effector_inc rotates the 6-Axis Arm’s end effector by a specified yaw, roll, and pitch amount from its current orientation.
Utilice este método para rotar en relación con el guiñada, el balanceo o la inclinación actuales del efector final.
Usage:
arm.move_end_effector_inc(yaw, roll, pitch, wait)
Parámetro |
Descripción |
|---|---|
|
El cambio en la guiñada, en grados. |
|
El cambio de balanceo, en grados. |
|
El cambio de tono, en grados. |
|
Optional. |
# Rotate the end effector -50 degrees in pitch
arm.move_end_effector_inc(0, 0, -50)
Mutadores#
set_speed#
set_speed sets the movement speed used by the 6-Axis Arm for movement methods.
La velocidad del brazo de 6 ejes se ajusta al 50 % al inicio de un proyecto.
Usage:
arm.set_speed(speed)
Parámetro |
Descripción |
|---|---|
|
The movement speed of the 6-Axis Arm, from |
# Set the 6-Axis Arm speed to 30%
arm.set_speed(30)
set_end_effector_type#
set_end_effector_type sets the type of end effector attached to the 6-Axis Arm.
When the end effector type is changed, the 6-Axis Arm automatically adjusts its z-offset to match the selected tool. The end effector type is set to MAGNET at the start of a project.
Usage:
arm.set_end_effector_type(type)
Parámetro |
Descripción |
|---|---|
|
The tool attached to the 6-Axis Arm: |
# Set the end effector type to the Pen Holder Tool
arm.set_end_effector_type(PEN)
set_end_effector_magnet#
set_end_effector_magnet engages or releases the Magnet Pickup Tool.
The magnet state stays active until another set_end_effector_magnet method changes it. The magnet state is reset to False at the start of a project.
Usage:
arm.set_end_effector_magnet(state)
Parámetro |
Descripción |
|---|---|
|
The Magnet Pickup Tool state: |
# Pick up objects and then drop them
arm.set_end_effector_type(MAGNET)
arm.set_end_effector_magnet(True)
wait(2, SECONDS)
arm.set_end_effector_magnet(False)
set_pen_offset#
set_pen_offset sets the z-axis offset used when the Pen Holder Tool is attached to the 6-Axis Arm.
Set the end effector type to PEN before using this method. If the Pen Holder Tool is not selected, this method has no effect.
The pen offset is the distance from the top of the Pen Holder Tool to the tip of the Dry-Erase Marker. At the start of a project, the pen offset is set to 0. A pen offset of 0 places the arm’s z-axis origin at the point where the Pen Holder Tool connects to the 6-Axis Arm.
Usage:
arm.set_pen_offset(zOffset)
Parámetro |
Descripción |
|---|---|
|
Valor de desplazamiento del lápiz en milímetros. |
# Set the end effector type to the Pen Holder Tool and set the pen offset
arm.set_end_effector_type(PEN)
arm.set_pen_offset(25)
set_control_stop#
set_control_stop enables control stop for the 6-Axis Arm.
Cuando se habilita la parada de control, el brazo de 6 ejes detiene inmediatamente cualquier movimiento y no ejecutará ningún otro método de movimiento del brazo hasta que se reinicie el proyecto.
Usage:
arm.set_control_stop(state)
Parámetro |
Descripción |
|---|---|
|
Optional. |
# Stop the 6-Axis Arm and prevent further movement
arm.set_control_stop()
set_timeout#
set_timeout sets the timeout value used when moving the 6-Axis Arm.
Si un movimiento no finaliza antes de que se agote el tiempo de espera, el proyecto continúa con la siguiente línea de código.
Usage:
arm.set_timeout(timeout, units)
Parámetro |
Descripción |
|---|---|
|
El nuevo valor de tiempo de espera. |
|
Optional. The time unit: |
# Set the 6-Axis Arm timeout to 2 seconds
arm.set_timeout(2, SECONDS)
Getters#
is_done#
is_done returns whether the 6-Axis Arm has finished moving.
This method is useful after a movement method is called with wait=False.
True— The 6-Axis Arm has finished moving.False— The 6-Axis Arm is still moving.
Usage:
arm.is_done()
Parámetros |
Descripción |
|---|---|
Este método no tiene parámetros. |
# Display the 6-Axis Arm's y-position while it moves
arm.move_to(-100, 200, 100, wait=False)
while not arm.is_done():
brain.print(arm.get_y())
brain.next_line()
wait(0.25, SECONDS)
get_x#
get_x returns the current x position of the end effector in millimeters.
Utilice este método para leer la posición actual del efector final a lo largo del eje x.
Usage:
arm.get_x()
Parámetros |
Descripción |
|---|---|
Este método no tiene parámetros. |
# Print the current x position of the 6-Axis Arm
brain.print(arm.get_x())
get_y#
get_y returns the current y position of the end effector in millimeters.
Utilice este método para leer la posición actual del efector final a lo largo del eje Y.
Usage:
arm.get_y()
Parámetros |
Descripción |
|---|---|
Este método no tiene parámetros. |
# Print the current y position of the 6-Axis Arm
brain.print(arm.get_y())
get_z#
get_z returns the current z position of the end effector in millimeters.
Utilice este método para leer la posición actual del efector final a lo largo del eje z.
Usage:
arm.get_z()
Parámetros |
Descripción |
|---|---|
Este método no tiene parámetros. |
# Print the current z position of the 6-Axis Arm
brain.print(arm.get_z())
get_pitch#
get_pitch returns the current pitch of the end effector in degrees.
Usage:
arm.get_pitch()
Parámetros |
Descripción |
|---|---|
Este método no tiene parámetros. |
# Print the current pitch of the end effector
brain.print(arm.get_pitch())
get_roll#
get_roll returns the current roll of the end effector in degrees.
Usage:
arm.get_roll()
Parámetros |
Descripción |
|---|---|
Este método no tiene parámetros. |
# Print the current roll of the end effector
brain.print(arm.get_roll())
get_yaw#
get_yaw returns the current yaw of the end effector in degrees.
Usage:
arm.get_yaw()
Parámetros |
Descripción |
|---|---|
Este método no tiene parámetros. |
# Print the current yaw of the end effector
brain.print(arm.get_yaw())
can_arm_reach_to#
can_arm_reach_to returns whether the 6-Axis Arm can move the end effector to a specified x, y, and z coordinate.
Use this method to check a target position before using move_to.
True— The 6-Axis Arm can reach the requested position.False— The 6-Axis Arm cannot reach the requested position.
Usage:
arm.can_arm_reach_to(x, y, z)
Parámetro |
Descripción |
|---|---|
|
La coordenada x de la posición objetivo en milímetros. |
|
La coordenada y de la posición objetivo en milímetros. |
|
La coordenada z de la posición objetivo en milímetros. |
# Move the 6-Axis Arm to (100, -20, 50) if it can reach
if arm.can_arm_reach_to(100, -20, 50):
arm.move_to(100, -20, 50)
can_arm_reach_inc#
can_arm_reach_inc returns whether the 6-Axis Arm can move the end effector by a specified x, y, and z distance from its current position.
Use this method to check a relative movement before using move_inc.
True— The 6-Axis Arm can make the requested movement.False— The 6-Axis Arm cannot make the requested movement.
Usage:
arm.can_arm_reach_inc(x, y, z)
Parámetro |
Descripción |
|---|---|
|
La distancia a recorrer a lo largo del eje x en milímetros. |
|
La distancia a recorrer a lo largo del eje y en milímetros. |
|
La distancia a recorrer a lo largo del eje z en milímetros. |
# Increment the 6-Axis Arm 100 mm along the x-axis if possible
if arm.can_arm_reach_inc(100, 0, 0):
arm.move_inc(100, 0, 0)
can_end_effector_reach_to#
can_end_effector_reach_to returns whether the end effector can rotate to a specified yaw, roll, and pitch orientation.
Use this method to check a target orientation before using move_end_effector_to.
True— The end effector can reach the requested orientation.False— The end effector cannot reach the requested orientation.
Usage:
arm.can_end_effector_reach_to(yaw, roll, pitch)
Parámetro |
Descripción |
|---|---|
|
El ángulo de guiñada objetivo, en grados. |
|
El ángulo de balanceo objetivo, en grados. |
|
El ángulo de cabeceo objetivo, en grados. |
# Rotate the end effector to 90 degrees of roll if possible
if arm.can_end_effector_reach_to(0, 90, 0):
arm.move_end_effector_to(0, 90, 0)
can_end_effector_reach_inc#
can_end_effector_reach_inc returns whether the end effector can rotate by a specified yaw, roll, and pitch amount from its current orientation.
Use this method to check a relative orientation movement before using move_end_effector_inc.
True— The end effector can make the requested rotation.False— The end effector cannot make the requested rotation.
Usage:
arm.can_end_effector_reach_inc(yaw, roll, pitch)
Parámetro |
Descripción |
|---|---|
|
El cambio en la guiñada, en grados. |
|
El cambio de balanceo, en grados. |
|
El cambio de tono, en grados. |
# Increment the end effector by 10 degrees of pitch if possible
if arm.can_end_effector_reach_inc(0, 0, 10):
arm.move_end_effector_inc(0, 0, 10)
get_timeout#
get_timeout returns the timeout value used by 6-Axis Arm movement methods in milliseconds.
Usage:
arm.get_timeout()
Parámetros |
Descripción |
|---|---|
Este método no tiene parámetros. |
# Print the current movement timeout in milliseconds
brain.print(arm.get_timeout())
is_connected#
is_connected returns whether the 6-Axis Arm is connected to the Brain.
True— The 6-Axis Arm is connected to the Brain.False— The 6-Axis Arm is not connected to the Brain.
Usage:
arm.is_connected()
Parámetros |
Descripción |
|---|---|
Este método no tiene parámetros. |
# Print whether the 6-Axis Arm is connected
brain.print(arm.is_connected())
Devoluciones de llamada#
control_stopped#
control_stopped registers a function that runs when control stop is enabled.
This method returns an instance of the Event class.
Usage:
arm.control_stopped(callback, arg)
Parámetro |
Descripción |
|---|---|
|
Una función definida previamente que se ejecuta cuando se habilita la parada de control. |
|
Opcional. Una tupla que contiene los argumentos que se pasarán a la función de devolución de llamada. Consulte Uso de funciones con parámetros para obtener más información. |
# Define a function to run when control stop is enabled
def when_control_stopped():
brain.print("The arm has been control stopped")
# Run when_control_stopped when the 6-Axis Arm is control stopped
arm.control_stopped(when_control_stopped)
Constructores#
Arm#
Arm creates a 6-Axis Arm object.
Usage:
Arm()
Parámetros |
Descripción |
|---|---|
Este constructor no tiene parámetros. |
# Construct a 6-Axis Arm named arm with the Arm class
arm = Arm()