- Camera Views
The VEXcode VR playground simulates the real world. When the robot’s actual performance doesn’t match expectations, we can use a different Camera View to observe the specific behaviors of the robot, compare its actions to the expected results, and identify the reasons that cause the bugs.
To choose a Camera View, we can: 1. Select the “Top Camera” button to see an overhead view of the entire Field. OR 2. Select the “Chase Camera” button to see a behind-the-robot view. Or 3. Select the “Orbit Camera” button to see an overview of the robot and the full Field.
Let’s look at an example in the VRC Over Under Virtual Skills playground (Image 16).
The Triball is in front of the robot’s Intake Mechanism. When the Intake Motor spins forward, it cannot collect the Triball. Using the Chase Camera feature, we can see that because the robot’s wheels are on the barrier, the Intake is too high to collect the Triball on the Field
Thus, by adjusting the code to keep all of the robot wheels contacting with the gray tiles on the Field all the time, we can navigate the robot to intake the Triball successfully.
- Error Message in the Print Console (For Python project only)
In VEXcode VR, if the Python project fails to run, we will see an error message in the Print Console that explains why the code is failing.
Take this code for example:
When the project run, we see the following error message in the Print Console:
The error message points to the problem and helps us easily identify and rectify the typo in the object name.
Note: Sometimes, error messages cannot indicate the problem position precisely. If the indicated code seems fine, check the instructions before this code.
The following code is an example: actually, the code failed because there was an indentation error in the line preceding the drivetrain.set_turn_velocity instruction.
The error message shows in the Print Console:
Debugging is a crucial part of coding. Practice makes perfect. After exploring the debugging tools in VEXcode VR, we will delve into some debugging techniques in the future.
Hope this helped and please let us know if you have any questions, comments, or feedback. Thank you!