Kurt's Raspberry Pi (and BeagleBone Black)

Found it. My fault. I re-assigned a few of the button functions a few days ago and made a mistake on the “stand up, sit down” command.

Glad you found it. Still need to verify mine to see if the millis() fix makes the Commander work better. Also still want to rework it some to now use my wrapper serial class, like my DIYXBee controller code is.

Kurt

So just a small update. I’ve been working on mostly hardware stuff. I’ve created a simple wiring harness that I can switch back and forth from the battery power supply and a bench power supply for the raspberry pi. I figured it would be a nice addition since I might want to ssh into it for a long while and pulling from the battery just wouldn’t be a wise option all the time. I have my phantomX pulled apart and will be mounting the Rpi in it’s place. He is a link for anyone interested that gives you a nice template for your mounting holes on the rpi.

raspberrypi.org/archives/2691

So here is my work in progress of my PhantomX controlled by a Raspberry Pi. This version is all floating point and standard math libraries are used. Body FK is still rough and is prone to glitches so more work is needed. But hey, it’s progress. Once the body FK is fixed I will post the code if anyone is interested. Though I would suggest waiting and using Kurt’s up and comming Raspberry Pi version since mine doesn’t have a GP player or single leg control. (something I don’t need or use so I depricated it in my branch)

Communication to the servos are done with the Robotis USB2Dynamixel and their SDK. I have one of Xevel’s USB2AX from Seeed on order and I am planning to switch to that due to its small form factor. Power to the servos is provided by the Robotis smps2dynamixel. Power to the Rpi will be done with a BEC from Castle Creations when I mount all this inside.

Special thanks to Kurt in writing the Xbee code for the Raspberry Pi so I could still use my Arbotix Commander to control it!

Looks great! Very well done!

Looking good. I will be honest and mention I don’t use them much either :laughing: But do try to keep them working. I will try to post a quick and dirty video of my T-Hex walking with the Pi code. It will be interesting to see which code base (floating point or integer) produces better results. My guess is it will be a wash, especially when you factor in the precision levels in the servos themselves…

WIll also still have USB cable hanging off of it. Waiting for a few pieces of hardware to arrive to allow me to try to mount all of it on the robot (maybe with parts hanging here and there…
Castle UBEC - Arrived
Sparkfun parts - (IO voltage converters so could probably hook normal SSC-32 up to it instead of going through USB. USB breakout to make it easier to hook up power to pi)
Robotshop (next week) - Parts to try to hook up to PhantomX…

Again looking good! Also thank you for all of your help for giving me help in remembering how to do stuff on linux.
Kurt

Kevin (and others),

I have been wondering about how to configure my Pi when using it with a robot, in this case assume my T-Hex.

Power: Probably use one of my LifePo4 batteries (6.6v) Connect it up to VS of SSC-32 (through switch). Use my castle BEC through 2nd switch to convert to 5v and connect it up Pi plus to the USB hub.

SSC-32u: connect up to USB hub.

XBee: probably connect to USB hub, but could probably connect directly up to Pi serial port.

HDMI: Majority of time I run my Pi without HDMI or mouse/keyboard but sometimes I plug HDMI into my TV and plug mouse and keyboard into USB…

Now for the stuff I am trying to decide.
Ethernet: Currently I have this hard wired. Should I instead use a wireless connection? Suggestions on which? Dongle into Cat5 connection or USB? How much power does this take…

Also currently I run my code by starting it up in a PuTTY window. Should I instead add this to automatically run in some configuration file?

Thoughts? Suggestions?

Thanks
Kurt

This is looking very good!

8-Dale

Again please pardon my real poor quality video, but at least it shows it up and working. This one I made using the Arbotix Commander, could also do with DIY remote.

For the heck of it I converted it to black and white…

Kurt

The Raspberry is B&W?

Does move pretty good. What’s all the wires?

Alan KM6VV

As I mentioned earlier I still have a USB cable plugged in to the Pi which is sitting on my desk. The other wire you see at the back is the wall wart that goes to the USB hub. Sparkfun stuff arrived so I can now work on moving stuff onto the actual robot.

Kurt

Looks great Kurt! :smiley:
Do you have any impression of how much resources the hex code require from the PI? In other word, is it possible to do many other tasks while running the hex code. For example using a web camera for object detection, openCV?

Great to see you both are doing good progress.

In my case the life is a bit to busy at the moment. :laughing: :unamused: :cry:

Thanks Zenta,

Not sure yet on performance. Need to learn some more Linux stuff. They for sure have some form of perf monitor… I have seen a few places that show how to install OpenCV on a Pi, so I know that it at least can do some of it…

Kurt

Nicely done indeed.

Run your program with an & at the end and run “top” that’ll tell you it’s CPU usage.

For example: My program is called “Charlotte” so I run the following commands:

./Charlotte &
top

That should show you all the CPU activity. If you know the process id you can isolate to just your program and watch it as you control the robot.

linux.about.com/od/commands/l/blcmdl1_top.htm

It will look something like this…


  PID USER     PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND         
15479 kevin    20   0 1553m 418m  25m S  1.0  1.7 101:50.73 firefox         
15633 kevin    20   0 1174m 107m  12m S  0.7  0.4  39:15.45 plugin-container 
 4911 kevin    20   0  359m  13m 9.8m S  0.3  0.1   0:00.11 gnome-terminal  
 5139 kevin    20   0 13196 1484  908 R  0.3  0.0   0:00.03 top             
 5937 root     20   0  286m 131m 8196 S  0.3  0.5 240:49.26 Xorg            
31022 kevin    20   0 1197m  46m  11m S  0.3  0.2  15:16.96 python          

Thanks Kevin,

Probably some day will figure out how to create a new user not named pi :wink:

Are you creating a start-up script or the like to launch your program when the Pi starts up? (probably in the /etc/init.d directory?) If so, is there an easy way to later to attach a putty window, if you later wish to interact with the program, or do you simply kill the existing one and then start it from your putty window? Obviously for debug output stuff could simply direct the output to file and use something like the tail command to see the output, but not sure if there is a simple way to attach something a window to the stdin of a running program.

Kurt

sudo adduser kurtE

adduser kurtE sudo

So you can switch to sudo when needed while using that account.

Thanks Kevin, although it looks like unless I change the adduser.conf file, the user name can not contain upper case characters.

Kurt

Ah I wasn’t really thinking. :slight_smile: Mine is all lower case.