Βραχίονας CTE#

Εισαγωγή#

The arm class provides control for the 6-Axis Arm used in the CTE Workcell. In VEX V5 C++, the 6-Axis Arm can move an end effector to positions in three-dimensional space, rotate the end effector, check whether movements are possible, and control attached tools such as the Magnet Pickup Tool or Pen Holder Tool.

The 6-Axis Arm is not configured as a device in VEXcode V5. To use it in a VEX V5 C++ project, manually create an arm object in code with the Smart Port that the 6-Axis Arm is connected to.

The examples on this page use a manually constructed 6-Axis Arm named Arm.

Κατασκευαστές#

arm#

arm creates a 6-Axis Arm object.

Διαθέσιμη λειτουργία

arm(int32_t index);

Παράμετρος

Τύπος

Περιγραφή

index

int32_t

The Smart Port that the 6-Axis Arm is connected to, written as PORTx, where x is the port number. For example, PORT1.

Παράδειγμα

// Create a 6-Axis Arm named Arm on Port 1
arm Arm = arm(PORT1);

Καταστροφέας#

~arm#

~arm destroys the arm object and releases associated resources.

Διαθέσιμη λειτουργία

~arm();

Συναρτήσεις Μελών#

The arm class includes the following member functions:

Ενέργειες — Μετακινήστε τον βραχίονα 6 αξόνων σε θέσεις ή προσανατολισμούς.

  • moveTo — Moves the end effector to a specified x, y, and z coordinate.

  • moveInc — Moves the end effector by a specified distance from its current position.

  • moveEndEffectorTo — Rotates the end effector to a specified yaw, roll, and pitch orientation.

  • moveEndEffectorInc — Rotates the end effector by a specified yaw, roll, and pitch amount.

Μεταλλαγμένοι — Διαμορφώστε τις ρυθμίσεις κίνησης, εργαλείων και ελέγχου.

  • setSpeed — Sets the movement speed used by the 6-Axis Arm.

  • setEndEffectorType — Sets the type of end effector attached to the 6-Axis Arm.

  • setEndEffectorMagnet — Enables or disables the Magnet Pickup Tool.

  • setPenOffset — Sets the z-axis offset used with the Pen Holder Tool.

  • setControlStop — Enables or disables control stop for the 6-Axis Arm.

  • setTimeout — Sets the timeout used by 6-Axis Arm movement functions.

Λήπτες — Επιστρέφουν τιμές κατάστασης κίνησης, θέσης, προσανατολισμού και σύνδεσης.

  • isDone — Returns whether the 6-Axis Arm has finished moving.

  • isCrashed — Returns whether the 6-Axis Arm has crashed while moving.

  • getX — Returns the current x position of the end effector.

  • getY — Returns the current y position of the end effector.

  • getZ — Returns the current z position of the end effector.

  • getYaw — Returns the current yaw of the end effector.

  • getRoll — Returns the current roll of the end effector.

  • getPitch — Returns the current pitch of the end effector.

  • canArmReachTo — Returns whether the 6-Axis Arm can reach a specified position.

  • canArmReachInc — Returns whether the 6-Axis Arm can move by a specified distance.

  • canEndEffectorReachTo — Returns whether the end effector can reach a specified orientation.

  • canEndEffectorReachInc — Returns whether the end effector can rotate by a specified amount.

  • isConnected — Returns whether the 6-Axis Arm is connected to the V5 Brain.

  • timestamp — Returns the timestamp of the last received status packet from the 6-Axis Arm.

  • installed — Returns whether the 6-Axis Arm is connected.

Επανακλήσεις — Εκτέλεση συναρτήσεων όταν συμβαίνουν συμβάντα όπλισης.

  • controlStopped — Registers a function to run when control stop is enabled.

  • crashed — Registers a function to run when a crash is detected.

Ενέργειες#

moveTo#

moveTo 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 canArmReachTo before this function if the target position may be outside the 6-Axis Arm’s reachable workspace.

Διαθέσιμη λειτουργία

bool moveTo(
  double x,
  double y,
  double z,
  bool   waitForCompletion = true
);

Παράμετρος

Τύπος

Περιγραφή

x

double

Η συντεταγμένη x της θέσης-στόχου σε χιλιοστά.

y

double

Η συντεταγμένη y της θέσης-στόχου σε χιλιοστά.

z

double

Η συντεταγμένη z της θέσης-στόχου σε χιλιοστά.

waitForCompletion

bool

Optional. true (default) waits until the movement is complete before continuing. false starts the movement and immediately continues to the next line of code.

Επιστρεφόμενη τιμή

Επιστρέφει μια λογική τιμή.

  • true — The 6-Axis Arm reached the target position.

  • false — The 6-Axis Arm did not reach the target position, or waitForCompletion was set to false.

Παραδείγματα

// Move the 6-Axis Arm to (200, 0, 100)
Arm.moveTo(200, 0, 100);

// Start moving, then print the y-position while the arm moves
Arm.moveTo(-100, 200, 100, false);

while (!Arm.isDone()) {
  Brain.Screen.print(Arm.getY());
  Brain.Screen.newLine();
  wait(0.25, seconds);
}

moveInc#

moveInc moves the 6-Axis Arm by a specified distance from its current position along the x, y, and z axes.

Use this function to move relative to where the end effector is now. Use canArmReachInc before this function if the movement may place the 6-Axis Arm outside its reachable workspace.

Διαθέσιμη λειτουργία

bool moveInc(
  double x,
  double y,
  double z,
  bool   waitForCompletion = true
);

Παράμετρος

Τύπος

Περιγραφή

x

double

Η απόσταση που απαιτείται για την κίνηση κατά μήκος του άξονα x σε χιλιοστά.

y

double

Η απόσταση που απαιτείται για να κινηθεί κανείς κατά μήκος του άξονα y σε χιλιοστά.

z

double

Η απόσταση που απαιτείται για την κίνηση κατά μήκος του άξονα z σε χιλιοστά.

waitForCompletion

bool

Optional. true (default) waits until the movement is complete before continuing. false starts the movement and immediately continues to the next line of code.

Επιστρεφόμενη τιμή

Επιστρέφει μια λογική τιμή.

  • true — The 6-Axis Arm reached the requested position.

  • false — The 6-Axis Arm did not reach the requested position, or waitForCompletion was set to false.

Παράδειγμα

// Move the 6-Axis Arm 100 millimeters along the y-axis
Arm.moveInc(0, 100, 0);

moveEndEffectorTo#

moveEndEffectorTo 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.

Διαθέσιμη λειτουργία

bool moveEndEffectorTo(
  double yaw,
  double roll = 0,
  double pitch = 0,
  bool   waitForCompletion = true
);

Παράμετρος

Τύπος

Περιγραφή

yaw

double

Η γωνία εκτροπής του στόχου σε μοίρες.

roll

double

Optional. The target roll angle in degrees. The default is 0.

pitch

double

Optional. The target pitch angle in degrees. The default is 0.

waitForCompletion

bool

Optional. true (default) waits until the movement is complete before continuing. false starts the movement and immediately continues to the next line of code.

Επιστρεφόμενη τιμή

Επιστρέφει μια λογική τιμή.

  • true — The end effector reached the target orientation.

  • false — The end effector did not reach the target orientation, or waitForCompletion was set to false.

Παράδειγμα

// Rotate the end effector to 90 degrees of roll
Arm.moveEndEffectorTo(0, 90, 0);

moveEndEffectorInc#

moveEndEffectorInc rotates the 6-Axis Arm’s end effector by a specified yaw, roll, and pitch amount from its current orientation.

Χρησιμοποιήστε αυτήν τη συνάρτηση για περιστροφή σε σχέση με την τρέχουσα εκτροπή, κύλιση ή κλίση του τελικού ενεργοποιητή.

Διαθέσιμη λειτουργία

bool moveEndEffectorInc(
  double yaw,
  double roll = 0,
  double pitch = 0,
  bool   waitForCompletion = true
);

Παράμετρος

Τύπος

Περιγραφή

yaw

double

Η αλλαγή στην εκτροπή, σε μοίρες.

roll

double

Optional. The change in roll, in degrees. The default is 0.

pitch

double

Optional. The change in pitch, in degrees. The default is 0.

waitForCompletion

bool

Optional. true (default) waits until the movement is complete before continuing. false starts the movement and immediately continues to the next line of code.

Επιστρεφόμενη τιμή

Επιστρέφει μια λογική τιμή.

  • true — The end effector reached the requested orientation.

  • false — The end effector did not reach the requested orientation, or waitForCompletion was set to false.

Παράδειγμα

// Rotate the end effector -50 degrees in pitch
Arm.moveEndEffectorInc(0, 0, -50);

Μεταλλάκτες#

setSpeed#

setSpeed sets the movement speed used by the 6-Axis Arm.

Διαθέσιμη λειτουργία

void setSpeed(uint32_t speed);

Παράμετρος

Τύπος

Περιγραφή

speed

uint32_t

Η ταχύτητα με την οποία θα πρέπει να κινείται ο βραχίονας 6 αξόνων, σε χιλιοστά ανά δευτερόλεπτο.

Επιστρεφόμενη τιμή

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Παράδειγμα

// Set the 6-Axis Arm movement speed
Arm.setSpeed(100);

setEndEffectorType#

setEndEffectorType sets the type of end effector attached to the 6-Axis Arm.

Όταν αλλάξει ο τύπος του τελικού τελεστή, ο βραχίονας 6 αξόνων προσαρμόζει αυτόματα την μετατόπιση z του ώστε να ταιριάζει με το επιλεγμένο εργαλείο.

Διαθέσιμη λειτουργία

bool setEndEffectorType(
  endEffectorType type,
  bool            waitForCompletion = true
);

Παράμετρος

Τύπος

Περιγραφή

type

endEffectorType

The tool attached to the 6-Axis Arm: magnet (Magnet Pickup Tool) or pen (Pen Holder Tool).

waitForCompletion

bool

Optional. true (default) waits until the change is complete before continuing. false starts the change and immediately continues to the next line of code.

Επιστρεφόμενη τιμή

Επιστρέφει μια λογική τιμή.

  • true — The requested type was set.

  • false — The requested type was not set, or waitForCompletion was set to false.

Παράδειγμα

// Set the end effector type to the Magnet Pickup Tool
Arm.setEndEffectorType(magnet);

setEndEffectorMagnet#

setEndEffectorMagnet enables or disables the Magnet Pickup Tool.

Διαθέσιμη λειτουργία

void setEndEffectorMagnet(bool enabled);

Παράμετρος

Τύπος

Περιγραφή

enabled

bool

true enables the magnet to pick up and hold objects. false disables the magnet and drops any held object.

Επιστρεφόμενη τιμή

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Παράδειγμα

// Pick up objects and then drop them
Arm.setEndEffectorType(magnet);
Arm.setEndEffectorMagnet(true);
wait(2, seconds);
Arm.setEndEffectorMagnet(false);

setPenOffset#

setPenOffset 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 function. If the Pen Holder Tool is not selected, this function has no effect.

Η μετατόπιση της πένας είναι η απόσταση από την κορυφή του εργαλείου θήκης πένας έως την άκρη του δείκτη στεγνού σβήματος. Μια θετική τιμή z μετακινεί την μετατόπιση προς τα πάνω από το σημείο στήριξης του εργαλείου.

Διαθέσιμη λειτουργία

void setPenOffset(double zOffset);

Παράμετρος

Τύπος

Περιγραφή

zOffset

double

Η τιμή μετατόπισης της πένας σε χιλιοστά.

Επιστρεφόμενη τιμή

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Παράδειγμα

// Set the end effector type to the Pen Holder Tool and set the pen offset
Arm.setEndEffectorType(pen);
Arm.setPenOffset(25);

setControlStop#

setControlStop enables or disables control stop for the 6-Axis Arm.

Όταν ενεργοποιηθεί η διακοπή ελέγχου, ο βραχίονας 6 αξόνων σταματά αμέσως την κίνηση και αποτρέπει περαιτέρω γραμμικές ή αρθρικές κινήσεις.

Διαθέσιμη λειτουργία

void setControlStop(bool state = true);

Παράμετρος

Τύπος

Περιγραφή

state

bool

Optional. true (default) enables control stop and prevents further linear or joint movements. false disables control stop.

Επιστρεφόμενη τιμή

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Παράδειγμα

// Stop the 6-Axis Arm and prevent further movement
Arm.setControlStop();

setTimeout#

setTimeout sets the timeout value used when moving the 6-Axis Arm.

Εάν μια κίνηση δεν ολοκληρωθεί πριν από τη λήξη του χρονικού ορίου, το έργο συνεχίζει στην επόμενη γραμμή κώδικα.

Διαθέσιμη λειτουργία

void setTimeout(
  int32_t   timeout,
  timeUnits units
);

Παράμετρος

Τύπος

Περιγραφή

timeout

int32_t

Η νέα τιμή χρονικού ορίου.

units

timeUnits

The time unit: sec (seconds) or msec (milliseconds).

Επιστρεφόμενη τιμή

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Παράδειγμα

// Set the 6-Axis Arm timeout to 2 seconds
Arm.setTimeout(2, sec);

Αποκτητές#

isDone#

isDone returns whether the 6-Axis Arm has finished moving.

This function is useful after a movement function is called with waitForCompletion set to false.

Διαθέσιμη λειτουργία

bool isDone();

Παράμετροι

Αυτή η συνάρτηση δεν έχει παραμέτρους.

Επιστρεφόμενη τιμή

Επιστρέφει μια λογική τιμή.

  • true — The 6-Axis Arm has finished moving.

  • false — The 6-Axis Arm is still moving.

Παράδειγμα

// Display the 6-Axis Arm's y-position while it moves
Arm.moveTo(-100, 200, 100, false);

while (!Arm.isDone()) {
  Brain.Screen.print(Arm.getY());
  Brain.Screen.newLine();
  wait(0.25, seconds);
}

isCrashed#

isCrashed returns whether the 6-Axis Arm has crashed while moving.

Όταν ανιχνευθεί σύγκρουση, ο βραχίονας 6 αξόνων σταματά την κίνηση του κινητήρα και μπορεί να φαίνεται ότι χαλαρώνει. Αυτό μειώνει την καταπόνηση και βοηθά στην προστασία των κινητήρων από τυχαίες ζημιές.

Διαθέσιμη λειτουργία

bool isCrashed();

Παράμετροι

Αυτή η συνάρτηση δεν έχει παραμέτρους.

Επιστρεφόμενη τιμή

Επιστρέφει μια λογική τιμή.

  • true — The 6-Axis Arm has crashed.

  • false — The 6-Axis Arm has not crashed.

Παράδειγμα

// Quickly move to a new location
Arm.setSpeed(100);
Arm.moveTo(-40, 250, 40, false);

// While moving, check for a crash
while (true) {
  if (Arm.isCrashed()) {
    // Indicate a crash with the Brain screen
    Brain.Screen.print("Crash Detected");
    break;
  }

  wait(5, msec);
}

getX#

getX returns the current x position of the end effector in millimeters.

Χρησιμοποιήστε αυτήν τη συνάρτηση για να διαβάσετε πού βρίσκεται τη δεδομένη στιγμή ο τελικός τελεστής κατά μήκος του άξονα x.

Διαθέσιμη λειτουργία

float getX();

Παράμετροι

Αυτή η συνάρτηση δεν έχει παραμέτρους.

Επιστρεφόμενη τιμή

Returns a float representing the x position of the end effector in millimeters.

Παράδειγμα

// Print the current x position of the 6-Axis Arm
Brain.Screen.print(Arm.getX());

getY#

getY returns the current y position of the end effector in millimeters.

Χρησιμοποιήστε αυτήν τη συνάρτηση για να διαβάσετε πού βρίσκεται ο τελικός τελεστής κατά μήκος του άξονα y.

Διαθέσιμη λειτουργία

float getY();

Παράμετροι

Αυτή η συνάρτηση δεν έχει παραμέτρους.

Επιστρεφόμενη τιμή

Returns a float representing the y position of the end effector in millimeters.

Παράδειγμα

// Print the current y position of the 6-Axis Arm
Brain.Screen.print(Arm.getY());

getZ#

getZ returns the current z position of the end effector in millimeters.

Χρησιμοποιήστε αυτήν τη συνάρτηση για να διαβάσετε πού βρίσκεται τη δεδομένη στιγμή ο τελικός τελεστής κατά μήκος του άξονα z.

Διαθέσιμη λειτουργία

float getZ();

Παράμετροι

Αυτή η συνάρτηση δεν έχει παραμέτρους.

Επιστρεφόμενη τιμή

Returns a float representing the z position of the end effector in millimeters.

Παράδειγμα

// Print the current z position of the 6-Axis Arm
Brain.Screen.print(Arm.getZ());

getYaw#

getYaw returns the current yaw of the end effector in degrees.

Διαθέσιμη λειτουργία

float getYaw();

Παράμετροι

Αυτή η συνάρτηση δεν έχει παραμέτρους.

Επιστρεφόμενη τιμή

Returns a float representing the current yaw of the end effector in degrees.

Παράδειγμα

// Print the current yaw of the end effector
Brain.Screen.print(Arm.getYaw());

getRoll#

getRoll returns the current roll of the end effector in degrees.

Διαθέσιμη λειτουργία

float getRoll();

Παράμετροι

Αυτή η συνάρτηση δεν έχει παραμέτρους.

Επιστρεφόμενη τιμή

Returns a float representing the current roll of the end effector in degrees.

Παράδειγμα

// Print the current roll of the end effector
Brain.Screen.print(Arm.getRoll());

getPitch#

getPitch returns the current pitch of the end effector in degrees.

Διαθέσιμη λειτουργία

float getPitch();

Παράμετροι

Αυτή η συνάρτηση δεν έχει παραμέτρους.

Επιστρεφόμενη τιμή

Returns a float representing the current pitch of the end effector in degrees.

Παράδειγμα

// Print the current pitch of the end effector
Brain.Screen.print(Arm.getPitch());

canArmReachTo#

canArmReachTo returns whether the 6-Axis Arm can move the end effector to a specified x, y, and z coordinate.

Use this function to check a target position before using moveTo.

Διαθέσιμη λειτουργία

bool canArmReachTo(
  double x,
  double y,
  double z
);

Παράμετρος

Τύπος

Περιγραφή

x

double

Η συντεταγμένη x της θέσης-στόχου σε χιλιοστά.

y

double

Η συντεταγμένη y της θέσης-στόχου σε χιλιοστά.

z

double

Η συντεταγμένη z της θέσης-στόχου σε χιλιοστά.

Επιστρεφόμενη τιμή

Επιστρέφει μια λογική τιμή.

  • true — The 6-Axis Arm can reach the requested position.

  • false — The 6-Axis Arm cannot reach the requested position.

Παράδειγμα

// Move the 6-Axis Arm to (100, -20, 50) if it can reach
if (Arm.canArmReachTo(100, -20, 50)) {
  Arm.moveTo(100, -20, 50);
}

canArmReachInc#

canArmReachInc 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 function to check a relative movement before using moveInc.

Διαθέσιμη λειτουργία

bool canArmReachInc(
  double x,
  double y,
  double z
);

Παράμετρος

Τύπος

Περιγραφή

x

double

Η απόσταση που απαιτείται για την κίνηση κατά μήκος του άξονα x σε χιλιοστά.

y

double

Η απόσταση που απαιτείται για να κινηθεί κανείς κατά μήκος του άξονα y σε χιλιοστά.

z

double

Η απόσταση που απαιτείται για την κίνηση κατά μήκος του άξονα z σε χιλιοστά.

Επιστρεφόμενη τιμή

Επιστρέφει μια λογική τιμή.

  • true — The 6-Axis Arm can make the requested movement.

  • false — The 6-Axis Arm cannot make the requested movement.

Παράδειγμα

// Increment the 6-Axis Arm 100 mm along the x-axis if possible
if (Arm.canArmReachInc(100, 0, 0)) {
  Arm.moveInc(100, 0, 0);
}

canEndEffectorReachTo#

canEndEffectorReachTo returns whether the end effector can rotate to a specified yaw, roll, and pitch orientation.

Use this function to check a target orientation before using moveEndEffectorTo.

Διαθέσιμη λειτουργία

bool canEndEffectorReachTo(
  double yaw,
  double roll = 0,
  double pitch = 0
);

Παράμετρος

Τύπος

Περιγραφή

yaw

double

Η γωνία εκτροπής του στόχου σε μοίρες.

roll

double

Optional. The target roll angle in degrees. The default is 0.

pitch

double

Optional. The target pitch angle in degrees. The default is 0.

Επιστρεφόμενη τιμή

Επιστρέφει μια λογική τιμή.

  • true — The end effector can reach the requested orientation.

  • false — The end effector cannot reach the requested orientation.

Παράδειγμα

// Rotate the end effector to 90 degrees of roll if possible
if (Arm.canEndEffectorReachTo(0, 90, 0)) {
  Arm.moveEndEffectorTo(0, 90, 0);
}

canEndEffectorReachInc#

canEndEffectorReachInc returns whether the end effector can rotate by a specified yaw, roll, and pitch amount from its current orientation.

Use this function to check a relative orientation movement before using moveEndEffectorInc.

Διαθέσιμη λειτουργία

bool canEndEffectorReachInc(
  double yaw,
  double roll = 0,
  double pitch = 0
);

Παράμετρος

Τύπος

Περιγραφή

yaw

double

Η αλλαγή στην εκτροπή, σε μοίρες.

roll

double

Optional. The change in roll, in degrees. The default is 0.

pitch

double

Optional. The change in pitch, in degrees. The default is 0.

Επιστρεφόμενη τιμή

Επιστρέφει μια λογική τιμή.

  • true — The end effector can make the requested rotation.

  • false — The end effector cannot make the requested rotation.

Παράδειγμα

// Increment the end effector by 10 degrees of pitch if possible
if (Arm.canEndEffectorReachInc(0, 0, 10)) {
  Arm.moveEndEffectorInc(0, 0, 10);
}

isConnected#

isConnected returns whether the 6-Axis Arm is connected to the V5 Brain.

This is a compatibility function that returns the same value as installed.

Διαθέσιμη λειτουργία

bool isConnected();

Παράμετροι

Αυτή η συνάρτηση δεν έχει παραμέτρους.

Επιστρεφόμενη τιμή

Επιστρέφει μια λογική τιμή.

  • true — The 6-Axis Arm is connected to the V5 Brain.

  • false — The 6-Axis Arm is not connected to the V5 Brain.

Παράδειγμα

// Print whether the 6-Axis Arm is connected
Brain.Screen.print(Arm.isConnected());

timestamp#

timestamp returns the timestamp of the last received status packet from the 6-Axis Arm.

Διαθέσιμη λειτουργία

uint32_t timestamp();

Παράμετροι

Αυτή η συνάρτηση δεν έχει παραμέτρους.

Επιστρεφόμενη τιμή

Returns the timestamp of the last status packet as a uint32_t in milliseconds.

installed#

installed returns whether the 6-Axis Arm is connected.

Διαθέσιμη λειτουργία

bool installed();

Παράμετροι

Αυτή η συνάρτηση δεν έχει παραμέτρους.

Επιστρεφόμενη τιμή

Επιστρέφει μια λογική τιμή.

  • true — The 6-Axis Arm is connected.

  • false — The 6-Axis Arm is not connected.

Επανακλήσεις#

controlStopped#

controlStopped registers a function that runs when control stop is enabled.

Διαθέσιμη λειτουργία

void controlStopped(void (* callback)(void));

Παράμετρος

Τύπος

Περιγραφή

callback

void (*)(void)

Μια λειτουργία που εκτελείται όταν είναι ενεργοποιημένη η διακοπή ελέγχου.

Επιστρεφόμενη τιμή

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Παράδειγμα

// Called when the 6-Axis Arm is control stopped
void onControlStopped() {
  Brain.Screen.print("Arm control stopped");
}

int main() {
  Arm.controlStopped(onControlStopped);
}

crashed#

crashed registers a function that runs when the 6-Axis Arm has crashed while moving.

Όταν ανιχνευθεί σύγκρουση, ο βραχίονας 6 αξόνων σταματά την κίνηση του κινητήρα και μπορεί να φαίνεται ότι χαλαρώνει. Αυτό μειώνει την καταπόνηση και βοηθά στην προστασία των κινητήρων από τυχαίες ζημιές.

Διαθέσιμη λειτουργία

void crashed(void (* callback)(void));

Παράμετρος

Τύπος

Περιγραφή

callback

void (*)(void)

Μια λειτουργία που εκτελείται όταν ο βραχίονας 6 αξόνων έχει κολλήσει κατά την κίνηση.

Επιστρεφόμενη τιμή

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Παράδειγμα

// Called when the 6-Axis Arm crashes while moving
void onArmCrashed() {
  Brain.Screen.print("Crash detected");
}

int main() {
  Arm.crashed(onArmCrashed);
}