Supported systems:
Supported languages:
In addition to compiling and downloading single files, RMBuild also supports multiple file compilation and linking, listening to output from an attached robot, updating the firmware of V5 robots, and downloading the Robot Mesh Python VM for IQ.
RMBuild is currently only available for Windows. Download the installer from robotmesh.com here. Once the download is complete, run RobotMeshStudioRMBuildSetup.msi. If a User Account Control window appears, click Yes. The RMBuild installer will as for an install location, then install the appropriate tools without need for further assistance.
As RMBuild is a command line utility, the first step to using it is launching a command line console window. The built-in utility for this in Windows is cmd.exe. To find it, you can press the ⊞ Win key and start typing "cmd." Its icon and precise name vary slightly by Windows version, but on Windows 10 it should look like a small window with a black background called Command Prompt. Click on it to open it. If it refuses to open, it is possible that your system administrator has disabled access to cmd.exe. If this is the case, you will either need to contact that administrator about allowing access or use a different tool for programming your robot, such as Robot Mesh Studio Standalone or Online.
If successful, you should see a window like this:
When you first open the Command Prompt, it will be pointing at your user folder, which is C:\Users\John\ in the example above. Though RMBuild can be directed to use any file, it is significantly easier to use if Command Prompt is pointed at the folder containing the project file(s). To do this, the cd command and the target folder's path are required. To find the path of your project folder, open a file browser window. This can also be done quickly with the shortcut ⊞ Win + E . Navigate to the folder that contains your project files. Once there, click in the address bar at the top:
This will select the filepath. Copy it, either by right clicking the selected text and choosing copy, or by using the shortcut Ctrl + C . Go back to the command line, type in the change directory command cd, then paste in the filepath as an argument. On some older versions of Windows, Ctrl + V is not support in the command line. For these, you can right click the title bar then choose Paste from the Edit menu.
_____
Press Enter , and the filepath changes to the filepath of your project:
To see what RMBuild thinks you can do with RMBuild, you can give it the help flag for a listing of possible arguments and what they make it do. Try typing rmbuild -? into the command line, then pressing Enter . You should see something like this:
Before RMBuild can be used to program a robot, a robot must be on and connected to the computer. For IQ and V5, this is done by micro USB cable. For the Cortex, this can be done by USB A-to-A cable to the Cortex itself. It can also be done by Cortex programming cable to the Cortex's handheld controller while it is linked to the Cortex by VEXnet.
The computer must also have the appropriate USB driver software for the robot being programmed.
The primary usage of RMBuild is for building Robot Mesh projects for VEX robots, and then downloading those projects to a robot. The basic syntax is the same for all three supported platforms, with only minor differences. A basic build and download for each looks something like this:
The first thing in the command line is always rmbuild, as that's the bit that tells Windows that we want to run RMBuild. The next item is the first argument for RMBuild that tells it which robot platform it is going to be working on. The third item is the source file that you want to build and download to the robot. To specify a specific slot for saving a program, use the -s flag, followed by the slot number. In the above examples, slot 1 is selected via -s 1 and -s 3.
By listing multiple .cpp files, rmbuild can compile and link a multiple file project.
RMBuild can run programs that have already been downloaded to IQ units, then listen to their output. This is done with the run command. Like with building and downloading, a slot can be specified, but does not need to be.
There is no need to specify that rmbuild should --listen, as it is the default behavior of the run command.
When a program is running, RMBuild can be used to stop it:
RMBuild can update V5 firmware. Make sure not to turn your robot off or disconnect it while the firmware updater is running.
This option tells RMBuild which output port to look at. This is useful for the rare cases where you have more than one robot plugged in, or some other device connected to the computer is sufficiently robot-like to confuse RMBuild's automatic detection. It can be used with any command. If the port is incorrect, it will instead suggest a list of available ports. Some examples:
The build option --download_only can be added to the end of a build and download command to prevent the program from running immediately. Works for IQ and V5.
The build option --listen can be added to the end of a build and download command to send program output to the command line window. This will reflect what is given to print commands in Python, or C++'s printf function and cout stream. It won't do anything if --download_only is used, as the program won't be run.
The port to listen to output on can be defined with the --userport option, in a similar manner to the --port option. The user port should normally auto-detect.
The Python VM for IQ is required to run Python programs for IQ. RMBuild will normally look for the presence of the VM when downloading a program, and automatically download it if it is not already present. This option forces a download of the virtual machine when building and downloading, whether or not it is required.
The --define command can be used to insert a #define definition into a C++ program at compile time. To set a macro called flag, you would use the following:
Normally, Cortex programs do not run until a handheld controller is connected. Using the --pureauto flag on a Cortex program will cause the program to start immediately when the Cortex powers up and ignore whether or not a joystick is present. Be careful with this command as it generally means the program will start running immediately when download is finished!