One of the most exciting parts of the VIQC Virtual Skills game is launching the discs into the Goal Zones. According to the game rules, there are 4 Goal Zones–2-Point Zone, 3-Point Zone, 4-Point Zone, and 1-Point Zone. Is it possible to launch all the discs on the Virtual Skills field into the 4-Point Zone? Let’s try it.
To begin, we first need to develop an algorithm to ensure that the robot can launch any specific disc into the 4-Point Goal Zone. The launch implementation process consists of 3 steps: taking in the disc, determining the trajectory and aim position, and adjusting the launching velocity and spin.
- Taking in the disc
The Intake of the Snapshot robot is controlled by the Intake Motor. When the Intake Motor spin, the disc beneath the Intake Mechanism will be taken in.
We can create a coordinate system within the VIQC Virtual Skills Field based on its dimensions, identify the X/Y coordinates of the disc, navigate the robot to this specific position, and ensure that the disc is beneath the Intake Mechanism of the robot. ( Here is the detailed information for Localization and Navigation ).
To optimize efficiency, we use asynchronous operation. While the robot is moving, the intake motor will keep spinning to take in the disc, keep checking the bumper sensor to determine if a disc has been loaded into the Intake.
- Trajectory and aim position selection
To minimize the movement required by the robot, we can strategize to launch from the disc’s original position on the field. The line between the disc and the aim position is the expected trajectory of the disc. If the disc collides with the fence or green objects, it will bounce off and the trajectory will be changed.
We aimed to score the disc into the 4-Point Zone, so choose an aim position in this area and ensure the line between the disc and the aim position avoids (or utilizes )the obstacles.
Once the aim position has been selected, we can use their X/Y coordinates to calculate the launch direction. (The calculation details are in the Navigation post).
Set the robot’s heading angle to the launch direction, the robot will launch the disc toward the aim position.
- Adjusting the launching velocity and spin
If a disc has been loaded into the Intake and then spins the Intake motor, the disc will be launched in the direction of the robot’s heading. We can control the length of the trajectory by adjusting the velocity of the intake motor, and ensuring the disc will stop at the aim position.
Now we have developed the algorithm to launch any disc to a specific position on the VIQC Virtual Skills Field. We can keep testing and adjusting the control data to improve the robot’s performance. In the next post, we will focus on how to score all the discs on the field into the goal zones efficiently. Please let us know if you have any questions, comments, or feedback. Thank you!