Image Processing and Object tracking Robot


#41

@Oscar you can bring the Odroid XU-4 with you, will be happy to learn computer vision on other computing platforms too:slight_smile:


#42

Hi,

When’s the meeting?


#43

hello @oscar, November 5th


#44

Awesome meeting you all at today’s meetup. Eager to build to bot.

Here’s the KES 1000/- toy truck I mentioned. She has lots of potential to become a robot, if the owner allowed me to repossess her :wink:


#45

SwagBot, an Australian farming robot that can herd cattle and pull trailers through mud.

Would this be useful in Africa?


#46

Hello Guys,
Thank you to you all who attended the meetup, for those who didn’t you will definitely cactch up on the forum, will keep you updated.
Thank you @AYSande for the posts, impressed by the farming bot :+1:.
I will post the requirements we discussed on Saturday and what i have achieved so far, later on today. Looking forward to an informative forum.:relaxed:


#47

Yes, especially in Industrial and Agricultural applications such as a fruit picking robot.


#48

Following this thread Keenly


#49

Hello guys, below are the things we discussed on Saturday and settled on for the first robot to have.
The robot will consist of the following;

  1. An AGV (Automated Guided Vehicle)
  2. ARM(5 DOF and already constructed)

The AGV will consist of:

  1. Raspberry Pi 3 as its main processing unit
  2. Raspberry Pi camera mounted on servo swivel on the front of the AGV
  3. Two Gyroscopes (MPU6050), one mounted on the swivel of the camera and the other on the AGV its self.
  4. A motor driver for driving each motor (4 motors in total)
  5. An atmega328 controller board to control the navigation.
  6. Four ultrasonic sensors (each on either of four sides)

ARM
The arm consists of

  1. Six servo motors for articulation
  2. An atmega328 controller board

Software

  1. Raspbian Jeezy OS
  2. Opencv for image processing
  3. ROS for robot operation
  4. Pocketsphinx for voice commands
  5. Arduino programming for sensor readings and navigation

Operation

  1. The camera will first locate and lock on an object as instructed based on colour and shape (e.g Find a green Ball)
  2. After a target has been locked on, the gyro on the camera swivel will pass the location of the target to the AGV controller.
  3. The AGV controller will use this coordinates to move to the location of the target.
  4. The ultra sonic sensor on the front of the AGV will help the robot to move just close enough to the position of the target for the arm to pick the object.
  5. When the robot its close enough, it will pass a command to the arm controller for the arm to pick the object.
  6. The robot will make a 180 degrees turn and move back to the initial starting point to deliver the object (i.e Green Ball)
  7. Another command can be given from there.

I have explained this in the simplest way possible, feel free to ask for clarifications.


#50

Welcome aboard @Njenga :relaxed:


#51

Hello everyone.
I have also been following this closely and from the design specifications put forth by Mr. Cyrus I have an arm design that fits the description.
you will realize the gripper is missing in the assembly but it will be made available soon.

This arm consists of 4 1501MG high torque servos. The servo at the bottom gives the swivel motion while the other three provide joints(similar to a human arm).


#52

Welcome to the forum @Kirkston


#53

Hello guys, follow the following tutorial on how to install Opencv on Raspberry Pi 3 running Raspbian.
http://www.pyimagesearch.com/2015/07/27/installing-opencv-3-0-for-both-python-2-7-and-python-3-on-your-raspberry-pi-2/


#54

Very nice guys! Robot vision provides greater robot versatility (as you’ve already mentioned). I can’t wait for the real thing robot. I’ll be following your progress closely. Do check out already existing robot vision modules and see if they can aid you fast-track the project’s realization. All the best.


#55

Hello guys, I have attached below an arduino code of the navigation of the robot, its just for the simple movements, e.g move forward, turn left etc. I will sketch a paint sketch to help you understand the code better, before then have a look.

  const int InA1 = 9; 
    const int InA2 = 4;   
    const int InB1 = 3; 
    const int InB2 = 8; 
    const int PWM1 = 5;
    const int PWM2 = 6;
    int Trigpin =11 ;
    int Echopin = 10;

    const int Trigpin1 = 2;
    const int Echopin1 = 12;
    // Move Forward
    int move_forward()// Funtion to drive the Rover Forward
    {
      digitalWrite(InA1, HIGH);
      digitalWrite(InA2, HIGH);
      digitalWrite(InB1, LOW);
      digitalWrite(InB2, LOW);
      analogWrite(PWM1, 100);//EFT SIDE//100
      analogWrite(PWM2, 100); //RIGHT SIDE
    }
    //Move forward slower than <Move Forwar>
    void approach_forward()
    {
     digitalWrite(InA1, HIGH);
      digitalWrite(InA2, HIGH);
      digitalWrite(InB1, LOW);
      digitalWrite(InB2, LOW);
      analogWrite(PWM1, 60);//EFT SIDE//100
      analogWrite(PWM2, 60); //RIGHT SIDE
    }
    //Move Forward Faster than <Move Forward>
    int gravity_forward()// Funtion to drive the Rover Forward
    {
      digitalWrite(InA1, HIGH);
      digitalWrite(InA2, HIGH);
      digitalWrite(InB1, LOW);
      digitalWrite(InB2, LOW);
      analogWrite(PWM1, 180); //LEFT SIDE//120
      analogWrite(PWM2, 180); //RIGHT SIDE
    }


    // Move in Reverse
    int reverse()//Reverse at normal speed
    {
      digitalWrite(InA1, LOW);
      digitalWrite(InA2, LOW );
      digitalWrite(InB1, HIGH);
      digitalWrite(InB2, HIGH);
      analogWrite(PWM1, 100); //Set Speed for the RIGHT Side
      analogWrite(PWM2, 100); //Set Speed for the LEFT Side
    }
    //slow Reverse
    int slow_reverse()
    {
      digitalWrite(InA1, HIGH);
      digitalWrite(InA2, HIGH);
      digitalWrite(InB1, LOW);
      digitalWrite(InB2, LOW);
      analogWrite(PWM1, 500);//Set Speed for the RIGHT Side
      analogWrite(PWM2, 500);//Set Speed for the LEFT Side
    }

    //Brake
    int brake()
    {
      digitalWrite(InA1, LOW);
      digitalWrite(InA2, LOW);
      digitalWrite(InB1, LOW);
      digitalWrite(InB2, LOW);
      analogWrite(PWM1, 0);//Set Speed for the RIGHT Side
      analogWrite(PWM2, 0);//Set Speed for the LEFT Side
    }


    //Turn LEFT
    void turn_left()
    {
      digitalWrite(InA1, HIGH);
      digitalWrite(InA2, LOW); //Move the Left side Forward
      digitalWrite(InB1, LOW); //MOve the RIGHT Side in Reverse
      digitalWrite(InB2, HIGH);
      analogWrite(PWM1, 185);//Set Speed for the RIGHT Side
      analogWrite(PWM2, 185);//Set Speed for the LEFT Side
    }

    void slowturn_left()
    {
      digitalWrite(InA1, HIGH);
      digitalWrite(InA2, LOW); //Move the Left side Forward
      digitalWrite(InB1, LOW); //MOve the RIGHT Side in Reverse
      digitalWrite(InB2, HIGH);
      analogWrite(PWM1, 120);//Set Speed for the RIGHT Side
      analogWrite(PWM2, 120);//Set Speed for the LEFT Side
    }



    void reverse_slowleft()
    {
      digitalWrite(InA1, HIGH);
      digitalWrite(InA2, LOW); //Move the Left side Forward
      ///digitalWrite(InB1, LOW); //MOve the RIGHT Side in Reverse
      digitalWrite(InB2, HIGH);
      //analogWrite(PWM1, 180);//Set Speed for the RIGHT Side 180
       analogWrite(PWM2, 180); //Set Speed for the LEFT Side
    }


    //Turn RIGHT
    void turn_right()
    {
      digitalWrite(InA1, LOW);
      digitalWrite(InA2, HIGH); //Move the Right side Forward
      digitalWrite(InB1, HIGH); //Move thee Left Side In Reverse
      digitalWrite(InB2, LOW);
      analogWrite(PWM1, 225); //Set Speed for the RIGHT Side
      analogWrite(PWM2, 225);//Set Speed for the LEFT Side
    }
    void slowturn_right()
    {
      digitalWrite(InA1, LOW);
      digitalWrite(InA2, HIGH); //Move the Right side Forward
      digitalWrite(InB1, HIGH); //Move thee Left Side In Reverse
      digitalWrite(InB2, LOW);
      analogWrite(PWM1, 225); //Set Speed for the RIGHT Side
      analogWrite(PWM2, 150);//Set Speed for the LEFT Side
    }

    float get_range() // get values from the front sonar
    {
      digitalWrite(Trigpin, LOW);
      delayMicroseconds(2);
      digitalWrite(Trigpin, HIGH);
      delayMicroseconds(10);
      digitalWrite(Trigpin, LOW);
     int cm = pulseIn(Echopin, HIGH)/58;
    float  dist = cm;
      Serial.println(cm);  
      return (dist);
    }

    float stop_dist()// get distance from the side sonar
    {
      digitalWrite(Trigpin1, LOW);
      delayMicroseconds(2);
      digitalWrite(Trigpin1, HIGH);
      delayMicroseconds(10);
      digitalWrite(Trigpin1, LOW);
      int cm = pulseIn(Echopin1, HIGH) / 58;
     float sdist = cm;
      Serial.println(cm);
      return (sdist);
    }

    void setup()
    {
      pinMode(InA1, OUTPUT);
      pinMode(InA2, OUTPUT);
      pinMode(InB1, OUTPUT);
      pinMode(InB2, OUTPUT);
      pinMode(PWM1, OUTPUT);
      pinMode(PWM2, OUTPUT);
      pinMode(Echopin, INPUT);
      pinMode(Trigpin, OUTPUT);
    }

    void loop()
    {
    }

Or you can download the code from
https://github.com/Sinclairk/Machine-Vision-GearBox-.git


#56

Hello guys, the sketch bellow might help you understand the code.


#57

Hello guys, been away for a while, but good news, I have the color detection code up and running. Working on interfacing the raspberry Pi with the Atmega328 board and the MPU6050 gyroscopes. Will post the code and the interface schematics before the end of the week. Before then you can take a look at Introduction to Robotics(Line Tracking Robot case study). Until then Cheers:slight_smile::wave:


#58

Hello guys, i have fabricated below the AGV design shared earlier on the forum. Below are the pictures of it. Next will be mounting of the Raspberry Pi, the camera and the controller board.


#59

Below is the schematic for the controller board plus the board layout. The board is based on Atmega328 Microcontroller. The board is quite simple with just a few sensors and I/O ports. The board also has 6 I2C slave ports( love :heart_eyes: I2C :slight_smile:). The layout is done using Eagle Cad.


#60

Morning Guys, the board above board is based on Atmega328, so basically its an arduino uno board tuned to my requirements. Having that in mind I thought it useful to prepare a fritzing sketch of how things are connected to the board as would be on and arduino uno. Note, the board has 10k pull up resistors for SDA and SCL lines, so if you are using an Arduino board you will need to include pull up resistors for this two lines (any value between 4.7 Ohms and 10 Ohms will do), and you just need one pair of the pull resistors for whichever number of slaves you have on the I2C port.

Note : The above sketch is for the AGV only, whihc is responsible for navigation.