Hexapod Orientation
Posted: 06 Dec 2016, 08:58
Hello,
I'm using reinforcement learning to teach Lyal Randell's hexapod model to walk. I'm using a single threaded script, with no Non-threaded script (this is different from Randell).
The feet use inverse kinematics to move with the function:
simMoveToPosition(whichLeg, -1 , FormerPosition + DisplacementVector, {0,0,0},vel, accel)
To shift the base to the center of the legs, I use:
simMoveToPosition(legBase,antBase,A_Displacement_Vector, {0,0,0},vel,accel)
However, after I run the simulation for a little while, the hexapod base always gets more and more angled (http://imgur.com/eleTapP). I don't call any function that should affect the angle of the base -- for each step all I do is have a foot tip lift up and go back down to 0 height but with a different x and y location. Then I move the base center to the average of the leg positions. It has something to do with orientation, because if I print out the legBase and antBase orientation, the numbers move more and more away from zero as the robot keeps taking steps, until the robot collapses.
I don't understand how the orientation aspect of simMoveToPostion works. I've tried using -1 instead of antBase, and testing out calls to this function with test values, and it seems to act strange and non-predictable. I don't quite understand how the base, legBase, or antBase move when using simMoveToPosition. Is the orientation a displacement vector or is it absolute orientation? Is there anyway I could reorient the base to make it parallel to the floor? That's really all I need is a function to correct for the angle and just set the base orientation to be parallel with the floor. Then I would just call it after each foot step.
I saw in the forums that maybe I should try to change the IK constraints for each foot target dummy to alpha and beta in addition to the x,y,z but that didn't help.
This bug is killing me, since the reinforcement learning seems to be doing great if it weren't for this one bug.
Thanks so much for listening, Hope someone has an idea what this is.
I'm using reinforcement learning to teach Lyal Randell's hexapod model to walk. I'm using a single threaded script, with no Non-threaded script (this is different from Randell).
The feet use inverse kinematics to move with the function:
simMoveToPosition(whichLeg, -1 , FormerPosition + DisplacementVector, {0,0,0},vel, accel)
To shift the base to the center of the legs, I use:
simMoveToPosition(legBase,antBase,A_Displacement_Vector, {0,0,0},vel,accel)
However, after I run the simulation for a little while, the hexapod base always gets more and more angled (http://imgur.com/eleTapP). I don't call any function that should affect the angle of the base -- for each step all I do is have a foot tip lift up and go back down to 0 height but with a different x and y location. Then I move the base center to the average of the leg positions. It has something to do with orientation, because if I print out the legBase and antBase orientation, the numbers move more and more away from zero as the robot keeps taking steps, until the robot collapses.
I don't understand how the orientation aspect of simMoveToPostion works. I've tried using -1 instead of antBase, and testing out calls to this function with test values, and it seems to act strange and non-predictable. I don't quite understand how the base, legBase, or antBase move when using simMoveToPosition. Is the orientation a displacement vector or is it absolute orientation? Is there anyway I could reorient the base to make it parallel to the floor? That's really all I need is a function to correct for the angle and just set the base orientation to be parallel with the floor. Then I would just call it after each foot step.
I saw in the forums that maybe I should try to change the IK constraints for each foot target dummy to alpha and beta in addition to the x,y,z but that didn't help.
This bug is killing me, since the reinforcement learning seems to be doing great if it weren't for this one bug.
Thanks so much for listening, Hope someone has an idea what this is.