The benefit of a stationary setup is that the camera can register parts at the same time the robot is performing pick and place operations. I have considered 2 options for where to position the camera either in a stationary setup, with the camera mounted on a separate stand, or with the camera fixed near the end effector on the arm itself. Wire connections Camera Position and Mounting Bracket The Ground pin on the Dobot is connected to one of the ground pins on the Arduino. The Rx and Tx pins from the Dobot interface port are connected to Tx and Rx pins on the Arduino. Please note that an Arduino Uno cannot be used for this since it only has a single serial connection which is used to communicate to the PC. Placing the LCD shieldĪ serial connection is used to communicate between the Dobot and the Arduino. An LCD shield is placed onto the arduino board with some female sockets in between to clear the serial connector below the board. To verify if all the wires made a proper connection I verified all wires with a multimeter by checking restistance between connectors on each socket. Since I do not have a crimping tool I used a pair of pipe wrench pliers to crimp the connectors, which is not advisable, but it works. It's just one x and y coordinate per line.Crimping the flat cable connectors (caveman style) Listing 3 shows snippet of what comes out of the Awk program. The data2.txt output file is then read into Mathematica. The input field is data.txt, as captured from the Pixy. Finally, the substr option searches the specified fields and prints the characters it finds in positions 1 through 3. This option eliminates the dataless lines of hyphens. I then wanted to include only lines with the letter "x," so I used /x/ to match the string. In this case, the -F option sets the colon as the field delimiter. Here's what I used: awk -F: '/x/ ' data.txt > data2.txt With Awk, you can easily get the data into a form suitable for analysis with Mathematica. It's a complete text processing application that runs from the command line. Awk is your text filtering and transformational friend. In this case, I'll use Awk with redirection to a file. Time-honored Unix/Linux philosophy dictates that I use small general-purpose programs, strung together, to process data (text) files. This output is easy for humans to understand but not overly useful as input to another program or for automation. Simply push and hold the button to get the Pixy to "learn" and track an object. The little white button, at the top right of the lens, is the mode selector. The front view ( Figure 1) shows the camera sensor and lens assembly at the top and the GPU (large square IC) just below it. My experiments used the USB connection, because that worked with both the Pi and my Asus Linux notebook. It outputs x- y data, object height, and corresponding object names to a variety of hardware interfaces, including UART serial, SPI, I2C, USB, or digital/analog devices. The Pixy is a $75 open source, open hardware board that can track hundreds of objects (using seven different colors) at 50 frames per second. I use Xubuntu Linux on my workhorse Asus notebook. Note that I pretty much work exclusively on Linux machines, which is what runs the Raspberry Pi. Exploring new ideas and tools requires prototyping and testing to get an understanding of what you have to work with. I'm sure you are already thinking up ideas of your own. In the future, I might want to suspend the Pixy over a robot arena and analyze bot movements or predict the path of a ping pong ball, as captured by the Pixy. The premise was to track an object with the Pixy and then plot the coordinates of the x and y data. I wanted to develop a basic process to get data from the Pixy into Mathematica on the Raspberry Pi in preparation for more in-depth projects. It can crunch numbers and help you visualize all kinds of trigonometric, calculus, and mathematical functions. Mathematica is a data analysis and plotting package that's bundled into the Raspbian OS on the Raspberry Pi. It tracks things and sends data about the objects to microcontrollers, Raspberry Pis, Beagle Bones, and notebook computers. Does it take gorgeous 10-megapixel photographs? No. The Pixy camera was developed at Carnegie Mellon University and is a fairly specialized vision sensor.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |