Skip to main content

Lesson 2: Finding a Waypoint

Lesson 2: Finding a Waypoint

In the previous Lesson, you learned how to use the Pen Holder Tool and code the 6-Axis Arm to draw a line on the Whiteboard. In this Lesson, you will continue to use the Pen as you learn to control the path of the 6-Axis Arm in order to move around obstacles. You will learn:

  • how to identify a waypoint to move the 6-Axis Arm around an obstacle.
  • how to code the 6-Axis Arm to travel in a controlled path using a waypoint.

By the end of this Lesson, you will determine the waypoint needed and code the 6-Axis Arm to move around an obstacle.

Watch the animation below to see the 6-Axis Arm use waypoints to draw lines. First, the 6-Axis Arm draws a diagonal line connecting two waypoints, and next, it connects three waypoints in a right angle to avoid an cube placed on the Tile.

Video file

Why Control the Path of the 6-Axis Arm?

Imagine multiple robotic arms working together to assemble a product on an assembly line. The robotic arms must navigate quickly around each other with a high degree of accuracy. Each arm must travel its own complicated path in order for the operation to be successful. This is accomplished by controlling the path of each arm by coding it to travel along a series of waypoints. This prevents the arms from colliding with each other or with the product they are assembling.

Robotic arms working together to assemble a product.

Previously, you coded the 6-Axis Arm to travel from one point to another in a straight line. However, there were no obstacles present to prevent the 6-Axis Arm from going directly from one location to another. In this Lesson, there will be an obstacle present, so you will need identify a waypoint that will allow you to code the 6-Axis Arm to navigate around the obstacle.

Coding the 6-Axis Arm to Follow a Controlled Path

The 6-Axis Arm must move from point A to point B, but there is an obstacle directly between the two points.

Top down view of the 6-Axis Arm with lines showing the x and y axes overlaying it. There are two points on the Whiteboard labeled A, and B, and a blue x between them to represent an obstacle.

Because of this, you must find a waypoint to allow you to code the 6-Axis Arm to move around the obstacle in order for the 6-Axis Arm to reach its destination. A waypoint is an intermediate point between two locations on a line of travel. In the image below, point C is a waypoint. Instead of traveling directly from point A to point B, the 6-Axis Arm can travel from point A, to point C, and then to point B, in order to avoid colliding with the obstacle. 

The same top down image as above, but with points A, B and C in a triangle. C is the new waypoint between A and B.

For Your Information

The Monitor in VEXcode EXP can be helpful in locating specific coordinates on the Whiteboard. The x, y, z coordinate values will update in real time on the Monitor as the 6-Axis Arm is manually moved, allowing you to easily find specific points (as in Step 1, below).

Monitor Console in VEXcode EXP. A table shows the values of the x,y,z, coordinates in millimeters. There is a red callout box around them.

Finding a Waypoint

Setup your Whiteboard as shown here. Be sure to use a whiteboard marker to write on the Whiteboard.

Point A is located at approximately (150, 50, 0).

Point B is located at approximately (50, 150, 0).

Top down view of the 6-Axis Arm with lines showing the x and y axes overlaying it. There are two points on the Whiteboard labeled A, and B, and a blue x between them to represent an obstacle.

Draw a line from point B to the bottom of the Whiteboard, parallel to the x-axis.

Top down view of the 6-Axis Arm with the A and B points labeled, a box with an x in between points A and B to represent an obstacle, and a line drawn straight down from point B to the bottom of the Whiteboard

Next, draw a line from point A to the edge of the Whiteboard, parallel to the y-axis.

The same top down image of the 6-Axis Arm as above, with an added line from point A straight out to the end of the right side of the Whiteboard.

The intersection of these two lines is your waypoint. Mark the intersection and label it point C.

This point will allow clearance for the 6-Axis Arm to move from point A to point B without hitting the obstacle.

Close up of the intersection of the A and B lines marked and labeled as point C.

Next you will need to determine the coordinates of point C. You will find the x-coordinate first.

Measure the distance between points B and C and record it in your engineering notebook.

Note: These measurements are approximate, yours may vary slightly. Be sure to use your measurements in your calculations.

The same close up as above, but with a red line marking the measurement of the line from B to C at 113 m m.

We can use the known x-coordinate of point B, and the measured distance the 6-Axis Arm needs to move along the x-axis, to find the x-coordinate of point C.

In this formula, the 'delta' represents a change in values. The distance you measured is the change in the x-values between points B and C.

image of the formula for calculating the x coordinate of point C reading x of b plus delta x equals x of c

Input your values to calculate the x-coordinate of point C in your engineering notebook. 

In this example, the x-coordinate of C is 163mm.

Image of the same formula with sample values written underneath reading 50 m m plus 113 m m equals 165 m m .

Follow the same process to find the y-coordinate of point C. First, measure the distance between point A and point C and record it in your engineering notebook. This is the distance along the y-axis that your 6-Axis Arm needs to move.

top down close up of the waypoints with the intersecting lines as previously shown but with a red line showing the measurement of the distance from points A to C, which is 115 m m.

We can use the known y-coordinate of point A, and the measured distance the 6-Axis Arm needs to move along the y-axis, to find the y-coordinate of point C.

In this formula, the 'delta' represents a change in values. The distance you measured is the change in the y-values between points A and C. 

image of the formula for calculating the y coordinate of point C reading y of z plus delta y equals y of c.

Input your values to calculate the y-coordinate of point C in your engineering notebook. 

In this example, the y-coordinate of C is 165mm.

Formula for calculating the y coordinate of point C with sample values underneath, reading 50 m m plus 115 m m equals 165 m m.

Coding the 6-Axis Arm to Travel Around the Obstacle

Now that you have determined the coordinates for point C, it is time to create a VEXcode EXP project for the 6-Axis Arm to travel from point A to point B, via the waypoint, point C.

Open your project from Lesson 1 in VEXcode EXP. You will modify this project by adding a Move to position block in order to code the 6-Axis Arm to travel from point A to point C, then to point B.

VEXcode EXP project reading When started, Set arm end effector to pen, a comment reading Move to point A, Move Arm to position x: 150 y: 50 z: 0 m m, Wait one second, a comment reading Move to point B, Move Arm to position x: 50, y: 165, z: 0.

Drag an additional Move to position block into the Workspace. Input the x and y-coordinates you calculated earlier into the parameters of the block.

Move to position block.

Consider the path the 6-Axis Arm must take. First the Pen moves to point A, and then it moves to point C. So, the new Move to position block will need to be inserted into the project between the two Move to position blocks.

The same project as above, but with  the new Move to position block inserted into the project between the original two move to position blocks. An additional comment block reading Move to point C has also been inserted above it.

Rename your project, and then save it to your device.

In your engineering notebook, record the path you think the 6-Axis Arm will take when the project is run. You can do this with a drawing, or in words.

VEXcode EXP toolbar with the project name box called out. The name reads Unit 4 Lesson 2.

Be sure the 6-Axis Arm is connected to VEXcode. Run your project.

The 6-Axis Arm will avoid colliding with the obstacle by going around it. It will move from point A, to the waypoint C, and end at point B.

View this video to see an example of the 6-Axis Arm moving in this path.

Video file

Activity

Now that you have learned to find a waypoint and code the robot to travel using it, you will practice this skill. In this activity, you will create a project for the 6-Axis Arm to move in a controlled path from one new point to another new point, without colliding with the obstacle.

Top down view of the 6-Axis Arm with the whiteboard attached and the coordinate grid overlay added. Point A is marked at 175, 0, 0 and Point B is marked at -25, 150, 0.

  • Setup: Draw the start and end locations (A and B) on the Whiteboard as shown above. You can use the coordinates shown in the image to help you set up the activity.
    • Point A is located at approximately (175, 0, 0) 
    • Point B is located at approximately (-25, 150, 0)
    • Set an obstacle between points A and B. In the image above the obstacle (a Cube) is located at approximately (100, 125, 0)
  • Activity: Create a VEXcode EXP project for the 6-Axis Arm to travel from point A to point B without colliding with the obstacle. Use a waypoint to do so.
    • Run your project to test it. Does it successfully move from point A to point B without colliding with the obstacle? If not, modify your project and test it again.
    • Record the process you used to find the waypoint in your engineering notebook, and include details about how you used this information in your project.

Check Your Understanding

Before moving to the next Lesson, ensure that you understand the concepts in this Lesson by answering the questions in the document below in your engineering notebook. 

Check Your Understanding questions > (Google Doc / .docx / .pdf)


Select Next > to complete the Mid-Unit Reflection.