Udoo Powered Robot

Discussion in 'General Discussion' started by jaeg, Oct 23, 2013.

  1. jaeg

    jaeg Member

    Joined:
    Oct 22, 2013
    Messages:
    62
    Likes Received:
    0
    My original purpose for wanting an UDOO is to create a mobile robot platform that can be developed independently of a separate computer. For a base I'm using the old 80's toy Hearoid robot that has been modified to have servo controlled arms and heard. It'll have a slew of sensors for low level operations (basic collision/proximity, light intensity, etc) as well as for high level operations like vision and audio processing.

    Low level operations (which includes motor control) will be handled by the Arduino that is communicating to the iMX6 through the serial. The iMX6 can send to the Arduino move and light commands as well as request current sensor readings. The Arduino can be configured to respond automatically to collisions to prevent harm to the robot.

    I have already purchased a motor driver shield and I'm in the process or constructing the sensor/servo shield.


    [​IMG]
     
  2. josolanes

    josolanes New Member

    Joined:
    Oct 14, 2013
    Messages:
    64
    Likes Received:
    0
    Oh I'll be keeping an eye on this - sounds like a very cool project! Keep updates coming :)
     
  3. andcmp

    andcmp New Member

    Joined:
    May 8, 2013
    Messages:
    161
    Likes Received:
    0
    Nice!

    Keep us up to date!
     
  4. saidol

    saidol New Member

    Joined:
    Oct 3, 2013
    Messages:
    24
    Likes Received:
    0
    Very cool project !
     
  5. Lifeboat_Jim

    Lifeboat_Jim New Member

    Joined:
    Sep 16, 2013
    Messages:
    399
    Likes Received:
    1
    I, for one, welcome our new Hearoid overlords!
     
  6. jimmnh

    jimmnh New Member

    Joined:
    Aug 16, 2013
    Messages:
    82
    Likes Received:
    0
    Thanks for the new thread.

    "Low level operations (which includes motor control) will be handled by the Arduino that is communicating to the iMX6 through the serial. The iMX6 can send to the Arduino move and light commands as well as request current sensor readings. The Arduino can be configured to respond automatically to collisions to prevent harm to the robot."

    I'm still a bit dim on this (perhaps a lot dim). I'm guessing serial.println is being used to push data out to iMX6 but what on iMX6 is listening, parsing the serial feed, and based on that data sending commands back to Arduino, and how is that adjusting what is being run on Arduino? Is there a really basic (BLINK like) complete example out there for UDOO folks running Linaro or Android and setting up comm with Arduino side? For me it would be helpful to see initially programming Arduino LED to blink on/off every second (which I've done in IDE), reading a button press on Arduino side and sending this to iMX6, iMX6 sees the button press value (in what?), and iMX6 sends command to Arduino to have LED blink on/off every 5 seconds. Next button press back to LED every second. Etc.

    Very new to Ardunio and UDOO.
     
  7. josolanes

    josolanes New Member

    Joined:
    Oct 14, 2013
    Messages:
    64
    Likes Received:
    0
    ^ I'm also interested in this. Allowing communication between the boards sounds like a very powerful aspect of the UDOO especially and it's not something I've tried yet either
     
  8. Lifeboat_Jim

    Lifeboat_Jim New Member

    Joined:
    Sep 16, 2013
    Messages:
    399
    Likes Received:
    1
    I'd like to hear what the Devs have done, perhaps they can post their solution as they've had a year (?) to solve that.

    I was thinking of implementing a 'simple' (well, there will have to be checks and balances obviously) asynchronous message queue on both sides, one per direction with a serial port for each. Dev's may have a better solution of course.
     
  9. jimmnh

    jimmnh New Member

    Joined:
    Aug 16, 2013
    Messages:
    82
    Likes Received:
    0
    @josolanes I believe that active communication and coordination between the iMX6 for big decisions (and communication with the user and larger environment as it as access to HDMI, keyboard, mouse, 802.11, ethernet, sound, etc) and ATMEL for driving sensors and microcontrollers is the most powerful config for UDOO. Seems to be what jaeg is targeting. Seeing a basic example of how this active coordination/collaboration between the two chips happens would be very useful to me. I just haven't figured it out yet and I hope I'm not asking a silly question. :oops:
     
  10. miousername

    miousername New Member

    Joined:
    Jun 23, 2013
    Messages:
    73
    Likes Received:
    0
    fantastic!
     
  11. josolanes

    josolanes New Member

    Joined:
    Oct 14, 2013
    Messages:
    64
    Likes Received:
    0
    Not silly at all, that's exactly what I'm interested in also. It could eliminate the need for a wifi shield, for instance, if the main board can receive information and process it so that the Arduino can use the information readily. The other interactions all sound like they could be potentially useful as well - for instance, a program created on the Linux/Arduino side to interact with the Arduino. Clicking a certain button or moving the mouse a certain way, etc could then send information to the Arduino to ask it to accomplish a task. This all sounds very promising and interesting to me :)
     
  12. jaeg

    jaeg Member

    Joined:
    Oct 22, 2013
    Messages:
    62
    Likes Received:
    0
    My idea is to set up a prioritized message queue. High priority messages will get processed a lot sooner than lower priority messages. I'm looking into doing an interrupt system for high priority messages by having a task running in the program on the Linux side whose sole purpose is to check for said messages/events.

    Simple data collection from the Due could be abstracted easily. By having a process on your iMX6 that receives serial events from the Due and then updates a data set, structure, or something for the rest of your program. If you were to make some sort of associative data structure you could configure the Duo to send out the data via serial in a format that includes a name/identifier. An STL map in C++ would serve this purpose well. Map a string name to the data value and then you can look it up incredibly fast. It is also highly reusable.
     
  13. josolanes

    josolanes New Member

    Joined:
    Oct 14, 2013
    Messages:
    64
    Likes Received:
    0
    Thanks @jaeg that sounds like it'll work very well. I'll experiment with it :)
     
  14. jimmnh

    jimmnh New Member

    Joined:
    Aug 16, 2013
    Messages:
    82
    Likes Received:
    0
    "Simple data collection from the Due could be abstracted easily. By having a process on your iMX6 that receives serial events from the Due and then updates a data set, structure, or something for the rest of your program. If you were to make some sort of associative data structure you could configure the Duo to send out the data via serial in a format that includes a name/identifier. An STL map in C++ would serve this purpose well. Map a string name to the data value and then you can look it up incredibly fast. It is also highly reusable."

    See. Now I know you just shared something insightful and helpful there but I'm not getting it. :?
    "It's like he's trying to speak to me, I know it." - Marlin (Finding Nemo)

    What process on the iMX6 would receive serial events? STL map? Is that some sort of in string parser written in C++ using the string library?
    And then how would you use this on the iMX6 side to make decisions and correspondingly communicate those decisions to alter the behavior of the Arduino (the IO program you sent to the ATMEL .. would you send it a modified IO to execute .. this would seem kind of slow)?
     
  15. jaeg

    jaeg Member

    Joined:
    Oct 22, 2013
    Messages:
    62
    Likes Received:
    0
    STL stands for Standard Template Library. It contains various container classes like vectors(linked lists) and maps which are associative containers. Maps take one item, such as a string, and associate it with another item , your data. You can then later ask the map to give you the data that has been associated with your string.

    For a pseudo code example of this
    Code:
        std::map<string, int> input;
        //Set something
         input["collision"] = 0;
         input["lightReading"] = 100;
    
        std::cout << input["lightReading"]
    
     
  16. Lifeboat_Jim

    Lifeboat_Jim New Member

    Joined:
    Sep 16, 2013
    Messages:
    399
    Likes Received:
    1
    @Jimmnh - I'd guess you don't use C++, if your more at ease with C# then you'd use Dictionary.

    Here's an example along similar lines to the STL example above.

    using System;
    using System.Collections.Generic;

    class Program
    {
    static void Main()
    {
    // Create Dictionary and put some content in

    Dictionary<string, int> d = new Dictionary<string, int>()
    {
    {"collision", 0},
    {"lightReading", 100},
    };

    // Loop over pairs with foreach
    foreach (KeyValuePair<string, int> pair in d)
    {
    Console.WriteLine("{0}, {1}",
    pair.Key,
    pair.Value);
    }

    // If you know the Key (like Jaeg's example) then do the following (you really ought to check it exists, handle exceptions etc but you get the idea)
    Console.WriteLine("{0}",dictionary["lightReading"]);
    }
    }

    [note: code not tested/checked so no refunds!]
     
  17. jaeg

    jaeg Member

    Joined:
    Oct 22, 2013
    Messages:
    62
    Likes Received:
    0
    Or if you are familiar with PHP their arrays function the same way:
    Code:
    <?php
         $input = array("collision" => false, "lightReading" => 100);
         echo $input["collision"]." ".$input["lightReading"];
    ?>
    
    I want to say Python has something similar to this as well.
     
  18. Lifeboat_Jim

    Lifeboat_Jim New Member

    Joined:
    Sep 16, 2013
    Messages:
    399
    Likes Received:
    1
    I'd struggle to think of a language that doesn't support something very similar. However behind the scenes they achieve it very differently.

    STL in C++ is very quick, and Generics Dictionary in .Net is only a little way behind... leaving in the dust (a dot on the horizon perhaps) almost everything else (I haven't benchmarked but I think I'd be right in saying that)
     
  19. jaeg

    jaeg Member

    Joined:
    Oct 22, 2013
    Messages:
    62
    Likes Received:
    0
    Even if a language doesn't have something native, technically C++ doesn't, it's all a matter of implementation. A hash table is probably the easiest way to implement something like this.

    I agree that the STL is probably one of the best implementations out there in regards to speed. The fact that it is C++ helps a lot as well.
     
  20. jimmnh

    jimmnh New Member

    Joined:
    Aug 16, 2013
    Messages:
    82
    Likes Received:
    0
    Thanks jaeg and LJ. This helps. Still not sure how this would change behavior on the Arduino side after the iMX6 code reads the input serial data but it's part of the puzzle.
     

Share This Page