Sign in to follow this  
Sketchys

Steering Problem

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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by Sketchys
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 :)
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 this post


Link to post
Share on other sites
Thanks a lot for your reply :)
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this