Archive for the ‘Challenge’ tag
It’s Danica and Jake, back again! This time, teaching people about the slalom challenge, in ROBOTC Graphical Language for the VEX IQ platform. The challenge is to line follow using the VEX IQ color sensor without hitting the “mines”, also known as the cups.
In the graphical organizer, to line follow on the left side of the line, all you have to do is use the block, lineTrackLeft, to follow the right side you have to use lineTrackRight.
In this block, there are 3 boxes, one for the threshold, the second for the speed of the left motor, and the last box is for the speed of the right motor. In this line of code, the threshold of 105, the robot’s left motor is set to go at 50% power, and the right motor is set to go at 15% power.
This block has to be included into a repeat loop to make sure the robot continues to do this command for an allotted amount of time.
The repeatUntil loop has many options for how long the loop should run. For this challenge, we decided to use the timer.
The timer is set at 7000 milliseconds or 7 seconds, so it has enough time to make it through the slalom. Our finished program looks like this:
Now you can line follow in any challenge you would like, the possibilities are endless!
Hi, we’re Alexis and Noah, two eighth grade students at Hopewell Memorial Junior High School. Earlier this week, we did the Robo 500 challenge. To write the programs, we used the recently released ROBOTC Graphical software for the VEX IQ. The goal of the challenge was to complete two laps around a Vex IQ storage bin.
We completed the challenge by using timing and degree measurements. The first step was to get the robot to move forward. For this, we would use a basic motor command.
In ROBOTC Graphical, it gives you the option to choose the values in which you want your motor to run by, such as time and rotations. In this challenge, we chose time.
From there, we experimented with different time values until we found the timing that was needed to finish the side of the challenge before the turn. Through testing, I found that 3.7 seconds covered the distance needed.
Now, what was left was the largest challenge of the program, the turn. Timing a turn can be challenging on seconds alone. So, I used degree turns. I started with a 180 degree, which brought me around about 45°. Due to the drift of the robot when it moves forward, I had to make the turn slightly less than double the 180° turn. I settled on a value of 300°.
Once the values were established, the rest was just repeating the commands so the robot would go around the whole box. Here is an example of my final program.
We were then thinking about how the turns were a hassle with trial and error, and contemplated a better way to turn. So, we decided to use a gyro sensor to have the most accurate turns possible.
To start out the program we had to reset the gyro sensor so the sensor could record the degrees from zero.
From here we moved forward to the end of the course for time, and we moved forward for about four seconds. Then we used a while loop. A while loop is set to check a condition and while the condition is true, it performs what is inside of the curly braces of the while loop. In this case the condition is while the gyro sensor value is less than 90 degrees.
We would then repeat these actions until the robot has made two full laps around the course. Here is the program for one lap. To do two laps I would just repeat this program again.
We were able to finish our programs efficiently in a short amount of time due to the design of the new graphical programming. This new design enables you to drag over commands from the function library; such as, moving forwards and backwards, turning, and sensor commands while avoiding the hassle of painstakingly typing each command. This reduces the time spent on each program and allows us to speed up the pace at which we program, and we are able to complete challenges in a shorter amount of time.
To the left, we have an image of the function library and a depiction of what would happen if you dragged a command into your program. The command would line up with the next available open line and would give you options as to what values you wanted to program your robot with.
If you’re a student who would like to contribute to the blog, let us know at firstname.lastname@example.org.
We are really excited to introduce a new blog series called Student POV! This series will feature students giving their perspective and advice for programming in ROBOTC. If you’re a student who would like to contribute to the blog, let us know at email@example.com. Welcome our first student bloggers, Danica and Jake!
Hi it’s Danica and Jake, and we just completed the Labyrinth Challenge. We are both 8th grade students attending Hopewell Memorial Junior High. We both used VEX IQ Graphical Programming Language to complete this challenge since it is a new software recently released by ROBOTC. The first challenge we had to accomplish was the labyrinth challenge. The labyrinth is a square, where the robot has to travel from the starting point, to the ending point by doing a series of basic commands.
Our first task was to make our robot move forward.
This block is telling the robot to go forward at 50% power for 5 rotations, but you can also set the robot to move for degrees, milliseconds, seconds, and minutes.
Our second task was to make the robot turn left.
When turning left, you can use multiple commands such as degrees, rotations, milliseconds, seconds, and minutes. You can also use this for turning right.
One problem while programming for this challenge was making 90 degree turns. To get a perfect 90 degree turn, with timing, you had to go through a lot of trial and error. After figuring out the perfect turns, based on timing, the time for moving forward, and the stops to prevent drifts, we had to string all the commands together to form the program for the challenge. This what the finished program looks like:
An easier way to perform more accurate turns, is with the use of the gyro sensor. The gyro sensor allows you to count how many degrees you turn. This simply means that you can actually tell the robot to make an accurate turn. You also have to remember to reset the gyro after every use, and it will make this program a lot easier.
To reset the gyro you have to use this block:
The finished program with the gyro sensor looks like this:
In this program we used the setMotor command instead of turnLeft or turnRight. This command is better to use in the while loop since you only have to set the speed of the motor. The condition in the while loop determines how long the robot turns. As a result, we just need to set the motor speed with the setMotor command.
A cool feature you can use in RobotC is commenting out your code. You can also do this in the VEX IQ Graphical Organizer. It is much easier though since you only have to click the number on the block of code you want to comment out.
Commenting looks like this:
These comments allow you to test only one turn out of the whole code, which is very useful during the trial and error stage.
Now it is time to go try the Labyrinth challenge on your own, either with or without the gyro sensor. Have fun!
Carnegie Mellon’s Robotics Academy, a research-based organization committed to teaching students how to program robots, is really excited to be able to support VEX Competition teams again this year. Follow the links below to learn about a NEW VEX Toss Up Programming Game that can be used by students, teachers in classrooms, coaches, or competition providers with FREE Programming Classes that your students can take. The new game is designed to teach programming and has over $5,000 in prizes. The Robotics Academy has also developed CS2N Group Technology that enables teachers, coaches, and regional competition sponsors to host their own programming and remote control virtual competitions.
VEX Toss Up is played on a 12′x12′ square field. The object of the game is to score your colored BuckyBalls and Large Balls into the Near Zone and Far Zone, by Locking Up your colored BuckyBalls and Large Balls into the Goals, and by Low Hanging, Hanging and Ultra Hanging off your colored Bar at the end of the match.
This Virtual World is designed to simulate the Toss Up competition field and several robot designs, allowing teams to practice their programming and form winning gameplay strategies.
See the rules documents for the full CS2N game explanation:
- VEX Toss Up – Autonomous CS2N Mode
- VEX Toss Up – Remote Control CS2N Mode
Additional information to help you get started:
- All information on CS2N Competitions can be found here
- VEX Toss Up can be downloaded at RobotVirtualWorlds.com or CS2N.org
- If you don’t already have a CS2N account, sign up for a free one here
- Updates and information will be posted on the CS2N Competition pages.
- If you need any help, don’t hesitate to post on the ROBOTC.net forums
How to Setup Your Own In-Class Competition – Teachers, coaches, and competition organizers can setup their own unique programming competitions using CS2N Groups Technology. The Robotics Academy has developed group technology that enables teachers to setup their own in-class competitions. To learn how to setup your own Group competition click here:http://www.cs2n.org/tutorials/competitions