Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: How to build and download firmware to Arbotix Pro

  1. #11

    Re: How to build and download firmware to Arbotix Pro

    Compressing code down to fewer lines of code almost always pays off, as long as you don't contort yourself (or the code) the the point of bursting!

  2. #12

    Re: How to build and download firmware to Arbotix Pro

    Also, in C++, you can of course make it arbitrarily terrible/great!

    Code:
    template<typename T> bool read_one(T *optr) {
        uint32_t start = millis();
        while (Serial.available() != sizeof(T)) {
            if (millis() - start > TIMEOUT) {
                return false;
            }
        }
        //  marshal however you will -- this is the simplest possible; doesn't byte swap or anything
        Serial.read((void *)optr, sizeof(T));
    }
    
    
    bool read_fields() { return true; }
    
    
    template<typename T, typename ...Rest> bool read_fields(T *optr, Rest... rest) {
        return read_one<T>(optr) && read_fields(rest...);
    }
    
    
    struct packet {
        int32_t a;
        uint16_t b;
        uint8_t c;
    };
    
    int main(int argc, char const *argv[]) {
        packet p;
        if (!read_fields(&p.a, &p.b, &p.c)) {
            //  timeout here
        }
        return 0;
    }
    You may need a fairly new compiler for this to work, though. I think the default shipped with Arduino doesn't do it, for example.
    (Or maybe it just doesn't turn on the right modern features.)
    Specifically, if you hide away read_fields() and read_one() in headers, each function that reads a packet looks very nice and compact.

  3. #13

    Re: How to build and download firmware to Arbotix Pro

    Thanks Jwatte,

    I will probably avoid the template approach, as I may be too old to learn those new tricks

    Also there may be additional code in between reading in the new bytes, although potentially could include that into the function. In particular, I may try to move the echo of the byte received from the PC (either USB or TTL) to the AX Buss, out of the interrupt handler for the PC serial, and into this processing, as to be able to control if/when it happens. Again maybe not forward if the packet is intended for this device. So I need to get the first two FF's and the ID to decide, and potentially may want to also wait on broadcast ID to see if the instruction is a SYNC_READ and again not foreword. I already have the code in place to not forward our response over the AX-Buss as probably no other servo needs to know this information... Although potentially could make this based on some state...

    However before I make that change to not forward the start of the packet, I will play around with measuring the timings, as currently the echo may not actually hurt anything as I am getting good overlap of data on the different buses. Will see again with the Host Baud rate set to 2mbs, and with some other commands, like just reading one byte.

    Thanks again

  4. Re: How to build and download firmware to Arbotix Pro

    Quote Originally Posted by KurtEck View Post
    It would be great if there were a set of instructions on how to build and download firmware to the Arbotix-Pro,

    And while I understand that updated firmware is not supported, the link here gives you some clues on what you need to install on a Ubuntu setup to be able to run make and have it build firmware. Would be nice if there were instructions on how to do this under windows and/or mac.
    In general, you would be better off to just use Linux (i.e. I use Fedora) which is free, with a STMF3DISCOVERY or STMF4DISCOVERY board which are less the $20 each, as once you have the hang of it, you'll be able to program most STM based cards such as the Arbotix-Pro or OpenCM9.04 with only minor script changes (i.e. make and openocd).

  5. #15
    Join Date
    Dec 2007
    Location
    Portland, OR
    Posts
    3,198
    Images
    952
    Rep Power
    139

    Re: How to build and download firmware to Arbotix Pro

    Re: Original question, to be honest documenting the process isn't a huge priority for me right now.

    It's sort of one of those 'If you have the skillset/desire to reprogram the firmware, you can easily figure out how programming is handled'

    Kurt- You won't start any wars here. The ArbotixPro version of the CM730 firmware is still 98% ROBOTIS authored, and along with the Darwin-OP framework there's a lot in there I don't agree with.

    I'll have more info on my 'swing back around' to the Arbotix-Pro along with what other projects I have on my plate for the year in the near future.

  6. #16

    Re: How to build and download firmware to Arbotix Pro

    Thanks guys,

    Actually as for a guide/documentation: It just would be nice if there was something that told you things like:
    1) the graphics for ISP connector is wrong on the board. If you do the standard of the red wire of the cable to pin 1 on the adapter, and then plug the cable in with the cable to the Arbotix pro with plug matching the outline on the Pro, it won't work...

    2) If you are using Linux to build and you are using one of the programmers that requires settings and/or configuration files, here is the settings I use...

    3) If you really need to use a discovery kit like: http://www.digikey.com/product-searc...M32F3discovery to figure out how to do stuff, maybe give a link to it. Likewise if their documentation like: http://www.st.com/web/en/resource/te...DM00062662.pdf would help people again give a link...

    As for the skill set to reprogram... The actual underlying firmware ideas is really not that complex... If you get something on the USB serial port, send it on to the AX... If you get something on the AX send it to the USB... Intercept a few messages and respond directly...
    Plus some additional support for things like AtoI, subset of IMU, ...

    Desire: The more impediments put into the way, the desire dissipates.

    So for now, I will probably just make it work well enough for me to run TTL level at 2mbs from Odroid/RPI2/(maybe try with Edison), and stop...

    Sounds like more fun to me, to then continue on with Teensy 3.2 version with built in IMU.

  7. #17
    Join Date
    Dec 2007
    Location
    Portland, OR
    Posts
    3,198
    Images
    952
    Rep Power
    139

    Re: How to build and download firmware to Arbotix Pro

    1) I'll need to double check the documentation/pictures we have- I didn't put them up. But nice find, I'll look into it!

    2 & 3) I have no issue with more info on reprogramming them being added to the wiki, but from a company support standpoint I have to be careful as to how much we show support for something we're not officially supporting. Have to draw the line somewhere when it comes to custom application support.

    I'd actually love to take a closer look at your findings with the Teensy3.2 version arbotix you built- I'd like a 9-axis IMU for the gen2 Arbotix-Pro, without a doubt.
    Quote Originally Posted by KurtEck View Post
    Thanks guys,

    Actually as for a guide/documentation: It just would be nice if there was something that told you things like:
    1) the graphics for ISP connector is wrong on the board. If you do the standard of the red wire of the cable to pin 1 on the adapter, and then plug the cable in with the cable to the Arbotix pro with plug matching the outline on the Pro, it won't work...

    2) If you are using Linux to build and you are using one of the programmers that requires settings and/or configuration files, here is the settings I use...

    3) If you really need to use a discovery kit like: http://www.digikey.com/product-searc...M32F3discovery to figure out how to do stuff, maybe give a link to it. Likewise if their documentation like: http://www.st.com/web/en/resource/te...DM00062662.pdf would help people again give a link...

    As for the skill set to reprogram... The actual underlying firmware ideas is really not that complex... If you get something on the USB serial port, send it on to the AX... If you get something on the AX send it to the USB... Intercept a few messages and respond directly...
    Plus some additional support for things like AtoI, subset of IMU, ...

    Desire: The more impediments put into the way, the desire dissipates.

    So for now, I will probably just make it work well enough for me to run TTL level at 2mbs from Odroid/RPI2/(maybe try with Edison), and stop...

    Sounds like more fun to me, to then continue on with Teensy 3.2 version with built in IMU.

  8. #18
    Join Date
    Sep 2010
    Location
    ಠ_ಠ
    Posts
    2,283
    Images
    27
    Rep Power
    275

    Re: How to build and download firmware to Arbotix Pro

    The polarizing key error is not only in any pictures but in the board silkscreen and eagle layout file. Basically, whoever made the header part for that library put the silkscreen indicating the key on the wrong side of the header. It should be on the side with the odd numbered pins, not the side with the even numbered pins.
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    bleh

  9. #19
    Join Date
    Dec 2007
    Location
    Portland, OR
    Posts
    3,198
    Images
    952
    Rep Power
    139

    Re: How to build and download firmware to Arbotix Pro

    Quote Originally Posted by tician View Post
    The polarizing key error is not only in any pictures but in the board silkscreen and eagle layout file. Basically, whoever made the header part for that library put the silkscreen indicating the key on the wrong side of the header. It should be on the side with the odd numbered pins, not the side with the even numbered pins.
    Thanks! I just threw this to the top of my todo list for the v1.2 arbotix-pro updates. I honestly don't remember where I pulled that header part from, the Arbotix-Pro was thrown together a bit faster than I'd have liked due to project schedule. I finally have time to swing back around this summer though.

  10. #20

    Re: How to build and download firmware to Arbotix Pro

    Thanks Andrew,
    Quote Originally Posted by Tyberius View Post
    1) I'll need to double check the documentation/pictures we have- I didn't put them up. But nice find, I'll look into it!
    Actually it was tician who pointed it out to me. Likewise he gave me the hint to make sure you set (at least in the windows app), the connection type as SWD (Serial Wire Debug)

    Quote Originally Posted by Tyberius View Post
    2 & 3) I have no issue with more info on reprogramming them being added to the wiki, but from a company support standpoint I have to be careful as to how much we show support for something we're not officially supporting. Have to draw the line somewhere when it comes to custom application support.
    It would be great if the Wiki had this level of information. Last time I looked, actually the HROS1 wiki had more information than the Arbotix Pro wiki...

    As to how much information? It is hard to say as I have no clue, what Trossen goals and plans are. I also don't understand the don't support, nor do I want to step on any toes.

    But to me, I was hoping that the Arbotix Pro would be the next generation of the Arbotix-m. That is I would hope that it would have some form of boot loader (like Teensy or CM-730), where users could update the board over USB. Also setups where users can use their OS of choice (Linux, MaC, Windows). Also most/all of the hardware stuff was handled by libraries or potentially Arduino...
    For example maybe have it setup to use something like STM32duino...

    At that point, I would then for example build a version of the Phoenix/PhantomX code base that directly ran on it. i.e the 72mhz Arm processor should easily be able to do everything that the 16 mhz 8 bit AVR processor.

    And then for those who wish to use this as a replacement for something like the CM-730, have a program/sketch that you download to it. i.e. sort of like what jwatte mentioned about people using the CM9.04 to control Dynamixels in the posting: http://forums.trossenrobotics.com/sh...encm#post70493 I would probably then ship the board with this sketch loaded on it...

    But again that is just me...

    Quote Originally Posted by Tyberius View Post
    I'd actually love to take a closer look at your findings with the Teensy3.2 version arbotix you built- I'd like a 9-axis IMU for the gen2 Arbotix-Pro, without a doubt.
    Sort of the above goals, is what I am playing around with with my own Teensy projects.

    The current hardware designs is up in my github project: https://github.com/KurtE/Teensy3.1-B...0Arbotix%20Pro The Excel parts list document is currently probably needs to be updated.

    The Arduino Sketch is also up there: https://github.com/KurtE/Teensy_Arbotix_Pro It is still a WIP. In my earlier playing I found I prefer using the DSO055 IMU. I am using the Adafruit breakout board for this. It does most all of the work for you.

    What may be hard to decide is how to expose the information through the CM-730ish registers. That is do you expose the raw data, like the current boards, which people have to continuously read and process, or do you set the registers such that you get the data in a usable state. Maybe match what the ROS module would output... Again this is off of this topic.

    Question is: Would you like to continue this type of discussion, in a new thread here, or email/pm or Google+ or...

    Also again I hope I am not stepping too hard on any toes here.
    Last edited by KurtEck; 02-26-2016 at 02:04 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Arbotix Pro firmware, Timer2 irq handler settings
    By az139 in forum Arbotix, Microcontrollers, Arduino
    Replies: 3
    Last Post: 07-15-2015, 11:37 AM
  2. Question(s) PhantomX AX Hexapod Kit AX-18A Servos Program Download??
    By hwan we in forum Software and Programming
    Replies: 9
    Last Post: 01-27-2013, 09:20 AM
  3. Crab Fu motions now available for download
    By Droid Works in forum Humanoids, Walkers & Crawlers
    Replies: 19
    Last Post: 08-01-2008, 03:18 AM
  4. KHR-1HV Motion files available for download.
    By Droid Works in forum Humanoids, Walkers & Crawlers
    Replies: 3
    Last Post: 04-01-2008, 07:45 AM
  5. Phidgets API Download Link
    By claymore1977 in forum Software and Programming
    Replies: 3
    Last Post: 11-24-2007, 11:48 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
  •