apollo icon indicating copy to clipboard operation
apollo copied to clipboard

Clarification about the perception coordinate frame.

Open snuffysasa opened this issue 8 years ago • 9 comments

message LaneMarker {
  optional apollo.hdmap.LaneBoundaryType.Type lane_type = 1;
  optional double quality = 2; // range = [0,1]; 1 = the best quality
  optional int32 model_degree = 3;
  // equation X = c3 * Z^3 + c2 * Z^2 + c1 * Z + c0
  optional double c0_position = 4;
  optional double c1_heading_angle = 5;
  optional double c2_curvature = 6;
  optional double c3_curvature_derivative = 7;
  optional double view_range = 8;
  optional double longitude_start = 9;
  optional double longitude_end = 10;
}

I have questions about this message,

I am assuming the ego vehicle is at (0,0,0). Is this correct?

And I am assuming that c0, c1, c2, c3 are all coefficients for a 3rd degree polynomial....?

Is there a case where, model_degree will equal 2, and in that case, I assume the equation just becomes: X =c2 * Z^2 + c1 * Z + c0.... is this correct?

also, I am assuming (100,0,0) is to the left of the ego vehicle

(0,100,0) is above the vehicle (towards the sky)

(0,0,100) is straight out in front of the vehicle?

Is this all correct?

The equation provided does NOT represent where the lane line exists in terms of pixels in the camera image, correct?

What is "optional double view_range = 8"

I am assuming longitude start , end is a min, max range of the detected lane line?

Is longitude the X axis or the Z axis? Z axis right?

snuffysasa avatar Jul 17 '18 02:07 snuffysasa

@snuffysasa The coordinate frame for lane line here is the FLU world coordinate: vehicle is (0, 0, 0), X is Front, Y is Left, and Z is Up. Y is calculated as Y = c3X^3 + c2X^2 + c1*X + c0. Longitude start , end is a min, max range of the detected lane line, in X direction.

xiaoshuliu avatar Jul 23 '18 23:07 xiaoshuliu

hmm, you say the formula is

Y = c3X^3 + c2X^2 + c1*X + c0,

but the documentation says the formula is

equation X = c3 * Z^3 + c2 * Z^2 + c1 * Z + c0.

which is correct?

snuffysasa avatar Jul 24 '18 01:07 snuffysasa

@snuffysasa According to the code in "cc_lane_post_processor.cc", I think the formula in document should be a typo. Actually the only difference of these two coordinate frames is an extrinsic matrix from camera to car.

xiaoshuliu avatar Jul 24 '18 01:07 xiaoshuliu

Okay great thank you.

the formula you gave makes sense, but hang on,

are you sure you don't mean X = c3Y^3 + c2Y^2 + c1*Y + c0 ??

"FLU world coordinate: vehicle is (0, 0, 0), X is Front, Y is Left, and Z is Up."

This makes sense as it mimics what is said here: https://github.com/ApolloAuto/apollo/blob/master/docs/specs/Guideline_sensor_Installation_apollo_3.0.md

But just to be clear... does this mean that, positive Y values are to the left of the vehicle and negative Y values are to the right of the vehicle ?

snuffysasa avatar Jul 24 '18 01:07 snuffysasa

@snuffysasa Yes I think Y = c3 * X^3 + c2 * X^2 + c1 * X + c0 should be correct.

xiaoshuliu avatar Jul 24 '18 01:07 xiaoshuliu

and does this mean that, positive Y values are to the left of the vehicle and negative Y values are to the right of the vehicle ?

snuffysasa avatar Jul 24 '18 02:07 snuffysasa

@snuffysasa Yes.

xiaoshuliu avatar Jul 24 '18 02:07 xiaoshuliu

@xiaoshuliu What is X in the formula? Is it car's X coordinate in the global system (taken from /apollo/localization/pose for example)?

Edit: I've been looking in the code. I now believe x is a hardcoded value, x = 3. Is this correct? If yes, does it mean the lane starts 3 meters in front of the center of the car, or it doesn't have anything to do with that?

GeorgeMD avatar Sep 03 '18 09:09 GeorgeMD

@GeorgeMD 你知道X的意思了吗?这个公式里的X从哪来?另外,我想知道这个model_degree表示的意思是什么,longitude_start和longitude_end表示车道线的纵坐标,那横坐标是多少,怎么计算?

wujiyoung avatar Oct 24 '18 08:10 wujiyoung