Page 4 of 10 FirstFirst 12345678 ... LastLast
Results 31 to 40 of 93

Thread: Trying to debug HROS1 with RPI talking to Arbotix Pro

  1. #31

    Re: Trying to debug HROS1 with RPI talking to Arbotix Pro

    You might want to try the changes I did to add a call to tcdrain before setting a timeout:
    It was done in the delta:
    Unfortunately the change looks big as it turned out to change line endings in the files. Some files in the projects are linux formatted and others are windows formated (lf vs cr/lf)...

    I am not getting the failure to initialize on PS3 demo nor failures in dxl_monitor. Note: I do think there are still some messages with longer than should be delays, that still need to be looked into.

  2. #32

    Re: Trying to debug HROS1 with RPI talking to Arbotix Pro

    Note: I split out the change that added the tcdrain into it's own branch based on master and created a pull request.

    Would be great if someone tried it on RPI2 to see if it helps fix (or mask) the ftdi latency issue where basically the code was timing out, before the packet was actually transferred to the Arbotix-pro...

  3. #33

    Re: Trying to debug HROS1 with RPI talking to Arbotix Pro

    Not sure how would be interested, but thought I would play around some with toggling IO pins on the ODroid C1 to get an idea of timings. I am using on Odroid version of the wiring pi library.

    The test program looks like:
     * testUSB.cpp:
     *    Standard "blink" program in wiringPi. Blinks an LED connected
     *    to the first GPIO pin.
     * Copyright (c) 2012-2013 Gordon Henderson. <[email protected]>
     * This file is part of wiringPi:
     *    wiringPi is free software: you can redistribute it and/or modify
     *    it under the terms of the GNU Lesser General Public License as published by
     *    the Free Software Foundation, either version 3 of the License, or
     *    (at your option) any later version.
     *    wiringPi is distributed in the hope that it will be useful,
     *    but WITHOUT ANY WARRANTY; without even the implied warranty of
     *    GNU Lesser General Public License for more details.
     *    You should have received a copy of the GNU Lesser General Public License
     *    along with wiringPi.  If not, see <>.
    #include <stdio.h>
    #include <signal.h>
    #include <wiringPi.h>
    #include "LinuxDARwIn.h"
    // Quick and dirty test program to try out some USB communications between ODroid C1 (could be RPI2) and Arbotix Pro
    #define    LED_PULSE 27    
    #define LED_USB 26
    #define LED_ERROR 11
    //#define WRITE_LED_TEST
    using namespace Robot;
    LinuxCM730 linux_cm730("/dev/ttyUSB0");
    CM730 cm730(&linux_cm730);
    #define MAX_ID 20
    int gID = 1;
    void sighandler(int sig)
    //    cm730.WriteByte(CM730::ID_CM, CM730::P_DXL_POWER, 0, 0);
    int main (void)
        signal(SIGABRT, &sighandler);
        signal(SIGTERM, &sighandler);
        signal(SIGQUIT, &sighandler);
        signal(SIGINT, &sighandler);
        uint8_t panel_level = 0;
        int value;
        int error;
        int error_level = 0;
        printf ("Test Speed to talk to Arbotix Pro\n") ;
        wiringPiSetup () ;
        pinMode (LED_PULSE, OUTPUT) ;
        pinMode (LED_USB, OUTPUT) ;
        pinMode (LED_ERROR, OUTPUT) ;
        if(cm730.Connect() != true)
            printf("Failed to connect CM-730!");
        cm730.WriteByte(CM730::ID_CM, CM730::P_DXL_POWER, 1, 0);
        for (;;)
            // See how fast this can go...
            digitalWrite (LED_PULSE, HIGH) ;    // On
            digitalWrite(LED_PULSE, LOW);       // Off /
            // Now lets try to do a simple packet to Arbotix Pro
            panel_level = panel_level? 0 : 7;
            error = 0;
            digitalWrite(LED_USB, HIGH);
    #ifdef WRITE_LED_TEST       
            cm730.WriteByte(CM730::ID_CM, CM730::P_LED_PANNEL, panel_level, &error);
            cm730.ReadWord(gID++, MX28::P_PRESENT_POSITION_L, &value, &error);
            digitalWrite(LED_USB, LOW);
    #ifndef WRITE_LED_TEST        
            if (gID > MAX_ID)
                gID = 1;
                // Give us an indicator at 0...
                digitalWrite(LED_ERROR, error_level ? LOW : HIGH);  
                digitalWrite(LED_ERROR, error_level ? HIGH : LOW);
            if (error)
                error_level ^= 1;
                digitalWrite(LED_ERROR, error_level ? HIGH : LOW);
                printf("E:%d\n", error);
        return 0 ;
    I first tried it out doing something simple like trying to set the LED values on the board, so there should not be any additional delays introduced for the command having to talk over the AX buss.

    I then later had it go through and try to read a word (Current position) from many of the servos, to again see how much additional delay this might add. I am using three IO pins on the Odroid, top one is simple high/low of the IO pins, to see if this added much delay (no). The next line down goes high when I start a command to talk to the Arbotix Pro and goes low after the command completes. The third line toggles if command errored. I also used the third pin to do a quick toggle in the reads when I wrapped around back to servo 1...

    Click image for larger version. 

Name:	LA-C1-Arbotix-pro-rw.jpg 
Views:	112 
Size:	30.5 KB 
ID:	6183

    I was going to also put up an image of the logic analyzer run for just doing the set the LED on the controller, but the timings were more or less identical. That is you could do about 800 reads or writes per second.

    Out of curiosity, I may run the same test talking to something like the USB2AX, to see the timings here.


  4. #34

    Re: Trying to debug HROS1 with RPI talking to Arbotix Pro

    Ya know. Playing with this Jessie distro from the raspberrian folks. It is nice and I ran the dxl_monitor a half dozen times with no failures.
    Seeing how this run's everything and vnc and opencv, everything but the old guvcviewer program. This is probably the way to go for the rpi2. I like simple and less stressful ya know.

  5. #35

    Re: Trying to debug HROS1 with RPI talking to Arbotix Pro

    Sounds good, may have to try out Jessie some time soon! Potentially could try it out on the Odroid (c1) as well as I see there is at least one image setup for them:


  6. #36

    Re: Trying to debug HROS1 with RPI talking to Arbotix Pro

    Now do not get me wrong. The only fix for real time data/clocking, is a RT-kernel. Just saying. (Man i am glad i found the RT kernel as it looks like the standard preempt kernels are not happy with the arbotix-pro). I got the image from here (P.S No desk top so everything is ssh.) This article gives details on how to build the Kernel. Look at the real time for Linux part. The Real-time patch lowers the worst case latency to tens of microseconds vs Hundreds of microseconds. (use raspi-config to set password and resize your sd card i.e Default login Username: pi Password: raspberry). Then install deb dependencies from . Use the how to setup your wifi from here and you are up and running with no errors and solid PS controller connection. After booting access the SD card contents open /etc/wpa_supplicant/wpa_supplicant.conf (with root privileges on Linux) and edit the file as described above, I like to use nano to edit myself.
    Create WiFi network with default ssid and psk
    By default in our image Raspberry Pi is set up to connect to the following WiFi network:
    ssid = “emlidltd” {change to your ssid}
    psk = “emlidltd” {your password here}
    key_mgmt = wpa-psk
    Last edited by LloydF; 10-11-2015 at 03:08 AM.

  7. #37

    Re: Trying to debug HROS1 with RPI talking to Arbotix Pro

    There is a HROS1-V2 image and it works great so far. Yea! Ha no PS3 packages at all, hum....? Not sure what this is now, ill play a bit more on this one, but here is were the image is at.
    Last edited by LloydF; 10-09-2015 at 11:50 AM.

  8. #38

    Re: Trying to debug HROS1 with RPI talking to Arbotix Pro

    Thanks LloydF,

    I am in process of downloading this image now, and will update an RPI2 to it and see what is there. Also it would be great if there was (maybe there is) a document that describes what steps were taken to make the image.

    No PS3?

  9. #39

    Re: Trying to debug HROS1 with RPI talking to Arbotix Pro

    Yea and it still has errors. However the rt kernel from the erlerobotv2 guys works and has ros indigo installed and only take 34% of a 8gb SD woot! This is the kernel that seems to be working (PREEMPT_RT kernel 3.18.9-rt5-v7+)
    (I was hoping the Trossen guys would see they need to build a RT kernel and maybe name it HROS1-RT. The fun thing about rolling your own kernel is ya get to name it . Trossen-RT sounds too much like a virus, just saying.)
    Last edited by LloydF; 10-11-2015 at 04:21 AM. Reason: more fun

  10. #40

    Re: Trying to debug HROS1 with RPI talking to Arbotix Pro

    So latency issues are one thing but "The other thing that was quite important to performing the walk tune was addressing the IMU readings. I'm not sure yet what step Trossen would like to take on getting these fixed ( ie update the Arbotix-Pro firmware so the output is correct or patch the Framework )"
    This needs to be answered.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. HROS1 Simulator, is Darwin OP similar enough?
    By Johnny in forum HR-OS1 Development and Discussion
    Replies: 2
    Last Post: 07-29-2016, 04:40 AM
  2. HROS1 RPi and ArbotixPro communication
    By az139 in forum Arbotix, Microcontrollers, Arduino
    Replies: 6
    Last Post: 08-24-2015, 02:03 AM
  3. HROS1 - Wifi stopped working?
    By KurtEck in forum Humanoids, Walkers & Crawlers
    Replies: 8
    Last Post: 05-20-2015, 10:54 AM
  4. Question(s) where in the Arbotix AVR code is it talking to the XBEE serial port?
    By stephen.hazel in forum Arbotix, Microcontrollers, Arduino
    Replies: 5
    Last Post: 05-04-2012, 01:21 PM
  5. Project R2Talk2 - a talking robot with rotating head
    By Macro Man in forum Project Showcase
    Replies: 16
    Last Post: 09-13-2009, 07:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts