Xan can answer this one better than I can. But he has different source files for different input devices. I am not sure if you are asking how to build the appropriate version 2.0 phoenix code or once you have a project how do you switch input devicesā¦
First if this is the first time, with using the projects. After you downloaded the zip file that contained all of the files for the project, what you do is to open the project file: Something like: phoenix_v20.prj. This will show up in the workspace, which you can expand to show all of the files in the project. Double click on one will open up that source file. Now when you click on Build or Program, the compiler will basically read all of the files in the project list in the order they are shown and compile it all at once. I hope that makes sense.
If on the other hand you are asking how to convert from one input type build to another. Example you have both the PS2 file and the RC version in the same directory and you are currently building for the PS2. What you can do is go to the project menu and choose the add file to project menu item. You then select the RC file and add it at the end of the project file list. You then go into the workspace part of the screen which shows the project. Make sure the project is fully shown (click on +). Now select the PS2 file in this and then go back up to the project menu and say remove this fileā¦ Then build the project.
Iāll have to take a closer look at it then I remember reading about how you could include code from another .bas file into another project. I assumed it was a ā¦ well something similar to in c ā¦ which i know 0% about.
I see he took advantage of your assembly code! I am every eager to try this I have studied the other code that zenta sent me for RC that I was tweaking with for the past couple months and got to a point a couple months ago where i could make a change and it would still operate afterwords, this is a whole new ballgame.
I remember someone making a comment about the 1.0 code being very very close to the atomās max cpu usageā¦ then adding the Pulsinās really caused gait lag not as smooth as ps2 input.
Looks like thatās completely taken care of now!.. cant wait to try it all.
Iām currently apply your math changes from V1.3 to V2.0 to my C-port from your code. First Iāve to say: Greate work again and big thanks for releasing the Code.
Iām wondering why youāre recalculate GaitInMotion in Gait() and not in GaitSeq() (line 726 of phoenix_v20.bas).
If I understand your code right, there is no change from leg to leg.
And why you donāt use GaitInMotion when you set SSCTime (line 427 of phoenix_v20.bas)?
Kurt covered your question pretty well. The only thing I would like to add is that you have to make sure that the 3 files are placed in the correct order. The compiler builds the project files from top to bottom. The correct file order can be found in the Ć¢ā¬ĖPhoenix_V20.basā file.
There is no need for changing files besides the control file if you want to need to change the input. Thatās the reason why those functions are in separate files now. If you are working with another hex, load a different cfg file. If you want another controller or AI, change the control file. Sounds cool doesnāt it 8)
Hi Daniel,
Can you provide me with a copy once youāre done? I would love to see the differences.
Good tracing! I implemented the indexed version right before release, I probably overlooked this. The GaitInMotion calculation can also be done before the loop in the GaitSeq function or even in the main loop. This would prevent it from calculating the same thing 6 times. Good find.
I recall looking at this. There where some changes made to get the SSC in sync with the BAP while walking and turning off. This probably changed during the modifications on this part. Anyway, I donāt see why you canāt use the GaitInMotion value. Let me know how it worked out.
Itās good to have an extra eye looking over the code from time to time. Your suggestions are more then welcome. Again, great found!
Iāve made some changes in 2.0 already to get the body rotation with a precision of 0.1 degree. This was needed for the balance mode in the TA part which Iām working on. Maybe I put those changes together with the ones you pointed at in a minor update release.
Sure, I will post a link. Still have to do the SingleLegMode and maybe the GP-Player.
The code can run at every Linux PC with a joystick and a serial port. I run it at a RoBoard.
Does it affect the binary size or the speed if you work in Main and in ServoDriver only with one loop for Leg?
Just work with a var for the sign.
[code];--------------------------------------------------------------------
;[SERVO DRIVER] Updates the positions of the servos
ServoDriver:
sign=-1
for LegIndex = 0 to 5
IF (LegIndex = 3) THEN
sign = 1
ENDIF
serout cSSC_OUT, cSSC_BAUD, ā#ā,dec cCoxaPin(LegIndex) ,āPā,dec (sign*CoxaAngle1(LegIndex) +900)1000/1059+650]
serout cSSC_OUT, cSSC_BAUD, ā#ā,dec cFemurPin(LegIndex),āPā,dec (signFemurAngle1(LegIndex)+900)1000/1059+650]
serout cSSC_OUT, cSSC_BAUD, ā#ā,dec cTibiaPin(LegIndex),āPā,dec (signTibiaAngle1(LegIndex)+900)*1000/1059+650]
next
Could you please post the ābitcodeā table for the ps2 remotes?
I have an extra āhomeā button that i want to use. I donāt know if that code is on there but it would be handy to have anyway for programming unused buttons.
I think I have it opening up to the button configuration. Note the byte numbers are off as we donāt process the PS2 packets in the standard way. But bytes 1,2 in the packet will correspond to 4,5 in the documentā¦
Yes, the function is made that it can only control a single leg at the time. The leg will return to the ground if you switch to another leg. This is done to ensure stability.
It isnāt a simple value that can be changed to enable this function. But with some programming it sure can be done. Having the abillity to control more legs is doable. The hard part will be to make it stable with the different leg combinations. Iām not planning on implementing this. But feel free to give it a try.
Ok thank you. I will look into it when the time is thereā¦
One more question though:
with the new 2.0 code i have a problem. When i start my hexapod and it stands in the normal position, it stands skew. so that would be the Z axis (when looking from the front the right side is lower then the left side. I remember that i had this problem before, with the 1.3 code. But it suddenly went away and i never had the problem again. Do you or anyone else know how to solve this?
Does this happen directly after the bot is started or when you switch to body rotation?
Iām asking this because body rotation on X, Y, Z and body position on X, Z are initialized to 0 on startup. They only change if, the program is in body rotation mode, or balance mode is on. If the program is in body rotation mode the body angle is directly feeded by the position of the stick. It can be possible that the PS2 remote gives a small error which causes the body to rotate by default. Iāve seen this happen with some remotes. Sometimes the bot started to walk by itself. thatās why there is a deadzone programmed for the walking part.
The balance mode only changes the angle of the body when a leg is lift from the ground. I donāt think this is the problem youāre describing.