I am still doing some cleanup and rearranging code. Things like trying to add more scoping of variables into the code. Creating classes for the Input controllers and for the Servo Drivers… Still very much a WIP.
I split off the code to start this off, where it is specific to the BotBoardDuino, Using an SSC-32, with a PS2 controller and is configured for a CH3-R type Hex. For other Round Hex robots, you will probably simply need to play with the configuration file (Hex_Cfg.h) and probably update the sections:
//--------------------------------------------------------------------
//[LEG DIMENSIONS]
//Universal dimensions for each leg in mm
#define cXXCoxaLength 29 // This is for CH3-R with Type 3 legs
#define cXXFemurLength 57
#define cXXTibiaLength 141
#define cXXTarsLength 85 // 4DOF only...
And the Initial position:
//[START POSITIONS FEET]
#define cHexInitXZ 80
#define CHexInitXZCos60 40 // COS(60) = .5
#define CHexInitXZSin60 69 // sin(60) = .866
#define CHexInitY 80 //30
You can get some pretty good estimates for the Leg information from an output file generated by Powerpod…
[code];****************************************************
; 3DOF-A Leg Dimensions (TibiaAngle constant = 0)
;HipV_HipH con 38 ;1.50" = 38mm (1.50 * 25.4)
;Femur_Length con 57 ;2.25" = 57mm (2.25 * 25.4)
;Tibia_Length con 124 ;4.875" = 124mm (4.875 * 25.4)
; 3DOF-B Leg Dimensions (TibiaAngle constant = 0)
;HipV_HipH con 29 ;1.14" = 29mm (1.14 * 25.4)
;Femur_Length con 57 ;2.25" = 57mm (2.25 * 25.4)
;Tibia_Length con 108 ;4.25" = 108mm (4.25 * 25.4)
; 3DOF-C Leg Dimensions (TibiaAngle constant = 20)
;HipV_HipH con 29 ;1.14" = 29mm (1.14 * 25.4)
;Femur_Length con 57 ;2.25" = 57mm (2.25 * 25.4)
;Tibia_Length con 141 ;5.55" = 141mm (5.55 * 25.4)
; 3DOF-(Old) Leg Dimensions (TibiaAngle constant = 0)
;HipV_HipH con 32 ;1.25" = 32mm (1.25 * 25.4)
;Femur_Length con 70 ;2.75" = 70mm (2.75 * 25.4)
;Tibia_Length con 108 ;4.25" = 108mm (4.25 * 25.4)
;****************************************************[/code]
Would also like to get a configuration file set up for Phoenix, (But I don’t want to mess with my Arc32 phoenix… ).
But if anyone else starts to play with this and sets up a good configuration, it would be great if you shared .
In this cleanup of code, I believe I have removed many of the external library references I was using before. Some of it made it nicer to code, but thought I should reduce it. However this code is still very much reliant on the PS2X library (billporter.info/playstation- … rary-v1-0/)
Note: While maybe not necessary, there were some fixes/enhancements that went into the PS2x code this week, that you may want to get. You can download from GitHub (github.com/madsci1016/Arduino-PS2X).
Kurt
P.S - Again this is a WIP so expect things to change. I will now work on merging this back into my older version such that I have the Non-SSC-32 version, Plus XBee, plus…
BotBoardDuino_CHR3_PS2-120413a.zip (29.1 KB)