Problem with Angularvelocity Parameters in ODE
Hei everybody, I would like to ask for help ? Sorry for my english if i make some mistakes but i am french ...
So what about my "strange problem", i will try to explain it as good as I can.
I have a simple program, with a field of football, and i have some cubes who correspond to robots. Doesn't matter how many ...
Let's just say there is one.
In my code I have a user control, that i can move the robot.
For now I used to move the robot by changing the linearvelocity and the rotation. It was fine and was working.
Code:
dBodySetLinearVel(opp1->getBodyRobot(),cos(orientation)*robo_x_vel, sin(direction)*robo_x_vel,robo_z_vel);
dRFromAxisAndAngle(Ro,0,0,1,direction);
dBodySetRotation(opp1->getBodyRobot(),Ro);
dBodySetRotation(opp1->getBodyKicker(),Ro);
But now i want to use the angularvelocity in order that the speed of the robot when he changes the orientation could take different values, and so could be slow or fast ... depending on the value ... and the robot will stop moving when he will be in the position asked.
Code:
//Set the velocity dBodySetLinearVel(opp1->getBodyRobot(),cos(direction)*robo_x_vel, sin(direction)*robo_x_vel,robo_z_vel);
dBodySetAngularVel (opp1->getBodyRobot(), 0, 0, 40);
The problem is that when i set the angular velocity on the z-axis, the robot turn, and after few time, if i move him by changing the linearvelocity, he just become "crazy" and not stable, and turn with just touching the ground, with a corner of the cube. I would like he stay right compared to the ground.
Hope i'am clear in my explanations, if i am not, please tell me, i will try to do a video of what happen and give a link.
Thank you.
Pierre-Alain
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement