Implementing stepper motor physics and joint constraints

Started by
0 comments, last by deftware 7 years, 4 months ago

I am trying to move a robot arm whose desired angles for each segment have been solved for with inverse kinematics. The robot arm is in my physics engine and each segment is connected with a joint constraint; these constraints are solved using sequential impulses.

The effect I am trying to achieve is to have a robot arm that can swing at the player, but the player can shoot it to knock its movement back before it hits them.

I would like to be able to move the robot arm using something similar to a stepper motor where each frame each segment will rotate a certain number of steps until the computed target is reached. The issue I am having is with combining this movement with the constraint system. I am easily able to apply the force to each segment to move it a certain amount (I do this by applying the exact torque and force to each segment to make it accelerate it in global coordinate system to so that by the next frame, the angle between each segment will have changed appropriately), but I am unsure how to stop the segment at the end of its step. Floating point rounding errors appear to especially be an issue. I tried applying an opposite force and torque to each segment the next frame but it wasn't precise enough and caused the system to be unstable. It becomes even worse when trying to account for melding the motor force with the force applied to the segments from the constraint resolution.

Does anyone know how to solve this?

Advertisement

Have you taken mass/acceleration into consideration? It sounds like you've completely ignored them and that incorporating them would dampen any 'explosive' issues.

This topic is closed to new replies.

Advertisement