Now I want to adapt this function so the joint goes from its current position to a new angle over a set period of time. example: the angle of a leg joint is at 20°. The simulator gives the command to move from 20° to 60° in a timestamp of 1 second.
From those parameters I can calculated how many °/sec the speed of the servo(joint) has to be but I am not sure how I can get an acceleration from this to use in NewtonUserJointSetRowAcceleration.
you need to set the acceleration on teh right side of teh joint such that is generate the desired velocity basically, on the right size read the error velocity and if is diffrent than what you want, subtract from the desired velocity and divide by the timestep. That usually does the trick.
That did the trick. I made a small movie to show the result. The only problem I still see is that at fast speeds the complete robot is lifted up from the ground a couple of millimeters when one of the legs hits the ground.
wow, very impresive constraction. I was not expecting anyhtong this complicated for your first trial. Very very nice.
I edited your post to show the video instead for the Link.
I think you can solve the lifting of the ground by make a contact material between the legs geometry and the floor. what you are seeing is that when the robot moves faster the leg hit the floor at higher speed than when is moveing slowlliy. the default coeficiend of elaticity to something default is 0.6 so when the leg hit the ground with a not nelglegible velocity it will bound of with some notn zero velocity.
if you make the material and set elasticity to 0.1 or 0.0, that should fix the problem, also you may increase the static and dynamic friction so that the robot has more traction.