Steering Problem

This topic is 3608 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I'm trying to work out a system to let me move an object towards a destination, using a constant rate of change in speed and angle (in 2D). I have a moving object. It has an initial location (x,y), heading and speed. I also have a destination point (x,y). What I would like, is some way to calculate the constant acceleration and rate of turning (ie. degrees per frame) required to get the object to the destination point. I am not interested in the object's speed or heading when it reaches the final destination. I'm not using a "proper" programming language, so code examples won't be a lot of use me, but if anyone can help with the maths, then that would be amazing. I realize it's a pretty big ask, but if anyone could help me, or perhaps point me in the direction of some relevant articles then I'd really appreciate it. Thanks :)

Share on other sites
Using your initial position, heading, speed, and the target point, just solve for a spiral which has both points on it, and which has your initial heading tangential to it; to keep delta-theta constant, you'll need to include your initial velocity to calculate a constant delta-speed. This assumes that rotation of your vehicle causes no loss in velocity, and no slippage.

Share on other sites
Quote:
 Original post by SketchysI'm trying to work out a system to let me move an object towards a destination, using a constant rate of change in speed and angle (in 2D).I have a moving object. It has an initial location (x,y), heading and speed.I also have a destination point (x,y).What I would like, is some way to calculate the constant acceleration and rate of turning (ie. degrees per frame) required to get the object to the destination point.I am not interested in the object's speed or heading when it reaches the final destination.I'm not using a "proper" programming language, so code examples won't be a lot of use me, but if anyone can help with the maths, then that would be amazing.I realize it's a pretty big ask, but if anyone could help me, or perhaps point me in the direction of some relevant articles then I'd really appreciate it.Thanks :)
Are you familiar with Craig Reynolds' articles on steering behaviors? If not, you might check them out - I believe that 'arriving at a target location' is one of the behaviors discussed.

Share on other sites
Wyrframe:
You are right to assume there will be no loss of velocity and no slippage when turning, so hopefully that will be ok.

To be honest though, a lot of what you said went over my head.

Having looked into spirals a little, there appear to be several different kinds, with completely different formulae - eg. "equiangular", "archimedean" etc. How do I know which kind to use? Could you tell me how to calculate the equation of a spiral?

The main problem though, is that I don't understand how any of the parameters in the spiral equations, relate to the variables in my game - speed, heading, turning rate etc.

Could you please possibly go into a little more detail?

Jyk: Thanks for the suggestion. I will check out that article.

1. 1
2. 2
3. 3
4. 4
Rutin
13
5. 5

• 12
• 15
• 9
• 14
• 10
• Forum Statistics

• Total Topics
632655
• Total Posts
3007675
• Who's Online (See full list)

There are no registered users currently online

×