Maybe you've always wanted to make C-3PO or R2-D2, or wondered whether you could create a Roomba Robotic Floorvac yourself. Whatever your motivation, the Lego MindStorms Robotics Invention System has everything you need in order to build robots. So you put down $200, take the kit home, and build something brilliant—only to discover that the software is Windows only.
Can't you use a Mac to program robots? Of course you can! Several excellent Lego robot-programming tools exist for the Mac, many of them free. I'll show you how to get started with one of the most popular tools, MacNQC. (For others, see 'Programming Choices.')
- Download Myro Mac OS X Package. This installer will NOT work on Mac OSX 10.6, and will make things worse! Instead, use the BETA 10.6 install zip file found below! Note: TkSnack does not work on Mac OS X. Afterwards, follow the directions (below) to pair your computer's Bluetooth with the robot. Setup Bluetooth. Attach the IPRE Fluke to the.
- Proceed with board specific instructions. When the Arduino Software (IDE) is properly installed you can go back to the Getting Started Home and choose your board from the list on the right of the page. Last revision 2016/08/09 by SM.
About Lego Robots
The Lego MindStorms Robotics Invention System (RIS) kit contains more than 700 Lego bricks, including motors, sensors, gears, wheels, and a robot brain called the RCX. You can write programs for the RCX on your computer and then download the programs to your robot via an infrared link. The kit includes an infrared USB tower that you plug into your computer so it can talk to the RCX.
So what can you do with all this stuff? Whatever you want. Imaginative builders from around the world have built robot bugs, pets, tanks, plant waterers, lawnmowers, chess players, and just about everything else. You won't be making C-3PO or the Jetsons' Rosie, but you're going to have fun and learn a lot. In fact, many teachers now use Lego robots to teach programming to beginners of all ages.
Nink, we had the raspberry pi version of ARC which actually ran on macOS, but it was hugely limited in features.net runs well across platforms - but it's the Operating system level calls we struggled with for cross platform support. As you know, Synthiam wraps technologies into skills to be used in arc. We don't necessarily create the technologies, rarely do we in fact.
Meet MacNQC
Although there's Windows-only software in the regular MindStorms box, the clever and dedicated Lego robotics community, composed of enthusiastic fans worldwide, has created a wide variety of alternative RCX programming environments.
NQC (Not Quite C), originally developed by Dave Baum, compiles text source files and can download the compiled programs to the RCX. In its purest form, NQC can be a little uncomfortable for people who don't live on a command line. Fortunately, there's MacNQC, an excellent GUI version of NQC that runs in OS 9 and OS X. At this writing, the current version of MacNQC X (the version for OS X) was 3.0 r2.
MacNQC Quick Start
The first thing you need to do to start programming robots with MacNQC is install firmware on the RCX. The RCX is a very tiny computer. Like a Mac without system software, or Frankenstein without a brain, the RCX can't do much by itself. The firmware serves as a kind of operating system, enabling you to download and run your own programs.
MacNQC does not come with its own firmware; you will use the firmware that Lego supplies with the RIS kit. The easiest way to get the firmware file is to download the RCX 2.0 Beta SDK. Click on the link at the bottom of the page to download the SDK. (You'll need to click through one or two more pages to get to it.) Once you've downloaded and unzipped the SDK, copy the firm0328.lgo file into the Firmware directory of your MacNQC folder.
If you don't have an Internet connection handy, you can get the firmware file from the RIS disk, but you'll need to install the RIS software on a Windows computer first. Then you can copy the firmware file from Windows to your Mac and install it on the RCX using MacNQC. On the Windows computer, you can find the firmware file here: Program FilesLEGO MINDSTORMSRIS 2.0scriptFirmware firm0328.lgo. Copy it to your Mac and place it in the Firmware directory of your MacNQC folder.
At this point, you're ready to plug in the infrared tower and start up MacNQC. Turn on the RCX and place it near the infrared tower. Choose RCX: Download Firmware from the MacNQC menu. MacNQC will find the firmware file you just copied and install it on the RCX. Be patient; this takes a couple of minutes. With the firmware installed, you're ready to start playing.
Choose RCX: Motor And Sensor Panel from MacNQC's menu. This window allows you to control motors (outputs A, B, and C) and view sensor readings (inputs 1, 2, and 3). For example, you can see the current reading of a light or temperature sensor. To turn on a motor, click on one of the green arrows for forward or reverse, and then click on the Start button. To view a sensor value, first choose the sensor type from the pop-up menu and then click on Refresh to get the sensor values from the RCX.
Ready Your Robots!
Programming in NQC is simple. Let's start with a rudimentary example: a program that makes a robot move forward for one second and then stop. If you haven't built a robot yet, make a basic one, such as my own RoboTag or Trusty.
I'll assume you have a robot that uses motors A and C to move. All the program has to do is turn on the motors, wait one second, then turn them off.
In MacNQC, create a new file and enter this:
The commands in this program are all straightforward. You just need to remember that the Wait command accepts a time measured in hundredths of a second, so
means 'wait for one second.'You can save the file if you want, but it's not necessary for testing. Make sure that your RCX is turned on and that the infrared tower is pointed at it; then click on the toolbar button that looks like 1s and 0s. MacNQC will download your program to the RCX. (Your robot will chime when it has received instructions.) To try the program out, press the Run button on the RCX.
If you'd rather just check your program for errors without downloading it, click on the red check-mark button. MacNQC will tell you about any errors it finds in a separate error window. Double-click on an error to go to that spot in your program.
The next example moves the robot forward until it bumps into something. You'll need a robot with a bumper on the front, connected to input 1. (The bumper should press a touch sensor on input 1 when the robot bumps into something.) Also, motor A should control the left side of the robot; motor C, the right side. RoboTag will work for this project. After a bump, the robot will back up, turn right, and then drive forward again.
The
line <>A<> (as seen in the screenshot) tells the RCX that a touch sensor is attached to input 1. Next, the program moves the robot forward. If the bumper ever touches anything (that's when equals ), the robot backs up for one second, turns for one second, and then starts moving forward again.When you're ready to do more, check out the comprehensive documentation for the NQC language, and information about MacNQC, available from the Help menu.
Welcome to a New World
By now you should be pretty pleased with yourself. You have successfully used your Mac to program Lego robots, and it didn't cost you anything. (You can watch RoboTag navigate obstacles using the second program outlined in this article.)
You are now part of an amazing global community whose nexus is LUGNET, the Lego Users Group Network. You'll find other enthusiastic, brilliant people who like to build Lego robots. Browse or search the archives for project ideas or information about troubleshooting, advanced programming, and building techniques. Or you can join (for free) and participate in the discussions.
Now go forth and program robots with your Mac. Have fun!
[ Jonathan Knudsen was the author of one of the first Lego MindStorms books in 1999. By day, he writes about Java technology. ]
Less Geeky You can't use the Windows-only software that comes in the MindStorms box, but you can use Lego's Robolab software for OS 9. (It also runs in Classic.) In this visual environment, snap together little program blocks, such as
or . When you're finished, click on a button to download the program to your robot for testing. This is a good choice for younger robot builders or those with little computer experience. Buy it separately at the Pitsco Lego Dacta store for $69.Also, don't miss the cool kits sold at the Pitsco site, such as the $114 Robolab Intelligent House Building Set, which you can use to create a working model of an automated home.
Geekier If you're familiar with Java, try the free leJOS, an environment based on the Java programming language.
Use MacNQC's Motor and Sensor Panel to control robots directly, or create programs in a color-coded text editor. See RoboTag navigate obstacles using the second program outlined in this article.In image template-based desktop automation, you provide the robot with screenshots of the parts of the interface that it needs to interact with, like a button or input field. The images are saved together with your automation code. The robot will compare the image to what is currently displayed on the screen and find its target.
Cross-platform desktop automation library
Robot Rascals Mac Os Download
Robocorp provides cross-platform desktop automation support with the RPA.Desktop library. It works on Windows, Linux, and macOS.
In MacNQC, create a new file and enter this:
The commands in this program are all straightforward. You just need to remember that the Wait command accepts a time measured in hundredths of a second, so
means 'wait for one second.'You can save the file if you want, but it's not necessary for testing. Make sure that your RCX is turned on and that the infrared tower is pointed at it; then click on the toolbar button that looks like 1s and 0s. MacNQC will download your program to the RCX. (Your robot will chime when it has received instructions.) To try the program out, press the Run button on the RCX.
If you'd rather just check your program for errors without downloading it, click on the red check-mark button. MacNQC will tell you about any errors it finds in a separate error window. Double-click on an error to go to that spot in your program.
The next example moves the robot forward until it bumps into something. You'll need a robot with a bumper on the front, connected to input 1. (The bumper should press a touch sensor on input 1 when the robot bumps into something.) Also, motor A should control the left side of the robot; motor C, the right side. RoboTag will work for this project. After a bump, the robot will back up, turn right, and then drive forward again.
The
line <>A<> (as seen in the screenshot) tells the RCX that a touch sensor is attached to input 1. Next, the program moves the robot forward. If the bumper ever touches anything (that's when equals ), the robot backs up for one second, turns for one second, and then starts moving forward again.When you're ready to do more, check out the comprehensive documentation for the NQC language, and information about MacNQC, available from the Help menu.
Welcome to a New World
By now you should be pretty pleased with yourself. You have successfully used your Mac to program Lego robots, and it didn't cost you anything. (You can watch RoboTag navigate obstacles using the second program outlined in this article.)
You are now part of an amazing global community whose nexus is LUGNET, the Lego Users Group Network. You'll find other enthusiastic, brilliant people who like to build Lego robots. Browse or search the archives for project ideas or information about troubleshooting, advanced programming, and building techniques. Or you can join (for free) and participate in the discussions.
Now go forth and program robots with your Mac. Have fun!
[ Jonathan Knudsen was the author of one of the first Lego MindStorms books in 1999. By day, he writes about Java technology. ]
Less Geeky You can't use the Windows-only software that comes in the MindStorms box, but you can use Lego's Robolab software for OS 9. (It also runs in Classic.) In this visual environment, snap together little program blocks, such as
or . When you're finished, click on a button to download the program to your robot for testing. This is a good choice for younger robot builders or those with little computer experience. Buy it separately at the Pitsco Lego Dacta store for $69.Also, don't miss the cool kits sold at the Pitsco site, such as the $114 Robolab Intelligent House Building Set, which you can use to create a working model of an automated home.
Geekier If you're familiar with Java, try the free leJOS, an environment based on the Java programming language.
Use MacNQC's Motor and Sensor Panel to control robots directly, or create programs in a color-coded text editor. See RoboTag navigate obstacles using the second program outlined in this article.In image template-based desktop automation, you provide the robot with screenshots of the parts of the interface that it needs to interact with, like a button or input field. The images are saved together with your automation code. The robot will compare the image to what is currently displayed on the screen and find its target.
Cross-platform desktop automation library
Robot Rascals Mac Os Download
Robocorp provides cross-platform desktop automation support with the RPA.Desktop library. It works on Windows, Linux, and macOS.
Travel directions robot
This example robot demonstrates the use of image templates and keyboard shortcuts to find travel directions between two random locations on Earth.
Robot Rascals Mac Os X
The robot:
- Interacts with a web browser to select two random locations on Earth (from https://www.randomlists.com/random-location).
- Tries to find the directions using the Maps desktop app on macOS (Big Sur), using image templates and keyboard shortcuts.
- Falls back on the web version of Google Maps if Maps fails to find directions.
Note: This robot requires macOS Big Sur. The layout and the behavior of the Maps app vary between macOS releases. macOS will ask for permissions the first time you run the robot. Go to System Preferences
->Security & Privacy
and check Robocorp Lab
, Code
, or Terminal
(depending on where you run the robot from) in the Accessibility
and Screen Recording
sections.
Another important topic:
System settings can impact the recognition of the images: How the interface elements look on a screen depends on system settings like color schemes, transparency, and system fonts. Images taken on a system might end up looking different than the target system, and the robot might not recognize them, stopping the process.
In this case, macOS should use the 'Dark' appearance under System Preferences
->General
. See our Desktop automation page for more information.
The settings
The robot uses three libraries to automate the task. Finally, it will close all the browsers it happened to open.
Robot Rascals Mac Os Catalina
The task: Find travel directions between two random locations
Variables
Keyword: Get random locations
The robot uses a web browser to scrape and return two random locations from a suitable website.
Keyword: Open the Maps app
The robot opens the Maps app using the Run Process
keyword from the Process
library. It executes the open -a Maps
command. You can run the same command in your terminal to see what happens!
The robot knows when the Maps app is open by waiting for the Maps.MapMode
image template to return a match.
Keyword: Maximize the window
The robot maximizes the Maps app window using a keyboard shortcut unless the app is already maximized. The Run Keyword If
is used for conditional execution.
The robot knows the Maps app is maximized when the Desktop.WindowControls
image template does not return a match (when the close/minimize/maximize icons are not anywhere on the screen).
Keyword: Open and reset the directions view
The robot sets the directions view in the Maps app to a known starting state (empty from and to locations).
- Conditional execution is used to handle the possible states for the view (it might or might not be open already).
- Image templates are used to wait for specific app states so that the robot knows when something has been completed.
- Keyboard shortcuts are used to toggle the directions view.
Keyword: Accept Google consent
Keyword: View directions using Google Maps
The robot waits until Google Maps has loaded the directions and takes a full web page screenshot.
Keyword: Enter location
The robot needs to input the from and to locations. This keyword provides a generic way to target those elements on the UI.
Keyword: View directions
The robot tries to find the directions using the Maps app. If that fails, the robot gets the directions from Google Maps.
Summary
- Image template matching is a cross-platform way to find and target UI elements.
- Keyboard shortcuts are the preferred way to interact with desktop applications (the shortcuts are usually more stable and predictable than the UI).
- Conditional logic can be used to select different actions based on the state of the application.