Skip to main content

Lesson 3: Multiple Waypoints

Lesson 3: Multiple Waypoints

In Lesson 2, you learned how to find a waypoint to code a controlled path for the 6-Axis Robotic Arm to avoid an obstacle. In this Lesson, you will practice finding waypoints to avoid multiple obstacles. At the end of this Lesson, you will use the waypoints you found to code the 6-Axis Arm to move and draw a path between obstacles.

Top down view of the 6-Axis Arm with the Whiteboard on the Tile. There are three obstacles represented by blue x's on the Tile. One is positioned near the bottom right corner of the Tile. One is directly above that one, near the center of the Tile. The third one is directly to the left of the first one positioned slightly left of the tile center. A blue dot is drawn at the 7:00 position of the corner of this obstacle. This is the starting point. A second blue dot is drawn at the 1:00 position of the second obstacle. This is the ending point. A dotted red line begins at the starting point and travels over obstacle 3, around obstacle 1, around to the left of obstacle two and ends at the ending point.

Multiple Waypoints

In many situations and industry settings, robotic arms will need to travel and move around multiple obstacles. You can use strategies that you have previously learned in order to find these waypoints. To practice this, follow along with these steps.

Begin by setting up your space with two "keep out" areas marked on the Whiteboard Attachment with a whiteboard marker. These should be roughly the size of a Cube.

Sketch this layout in your engineering notebook.

Top down view of the 6-Axis Arm on the Whiteboard. Two obstacles are drawn on the Whiteboard. One is positioned near the bottom right corner, and the other is directly to the left of it, with enough space left between them for a line to be drawn there. A starting point dot is placed at the 11:00 position relative to the upper left corner of the second obstacle. An ending point dot is placed at the 5:00 position relative to the lower right corner of the first obstacle.

Your 6-Axis Arm will need to draw a line to follow the path provided here. Document the path in your engineering notebook.

The layout described above, but with a red, dotted line starting at the starting point dot, traveling towards the bottom of the Whiteboard and around obstacle 2, then up between the two obstacles and over the top of obstacle one, ending at the ending point dot.

Label each waypoint needed on your Whiteboard. Document these waypoints in your engineering notebook.

In the next step, you will need to determine the (x, y, z) coordinates of each waypoint. This can be done using the formula from Lesson 2, or you can use the Monitor Console to collect each of these coordinates.

The same layout as above, with the red dotted line. 6 waypoints have been added and numbered. Number 1 is the starting point dot. Number 2 is directly below it, at the 7:00 position relative to the bottom left corner of obstacle 2. Number 3 is directly to the right, halfway between the two obstacles. Number 4 is directly above 3, parallel to Number 1. Number 5 is directly to the right, at the 1:00 position from the top right corner of the obstacle. Number 6 is the ending point.

For Your Information

When using the formula to calculate the unknown coordinates of a waypoint, the direction the 6-Axis Arm needs to travel along an axis is important. If the 6-Axis Arm will move in the positive x or y direction, the value of ∆x or ∆y will be positive. If the 6-Axis Arm will move in the negative x or y direction, the value of ∆x or ∆y will be negative. 

For instance, when moving from waypoint 3 to waypoint 4, the 6-Axis Arm will move along the x-axis in the negative direction.Waypoints 3 and 4 on the whiteboard with the direction of movement along the x-axis marked with a red arrow and the text, '-x direction'.

When using the formula, the value for ∆x will be negative. In this example, the x-coordinate of point 3 is 195mm, and the distance between points 3 and 4 was measured to be 105mm. Using the formula, we can calculate the x-coordinate of point 4 to be 90mm, as shown here. Formula for calculating the x coordinate of point 4 reading x of 3 + delta x equals x of 4. Values are written underneath reading, 195 m m + ( -105 m m) = 90 m m.

 

You previously used the Monitor Console in Unit 3.

To open the Monitor Console in VEXcode EXP, select the Monitor icon. Ensure that your 6-Axis Arm is connected to VEXcode EXP.

VEXcode EXP Monitor Icon called out with a red box. The icon is the second one in a row of four icons located in the upper right corner of the screen, below the Run, Step and Stop buttons.

Manually move the end of the 6-Axis Arm to each waypoint and record the corresponding (x, y, z) coordinate in your engineering notebook.

Monitor console open in VEXcode EXP with x,y, and z values shown.

Now that you have your coordinates for each waypoint, you need to edit the VEXcode project from the Lesson 2. 

Open your project in VEXcode EXP. This project should include the following blocks, but may have different coordinate values.

The same Blocks code from the Unit 4 Lesson 2 project.

Enter the coordinates of the waypoints 1, 2, and 3 into the three Move to position blocks in order. Be sure to use your coordinates.

Note: You can edit the Comment blocks to match the project, by selecting the space and typing. 

Unit 4 Lesson 2 project with a callout box around the coordinates of each Move to position block to indicate where new coordinates can be entered.

Look at the blocks in the project. What do you think the 6-Axis Arm will do when the project is run? Document your prediction in your engineering notebook. 

The same project as above, with the new coordinates for points one, two and three entered.

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

Observe the behavior of the 6-Axis Arm. Does it move as you predicted it would?

Run button in the upper right of the VEXcode EXP toolbar, called out with a red box.

Stop the project once the 6-Axis arm has finished moving.

The 6-Axis Arm should move from waypoint 1, to 2, and end at waypoint 3. If it does not, go back and check the coordinates you put into the project. Be sure the x, y, and z-parameters match the coordinates you gathered in your engineering notebook. Run the project again to test it. 

Once you have successfully navigated to waypoint 3, move on to the next step.

Obstacles and waypoints on the Whiteboard as described previously, with a red arrow drawn from waypoint 1 to waypoint two, and another from waypoint 2 to waypoint 3, indicating the line that should be drawn by the project.

Add three Move to position blocks to the stack, so you have a total of six – one for each waypoint, as well as your starting and ending location.

The project from above with three additional Move to position blocks added to the end of the stack. The three added blocks have a red callout box around them. There are now 6 total move to position blocks in the project, one for each waypoint.

For Your Information

You can also add blocks by duplicating what is already in a stack. In order to duplicate, open the Context Menu by right clicking on the block you want to duplicate. When duplicating, every block beneath the one you select will be duplicated. 

In this project, you can select the first Move to position block in order to duplicate all three for a total of six. Once 'Duplicate' has been selected, the blocks will be copied (including their parameters) and you can add them to the bottom of the stack. 

In this video, the Comment blocks and the Move to position blocks are duplicated by right clicking to open the contex menu, and selecting the top option, 'duplicate'.  The duplicated blocks are attached to the bottom of the project. You can edit the Comment blocks in your project to help keep your project organized.

Video file

Input the coordinates for the last three waypoints into the last three Move to position blocks. Be sure to input the coordinates from your engineering notebook in order, ending with the final location.

Note that your coordinates will vary from the ones shown here because they are based on the exact location of your obstacles and the coordinates you gathered.

The project from above, with comments and a move to position block for each waypoint. The blocks for the last three waypoints are called out with a red box, to indicate these blocks need to have coordinates inputted.

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

Observe the behavior of the 6-Axis Arm. Does it move as you predicted it would?

Run button called out in the VEXcode EXP Toolbar.

Stop the project once the 6-Axis Arm has completed its movements.

The 6-Axis Arm should move from waypoint 1, through waypoints 2 through 5, and end at waypoint 6. If it does not, go back and check the coordinates you put into the project. Be sure the x, y, and z-parameters match the coordinates you gathered in your engineering notebook. Run the project again to test it. 

Once you have successfully navigated to waypoint 6, move on to the next step.

The path the 6-Axis Arm should take to draw a line around the waypoints. Red arrows connect waypoints 1 and 2, 2 and 3, 3 and 4, 4 and 5, and 5 and 6.

Rename and save the project to your device.

Project name box called out and reading Unit 4 Lesson 3.

Activity

Now that you have learned how to find multiple waypoints and code the 6-Axis Arm to navigate a path, you are going to practice this skill in the activity. In this activity, you will code the 6-Axis Arm to move along the designated path to avoid the obstacles.

  • Setup: 
    • Draw three 'keep out' locations on the Tile as shown in this image.
    • Label your starting and ending locations A and B as shown.

Top down view of the 6-Axis Arm with the Whiteboard on the Tile. There are three obstacles represented by blue x's on the Tile. One is positioned near the bottom right corner of the Tile. One is directly above that one, near the center of the Tile. The third one is directly to the left of the first one positioned slightly left of the tile center. A blue dot is drawn at the 7:00 position of the corner of this obstacle. This is the starting point. A second blue dot is drawn at the 1:00 position of the second obstacle. This is the ending point. A dotted red line begins at the starting point and travels over obstacle 3, around obstacle 1, around to the left of obstacle two and ends at the ending point.

Activity:

  1. Code the 6-Axis Arm to move from point A to point B along the path as shown above.
  2. Record your process for finding waypoints in your engineering notebook.
  3. After building and testing your project, run it to ensure the project works as intended.
  4. Once you have completed the activity, rename and save your project to your device.

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 apply your skills in the Putting It All Together activity.