0
$\begingroup$

I am trying to calculate the corner points of the vehicle given the details below:

  • Localization data from rear axle of the vehicle
  • Length and Width of the vehicle
  • Heading of the vehicle ENU

Could anybody help me calculate the 4 corner points of the vehicle?

$\endgroup$
  • $\begingroup$ calculate the corner based on the offset from your sensor position on the vehicle! $\endgroup$ – Max N Sep 17 at 9:54
  • $\begingroup$ Is there a any mathematical formulae to get the corner points ? $\endgroup$ – KK2491 Sep 17 at 11:10
3
$\begingroup$

Your vehicle heading is some angle, and the corner is some distance from the rear axle. The best coordinate system to use for angles and distances is polar. So, start with a vehicle layout like:

Polar vehicle arrangement

I'm only going to go over one corner (the rest is your work to do :-)), but consider the front passenger-side corner (top view), from the center of the rear axle. You could measure the corner to be some $<x_0, y_0>$ from the center, but the easier way to handle it would be as an $<r, \theta>$ from the rear center.

Unless the car body is deforming, your $r$ and $\theta$ remain constant. Now, whenever you get a new heading $\phi$, you can add that to your "default" angle $\theta$. That is, $\theta$ is driven by your vehicle's geometry, $\phi$ is driven by your vehicle's heading. You wind up with:

$$ x = r\cos\left(\theta + \phi\right) \\ y = r\sin\left(\theta + \phi\right) $$

You need to be careful with the combination of $\theta$ and $\phi$ - how the angles are added will depend on how you choose to define your angles. If you were lay a compass rose over the vehicle image I've drawn, my definition of $\theta$ would be from the "East" and increasing positive counter-clockwise. Compass angles, though, start with zero at the North and increase positive in the clockwise direction.

The easiest way to handle this would be to define your own $\theta$ using the same angular conventions as your heading, because then you really can just sum the two angles and get your corners. You may (will probably) need to redefine which trig functions are used if you're changing the angular definitions.

Please give this a shot and, if you've still got questions, please feel free to ask them here! Small follow-ups can be handled in comments, but if there's a big change in scope then please start a new question (you can link to this question in the new post).

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ Thanks Chuck for the excellent explanation. I will try to implement the same and get back to you if any queries. $\endgroup$ – KK2491 Sep 21 at 11:15
  • 1
    $\begingroup$ @KK2491 - Happy to help :) Good luck, sounds like it's part of a fun project :) $\endgroup$ – Chuck Sep 21 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.