Simple stuff first:
Either github project should work, I try to keep them somewhat in sync, although I have not updated the in parts project with the latest stuff. I mainly used the Arduino Phoenix Parts project when I was doing stuff for several different robots that used different types of servos and different Input devices... However during the last few years, I have not done much (read that anything), with my Lynxmotion Robots which used RC servos controlled by an SSC-32 servo controller, so I have found it easier to work with the Phantom_Phoenix project, as it is more self contained so I can edit most all of the files directly in the Arduino IDE... So I would suggest use the Phantom_Phoenix project.
Arbotix Libraries: Yes if you install my version from the 1.6 branch on github, you should be able to build using Arduino 1.6.7. That is what I do.
Arbotix Commander (XBees): The Phantom_Phoenix project is setup to use the commander. The two XBees need to be paired to each other. I am pretty sure there is instructions for how to do this up with PhantomX tutorial. If you purchased the commander from Trossen, it comes with an Arduino board (last time I looked it was an Atmega 328 board from Seeedstudio). It probably came preprogrammed with their commander code. I typically run my own version in the commander, which you can get from my github project: https://github.com/KurtE/CommanderEx
The main difference is I use more of the logical ranges for the joysticks than they did...
Note: I believe that my Phantom_Phoenix and CommanderEx code actually has code in it that if you feed it two virgin XBees, it will detect that it is configured for 9600 baud and it will update them to the appropriate settings. I have not tried this in awhile...
Wheels: earlier I read this to imply that you had actual wheels connected to the bottom of your legs that allowed you to either walk or drive... (There have been a few that have done this). It is good to see, that what you meant was the servo horns... The location of these horns lower, may impact some settings like initial position, but should not be much of an issue.
Hopefully you should be able to make most (hopefully all) of your changes by changing stuff in the Hex_Cfg.h file.
However, while I try to be as helpful as I can, it may take you awhile to experiment to update all of the settings for your robot. I can try to give hints, but sometimes you need the actual hardware to make it work....
Some of the things to verify/update in the hex config file: Note I might show some line numbers below, from my current one, but could be slightly different)
===========================================
Servo ID's (129-154) ( - Currently the file is setup with the servos set to the ID's as shown in the Trossen assembly guide. Note: In some of my projects (example linux) I have renumbered the ID#1 to be ID 19, such that we can detect if one or more servos was renumbered back to default. I then have code at startup tries to talk to each of the servos. If it can not talk to one specific servo, but can talk to servo 1, it assumes that servo that was missing reset and the code changes #1 to that servo number...
Min/Max Angles(157-203): these are the approximate minimum and maximum angles each of the servos can move. Assuming coxa 0 point is straight out from robot, Femur 0 is with femur horizontal to ground, and Tibia 0 is with tibia a 90 degree angle from femur (i.e perpendicular to ground). Measurements are in 10ths of degree, so 750 is 75 degrees.
Leg Dimensions (213-245)
Coxa's - horizontal distance between center of coxa servo horn and femur servo horn in mm. Which in your case looks pretty small
Femur - Measure straight line between center of femur servo horn and tibia servo (disregard curve)
Tibia - center of tibia horn to tip.
Body Dimensions (250 - 280) - probably OK since using Trossen body.
Now some harder parts that take experimenting.
Start Positions feet (281-320) - First part is trying to figure out the distance the feet are from the coxa servo horn in mm, with the body more or less at the ground. With this you can figure out the X and Z values for each of the legs, where for example the middle legs all of the distance is in the X direction. Where as the Front and rear legs are at something like 60 degrees, so you use the sine and cosine of the angle to calculate the X and Z for each of the legs.
The CHexInitY value is something I always needs to play with. It is the Y distance from the coxa servo to the ground... Again I often need to muck with this with different setups.
Now with some robots (possibly yours), the ideal position of the legs may depend on how high up the body is. I allow you change the height using the commander. For example when the body gets up higher you may wish for the legs to be closer in to the body.
That is what the
Code:
#define CNT_HEX_INITS 2
#define MAX_BODY_Y 150
#ifdef DEFINE_HEX_GLOBALS
const byte g_abHexIntXZ[] PROGMEM = {cHexInitXZ, 144};
const byte g_abHexMaxBodyY[] PROGMEM = { 20, MAX_BODY_Y};
Settings are for. You can define how many y positions you wish to adjust for. The above is setup that if the Y body position is below 20, you should use the 150 distance and if above that use 144...
---------------
Servo Offsets (37-38) - If your leg pieces are not straight, example your Femur, this is the angle adjustment you need such that when the code sets the servo to logically 0 (in femur case horizontal), how many 10ths of a degrees do we need to add or subtract make it horizontal.
Servo Inversion (39-45) plus defaults in Phoenix_Code.h - Hard to explain, but the main code assumes that moving each of the servos in a logical direction will do the same for all of the legs. For example moving a coxa in a positive direction will move it forward (may be back, I forget
) But with our hexapods, if for example you move all of the coxa servos clockwise, the legs on one side would go forward and on the other side backward. To get around this, there is a table in _Phoenix_Code.h that says for some servos, when you logically going to go clockwise these should go counter clockwise. Such that in the coxa case maybe all legs go forward....
Also with most of our robots, we build our left legs and right legs differently. Example if you look PhantomX, you will see that if you are looking from the front, all of the servos have their horns toward the front and connector toward the back. This again influences direction you need the servo to turn to go the desired direction. Again it may take a few attempts to get this correct.
There may be more, but hopefully this can get you started.
Bookmarks