-
Notifications
You must be signed in to change notification settings - Fork 0
VRC | Programming Environment
One of the official programming software for VRC is called RobotC, a programming language derived from a popular programing language, known as "C". RobotC allows users to easily initialize, synthesize, and analyze programs designed for VEX EDR robots. From this section of the Wiki, you will learn the basics of RobotC and how use it with the physical VEX Cortex.
RobotC, as stated above, is used to initialize, synthesize, and analyze programs. A photograph of the main interface can be seen below.
RobotC allows users to open up programs created by the RobotC. Many files can be opened at once through a single window. The different files are shown as separate tabs, analogous to the different tabs internet browsers have. The UI, or user interface, allows users to open windows or perform certain actions in many ways. Users can perform an action using the top menu bar using the separate "File", "Edit", "View", "Robot", "Window", and "Help" menus. Alternatively, users can perform actions by using the ribbon menu, which holds the familiar icons such as "Save", "Save as", and "Open file" in addition to the unfamiliar icons such as "Motor and Sensor Setup", "Firmware Download", "Compile Program", and "Download to Robot". The "Motor and Sensor Setup" button allows students to connect VEX Motors with a computer program. In the computer program used to control the robot, the VEX Motor is called a certain name. Students use the "Motor and Sensor Setup" button to connect the name of the VEX Motor with the actual VEX motor. "Firmware Download" downloads the latest updates to the RobotC program and firmware updates to the VEX Robot. The "Compile Program" button allows the computer to compile the program. During this process, the computer processes the code (if there is an error in the code, the compiling will fail) and convert it into a usable format that the robot cortex is able to understand. After the computer program is compiled, users are then able to press the "download to robot" button to download the program to the robot.
Users will be able to synthesize different RobotC programs; each separate program is usually designed for a different robot. Each program contains lines of code that are used to control the VEX Robot's every move and action. For example the following line of code, or command "startMotor(Motor1, 64)" sets a motor called "Motor1" to the speed of "64". But who tells Motor1 to rotate at the speed of "64"? In fact, the VEX Cortex coordinates the robot's activities by reading the commands that the student wrote; you will learn more about as the reader reads the article.
The ability to analyze programs is vital for any programer to learn and master. Often enough, discrepancies in the program, also known as bugs, can be discovered while the program is running. It is important to fix these bugs to ensure a working robot that obeys all commands without error. RobotC includes a built-in debugger, allowing programmers to analyze sensor readings in addition to analyzing the program's response to the sensor information. If there is an error between the sensor reading and the program reaction, the user must fix the error and prevent future errors from occurring again. Sometimes, the program needs to be proofread multiple times to maximize the preventability of bugs.
At the current time, students are not able to download RobotC to their home computers. This is because RobotC is a paid software that is bundled with VRC equipment that is bought by the team. Because of this, it is imperative that programmers can efficiently program their programs while using the school computers.
Programmers can use a number of commands to control their robot. Once these commands are known, programming the Robot is faster and more efficient. A few internet guides can be found using the following links:
- http://seaquamrobotics.wikispaces.com/file/view/Programming+guide.pdf
- http://engineering.nyu.edu/gk12/amps-cbri/pdf/RobotC%20FTC%20Books/ROBOTC_Training_Guide.pdf
- http://www.education.rec.ri.cmu.edu/fire/media/cortex_startup.pdf
- http://cdn.robotc.net/pdfs/vex/curriculum/Fundamentals%20-%20ROBOTC%20Programming.pdf
Version control is not just limited to RobotC, but any project that involves tracking files that were modified multiple times in its lifetime. The El Segundo High School Robotics Club uses Git as a version control system. The website GitHub allows the club to use the Git version control system for free of charge, as long as all the files are public. Remember that GitHub is the website and Git is the version control system. (GitHub uses Git to version control files)
Git allows programmers to track and update different versions of the same file. Below are some common commands that programmers must learn how to use to be an efficient and effective programmer. This is by no means an exhaustive list, but an important list.
Fully clones a repository, or project from a particular website or database
Determines the status of files in a repository and checks whether or not they are added to the repository or are updated
Adds a file to a Git repository
Commits certain files by making the recently changed files ready for pushing to the database or website
Causes the changes made to a program on the local computer to update on a database or website
Checks if there are any newer versions of a program on the database of website, and downloads said newer version of the program