RobotShop Feeds

RobotShop Feeds



Phidgets Lesson 3: Object Detection

This lesson will help you choose and install a sensor for detecting objects. There are plenty of sensors that can do object detection, each offering different pros and cons, so you need to decide which one will fit your project best.

When choosing a sensor, you need to ask yourself how you'll be using it. You'll want to consider whether you need a sensor that measures the distance of an object – infrared (has a small distance range and doesn’t function in sunlight) and ultrasonic (can have difficulty with odd shapes and densities and can’t be installed outdoors) can both do this. Maybe you need to differentiate between objects – an RFID sensor (senses only tagged objects) or camera (requires more intensive algorithms) is what you're looking for. Are you looking to detect objects passing a certain location? You can use capacitive sensors (although these have a limited range), contact switches (which require direct contact), or a photoelectric tripwire. If you're detecting metallic objects, then go for an inductive sensor.

Phidgets sensors for object detection

(clockwise from top-left: RFID, sharp distance sensor connected to an interface kit 8/8/8, inductive proximity sensor, ultrasonic sonar sensor and photoelectric tripwire sensor)

Now that you've chosen your sensor, you can start programming. Object detection works well with event driven programming, which is demonstrated in many of the Phidgets examples. Download the Phidgets examples in the programming language you prefer (see lesson 2 for instructions on running examples).

In the SensorChangeHandler, you can verify the sensor and run checks on the value. For most sensors, this will be setting a threshold, which you will need to calibrate by using the control panel or running the interface kit example program while the sensor detects objects. You may have varying triggers if you want different responses based on an input, like the distance or the RFID tag.

The response is up to you. In my code, I chose to print a message and turn an indicator light on. Your program could do anything, like play a sound from the computer, trigger a relay to turn on a lamp, unlock a bolt, or run a motor to open a door.

In C, this looks something like this:

int CCONV SensorChangeHandler(CPhidgetInterfaceKitHandle IFK, void *usrptr, int Index, int Value)  {      printf("Digital Input: %d > State: %d\n", Index, State);      if (Index == OBJECT_DETECTOR)      {          if (Value > 500) // The threshold value          {              objectCount++;              printf("Object %d detected\n", objectCount);              CPhidgetInterfaceKit_setOutputState(IFK, INDICATOR_LIGHT, 1);          }          else          {              CPhidgetInterfaceKit_setOutputState(IFK, INDICATOR_LIGHT, 0);          }      }      return 0  }  

In an RFID application, the TagHandlers work much like the SensorChangeHandlers. You can respond to specific RFID tags while ignoring others, then implement your response within those functions.

There are a lot of ways to detect objects, each offering their own advantages and disadvantages. Setting up a response is easily done within the sensor change handler or tag handler. It’s easy to make these changes to the Phidgets examples and then grow your system to respond in complex and interesting ways to the objects you detect. Good luck.

     

Pleiades – Spiri Quadcopter Robot Platform

We have been entering a very cool new UAVs / Drone product from Pleiades called “Spiri” and their technical art director Caroline Glass prepared a Blog post for us to talk about the project. It’s a very interesting platform that will push the industry toward the more “robotic” side of UAVs & Drones.

 


 

Hi to all my fellow robot lovers. I'm Caroline Glass, the Technical Art Director at Pleiades. My company makes a quadcopter robot called “Spiri” that is going to be available at RobotShop. My job is to develop exhibits for Spiri and to work in the lab alongside our engineers and scientists on inspiring new features for our robot. I am especially interested in human-machine interaction, finding new and intuitive ways for people to communicate with Spiri.

Since I've been given the privilege to talk to you, I wanted to tell you what makes me so excited about our launch. I have been working with the core team for the past two and a half years on this, right from the start, and so it is an exciting time for me personally. But I also feel like Spiri is the kind of robot I always wanted to have around me when I was a kid.

When we launch Spiri, you will be able to talk to it through a smart phone, whistle, or play music to it, and there will be a combination of pre-defined commands plus plenty of space for you to define your own.

I'm also a musician, so I wanted to make sure Spiri can respond to musical and auditory cues. About a year ago, we began working on a controller based on MIDI-interpreted notes. Here's a picture of me commanding Spiri with my English Horn.

Pleiades - Spiri - English Horn

Pleiades – Spiri – English Horn

We also wanted to make sure Spiri could handle gestures, and we have a few really exciting projects underway on gesture recognition. One exhibit we set up (at the Montreal Mini Maker Faire this past summer) gave kids a chance to go into a flight pen with Spiri and control it with a long wand.

Pleiades - Spiri - Maker Faire

Pleiades – Spiri – Maker Faire

I was surprised at how young some of the kids were who wanted to get in there with Spiri, and at how quickly they became comfortable with guiding it around.

We've had some memorable misadventures as well. I was at a giant conference this past winter, where Spiri was being featured. But once we got there, suddenly nothing seemed to work. An entertainment industry person had come to see Spiri in action and just as she was arriving at our station, one of the new experimental batteries we were testing caught on fire! This was a fireball that lasted over a minute, attracting a baffled crowd until one of the conference organizers threw a plate on it (the food had just arrived). For the rest of the conference they gave us our very own security guard with a fire extinguisher ready.

Don't worry, though. Since then we've built a battery safety circuit that is unparalleled in quadcopters. Trial and error, trial and error…

Our design has come a long way in these two and a half years. Here's the front view.

Pleiades - Spiri - Front View

Pleiades – Spiri – Front View

Those two holes under the face are for a pair of high resolution video cameras. Spiri can film videos in 3D and can also use the stereoscopic effect to detect and avoid obstacles, altering its own path autonomously.

When we launch, we are going to be providing several controllers as well as different options for programming Spiri. The controllers include mechanisms for direct remote control as well as waypoint navigation. To program Spiri, you will be able to use our API and your favorite programming language, or use our visual programming environment. I think the latter is especially suited to students and to people who know what they want Spiri to do, but not how to write optimal C++ code.

We're really happy to be in business with RobotShop. When you buy from here, you’re going to have access to their great technical support, and your Spiri will be covered by a 2 year warranty. The Spiri team has so many awesome things in the pipeline, you're going to find every few weeks that you wake up to a Spiri capable of a few new tricks.

I’m excited to see what you will teach it.

Spiri 1.0 Quadcopter Development Platform

     

   

No comments:

Post a Comment