Page 5 of 24 FirstFirst 12345678915 ... LastLast
Results 41 to 50 of 236

Thread: PhantomX controlled by a Raspberry Pi

  1. #41

    Re: PhantomX controlled by a Raspberry Pi

    Thanks tician,

    Will cleanup my makefile like you have. This is obviously more important when I add this stuff into my main phoenix build. Will probably also add a section that includes dependencies, so when I update a header file the relevant code files will be recompiled. Back when I was working, used to also have some development tools that would scan your source list and automatically build the dependencies. Not sure if any one does something like that for Linux.

    Thanks again!
    Kurt

  2. #42
    Join Date
    Sep 2010
    Location
    ಠ_ಠ
    Posts
    2,188
    Images
    27
    Rep Power
    268

    Re: PhantomX controlled by a Raspberry Pi

    CMake for any platform.
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    bleh

  3. #43

    Re: PhantomX controlled by a Raspberry Pi

    Thanks again,

    Also I have been looking at some of the stuff in: http://www.makelinux.net/make3/toc

    And there is some dependency stuff in there, that I will try out.

    Was able to make a set of makefiles to build a few different versions of my THex. Plus a Quick and Dirty makefile to try to call off to those makefiles... Not very good yet but is working.

    Also added one Speach call out at start of Phoenix program that worked. In case anyone is interested I decided to put a copy of my current Raspberry Pi stuff up in my github account (kurte).

    Kurt

  4. #44
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    831
    Images
    25
    Rep Power
    80

    Re: PhantomX controlled by a Raspberry Pi

    So what does it say?

  5. #45

    Re: PhantomX controlled by a Raspberry Pi

    Not much yet
    Code:
    SaySomething("Phoenix Program Starts");
    Now that that works, will look more at the function and see if I should split some stuff up. Things like: once it starts saying something, should I wait for it to complete, or let the code go and maybe have other code to see if it finished...

    This morning playing with make file to see if I can do some automatic dependency generation. It is now sort-of working, but a bit klunky. I have a duplicate list of sources and objects, should convert to just one list. Also the clean function needs work, I simply have it deleting all *.d files... In case anyone is interested, (before I check this one back in)
    Code:
    #~~~~~~~~~~~~~~~~~~~~ Output File Name ~~~~~~~~~~~~~~~~~~~~
    MAIN_OUT = THex3_Commander_SSC32
    
    #~~~~~~~~~~~~~~~~~~~~ Source Files ~~~~~~~~~~~~~~~~~~~~
    MAIN_OBJS = \
            THex3_Commander_SSC32.o \
            Phoenix_Code.o \
            Phoenix_Driver_SSC32.o \
            Phoenix_Input_Commander.o \
            CommanderEx.o \
            Print.o \
            Stream.o \
            WrapperSerial.o \
            speak.o
    
    SOURCES = \
            THex3_Commander_SSC32.cpp \
            Phoenix_Code.cpp \
            Phoenix_Driver_SSC32.cpp \
            Phoenix_Input_Commander.cpp \
            CommanderEx.cpp \
            Print.cpp \
            Stream.cpp \
            WrapperSerial.cpp \
            speak.cpp
    
    
    #~~~~~~~~~~~~~~~~~~~~ Include Directories ~~~~~~~~~~~~~~~~~~~~
    INCLUDE_DIRS = -I. -I/usr/include/espeak
    
    #~~~~~~~~~~~~~~~~~~~~ Library Directories ~~~~~~~~~~~~~~~~~~~~
    LIBRARY_DIRS = -L/usr/lib/arm-linux-gnueabihf
    
    #~~~~~~~~~~~~~~~~~~~~ Compiler Options ~~~~~~~~~~~~~~~~~~~~
    COMPILE_OPTS = -Wall -pedantic -g -O2 -fno-rtti
    #COMPILE_OPTS = -Wall -pedantic -g -O2
    
    #~~~~~~~~~~~~~~~~~~~~ Linker Options ~~~~~~~~~~~~~~~~~~~~
    LDFLAGS = $(LIBRARY_DIRS) -lpthread -lespeak
    
    #~~~~~~~~~~~~~~~~~~~~ Toolchain Prefix ~~~~~~~~~~~~~~~~~~~~
    TCHAIN_PREFIX=arm-linux-gnueabihf-
    #TCHAIN_PREFIX=x86_64-linux-gnu-
    
    CXX = $(TCHAIN_PREFIX)g++
    CXXFLAGS = $(COMPILE_OPTS) $(INCLUDE_DIRS)
    
    #~~~~~~~~~~~~~~~~~~~~ all ~~~~~~~~~~~~~~~~~~~~
    all: begin gccversion build end
    
    #~~~~~~~~~~~~~~~~~~~~ build ~~~~~~~~~~~~~~~~~~~~
    build: $(MAIN_OUT)
    
    $(MAIN_OUT): $(MAIN_OBJS)
        $(CXX) $(CXXFLAGS) $(MAIN_OBJS) -o $(MAIN_OUT) $(LDFLAGS)
    
    MSG_BEGIN = -------- begin --------
    MSG_END = --------  end  --------
    
    #~~~~~~~~~~~~~~~~~~~~ Eye candy ~~~~~~~~~~~~~~~~~~~~
    begin:
        @echo
        @echo $(MSG_BEGIN)
    
    end:
        @echo $(MSG_END)
        @echo
    
    gccversion:
        @$(CC) --version
    
    #~~~~~~~~~~~~~~~~~~~~ clean ~~~~~~~~~~~~~~~~~~~~
    clean: begin clean_list end
    
    clean_list:
        -rm $(MAIN_OBJS)
        -rm $(MAIN_OUT)
        -rm *.d
    
    #~~~~~~~~~~~~~~~~~~~~ backup ~~~~~~~~~~~~~~~~~~~~
    backup: clean
        tar cJvf ../$(MAIN_OUT)_`date +"%Y-%m-%d_%H%M"`.tar.xz *
    
    #~~~~~~~~~~~~~~~~~~~~ Dependency Generation
    include $(subst .cpp,.d,$(SOURCES))
    
    %.d: %.cpp
        $(CC) -M $(CPPFLAGS) $< > $@.$$$$; \
        sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@;  \
        rm -f $@.$$$$
    Also currently I have a few different makefiles as I will make several different robots from the same (or subsets) of sources. So then I have a master makefile that simply calls off to each of the makefiles I want. This one also needs to be cleaned up:
    What I would like is to simply pass through the goals to each of the makefiles. Maybe I should instead try a simple script file?
    Code:
    Prog1:= THex3_Commander_SSC32
    Prog2:= THex3_DIY_SSC32
    
    Programs := $(Prog1) $(Prog2)
    
    
    .PHONY: all $(Programs) 
    
    all: $(Programs)
    
    
    THex3_Commander_SSC32:
        $(MAKE) -f  makefile_THSC $(MAKECMDGOALS)
    
    THex3_DIY_SSC32:
        $(MAKE) -f  makefile_THSX $(MAKECMDGOALS)
    
    clean:
        $(MAKE) -f  makefile_THSC clean
        $(MAKE) -f  makefile_THSX clean
    Kurt

  6. #46
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    831
    Images
    25
    Rep Power
    80

    Re: PhantomX controlled by a Raspberry Pi

    I love those Makefiles. They are clean and easy to read. Totally going to use the layout.

    So quick update:
    I switched over to Xevel's USB2AX yesterday. With his patched dxl_hal file it was a simple drop in replacement. With the exception of the Xbee and the battery everything is now inside the PhantomX body!

    Inside I have to two six port cable hubs, a smps2dynamixel, a castle creations UBEC, a 4 port usb hub (with case removed), the usb2ax and the raspberry pi! That is more than I thought I was going to be able to fit when I started this project.

    Even with all that inside I'm still able to get to all the ports on the raspberry pi as well as the power plug in the back. Which is useful since I can keep the Rpi up and shut down the servos if I'm just doing coding checks or debugging.

  7. #47
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    831
    Images
    25
    Rep Power
    80

    Re: PhantomX controlled by a Raspberry Pi

    So here is a quick video of the robot. Everything is in and functioning! I'm always obsessed with smooth movements so usually any video I do is using a gait speed set really slow. One thing to note is I'm letting the Dynamixel's interpolate the step. I send one sync_write per goal position to keep the traffic through the USB2AX low. Oh yeah... I'm using Xevel's new USB2AX! It's working well with the Raspberry Pi. Next up is more refinement and optimization.

  8. Re: PhantomX controlled by a Raspberry Pi

    Quote Originally Posted by jwatte View Post
    For 19V, I actually built a custom DC DC converter that goes from my 4S battery to 19V (the tolerance is +/- 5% on that according to Zotac support; I'm at +1%) I built the converter as a boost converter based on a MC34063 PWM controller and a N-channel MOSFET and a high-amperage Schottky diode. The heaviest part is the ferrite core of the 220 microHenry inductor... Running on a circuit board I made at OSHpark.com, with very fat traces to take the current. That may be the Achilles heel of this device as a general solution, because I couldn't really find a 19V DC DC converter off the shelf that would work :-(
    Did you look at Dimension Engineering? They are always the first place I look for DC switching regulators...

    The AnyVolt3 can handle up to 3 amps at 3 to 24 volts output, with 5 to 30 volts input (input can be higher or lower than output).

    http://www.dimensionengineering.com/products/anyvolt3

    I used one to provide a very stable 12 volt power supply to a high-end ($6000) laser range finder on a robot that ran off 3S LiPo's, where the possible voltage range from the batteries was way out of spec for the sensor.

    - Jon
    "The best way to predict the future is to invent it." - Alan Kay, inventor of Smalltalk

  9. #49

    Re: PhantomX controlled by a Raspberry Pi

    Good work! Like that you have a version that the servos do some of the work. Should probably merge those changes back into the main sources (at least under ifdef).

    Yesterday I did a little more cleanup of the makefiles and got rid of the duplication of source and target names I had in the previous post. Now I can simply do that like:
    Code:
    SOURCES = \
            THex3_Commander_SSC32.cpp \
            Phoenix_Code.cpp \
            Phoenix_Driver_SSC32.cpp \
            Phoenix_Input_Commander.cpp \
            CommanderEx.cpp \
            Print.cpp \
            Stream.cpp \
            WrapperSerial.cpp \
            speak.cpp
    
    MAIN_OBJS:= $(subst .cpp,.o,$(SOURCES))
    
    MAIN_DEPS:= $(subst .cpp,.d,$(SOURCES))
    Also changed my clean_list:
    Code:
    clean_list:
        -rm -f $(MAIN_OBJS)
        -rm -f $(MAIN_OUT)
        -rm -f $(MAIN_DEPS)
    I checked most of those changes into my github account (except the -f)...

    checked in on my windows machine where Git is easy :lol: I still need to figure out using git on linux machine. Like I copy the changes to my windows machine and check in. Now I want to tell the linux machine to completely ignore your current stuff and sync back up to the copy up on github. There has got be an easy way...

    Edit: I think I fixed the git on the Raspberry with sledge hammer

    git reflog
    git reset --hard HEAD@{5}
    git fetch


    Kurt
    Last edited by KurtEck; 03-27-2013 at 11:46 AM.

  10. Re: PhantomX controlled by a Raspberry Pi

    Yeah! It looks great, well done
    Happy to see an USB2AX in the wild ^^
    ---
    Personal blog: http://xevel.org
    USB2AX documentation: http://xevelabs.com

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Question(s) Raspberry Pi
    By Robonaut in forum Robot Computers
    Replies: 20
    Last Post: 07-07-2013, 11:46 AM
  2. Raspberry Pi Camera coming soon
    By sarendt in forum Robotics General Discussion
    Replies: 1
    Last Post: 03-16-2013, 11:15 PM
  3. About to give up on the Raspberry Pi
    By jwatte in forum Software and Programming
    Replies: 5
    Last Post: 01-14-2013, 11:57 AM
  4. Just For Fun My Raspberry PI
    By rebel in forum Arbotix, Microcontrollers, Arduino
    Replies: 0
    Last Post: 12-31-2012, 06:57 PM
  5. For learning: PhantomX Hexapod vs PhantomX Quadruped
    By Leugim in forum Humanoids, Walkers & Crawlers
    Replies: 4
    Last Post: 10-26-2012, 09:50 AM

Tags for this Thread

Posting Permissions

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