|
@@ -42,7 +42,7 @@ public:
|
|
|
T theta_front = variable[3];
|
|
|
|
|
|
//整车旋转
|
|
|
- Eigen::Rotation2D<T> rotation(theta);
|
|
|
+ Eigen::Rotation2D<T> rotation(-theta);
|
|
|
Eigen::Matrix<T, 2, 2> rotation_matrix = rotation.toRotationMatrix();
|
|
|
|
|
|
//左前偏移
|
|
@@ -70,8 +70,8 @@ public:
|
|
|
//左前轮
|
|
|
int left_front_num = m_left_front_cloud->size();
|
|
|
for (int i = 0; i < m_left_front_cloud->size(); ++i) {
|
|
|
- const Eigen::Matrix<T, 2, 1> point((T(m_left_front_cloud->points[i].x) + cx),
|
|
|
- (T(m_left_front_cloud->points[i].y) + cy));
|
|
|
+ const Eigen::Matrix<T, 2, 1> point((T(m_left_front_cloud->points[i].x) - cx),
|
|
|
+ (T(m_left_front_cloud->points[i].y) - cy));
|
|
|
//减去经过车辆旋转计算的左前中心
|
|
|
const Eigen::Matrix<T, 2, 1> tanslate_point = rotation_matrix * point - wheel_center_normal_left_front;
|
|
|
//旋转
|
|
@@ -83,8 +83,8 @@ public:
|
|
|
//右前轮
|
|
|
int right_front_num = m_right_front_cloud->size();
|
|
|
for (int i = 0; i < m_right_front_cloud->size(); ++i) {
|
|
|
- const Eigen::Matrix<T, 2, 1> point((T(m_right_front_cloud->points[i].x) + cx),
|
|
|
- (T(m_right_front_cloud->points[i].y) + cy));
|
|
|
+ const Eigen::Matrix<T, 2, 1> point((T(m_right_front_cloud->points[i].x) - cx),
|
|
|
+ (T(m_right_front_cloud->points[i].y) - cy));
|
|
|
//减去经过车辆旋转计算的左前中心
|
|
|
const Eigen::Matrix<T, 2, 1> tanslate_point = rotation_matrix * point - wheel_center_normal_right_front;
|
|
|
//旋转
|
|
@@ -98,8 +98,8 @@ public:
|
|
|
int left_rear_num = m_left_rear_cloud->size();
|
|
|
|
|
|
for (int i = 0; i < m_left_rear_cloud->size(); ++i) {
|
|
|
- const Eigen::Matrix<T, 2, 1> point((T(m_left_rear_cloud->points[i].x) + cx),
|
|
|
- (T(m_left_rear_cloud->points[i].y) + cy));
|
|
|
+ const Eigen::Matrix<T, 2, 1> point((T(m_left_rear_cloud->points[i].x) - cx),
|
|
|
+ (T(m_left_rear_cloud->points[i].y) - cy));
|
|
|
//减去经过车辆旋转计算的左前中心
|
|
|
const Eigen::Matrix<T, 2, 1> tanslate_point = rotation_matrix * point - wheel_center_normal_left_rear;
|
|
|
interpolator_l.Evaluate(tanslate_point[0]*T(1000.)+T(200.),&residual[2*(left_front_num + right_front_num + i)]);
|
|
@@ -110,8 +110,8 @@ public:
|
|
|
|
|
|
//右后轮
|
|
|
for (int i = 0; i < m_right_rear_cloud->size(); ++i) {
|
|
|
- const Eigen::Matrix<T, 2, 1> point((T(m_right_rear_cloud->points[i].x) + cx),
|
|
|
- (T(m_right_rear_cloud->points[i].y) + cy));
|
|
|
+ const Eigen::Matrix<T, 2, 1> point((T(m_right_rear_cloud->points[i].x) - cx),
|
|
|
+ (T(m_right_rear_cloud->points[i].y) - cy));
|
|
|
//减去经过车辆旋转计算的左前中心
|
|
|
const Eigen::Matrix<T, 2, 1> tanslate_point = rotation_matrix * point - wheel_center_normal_right_rear;
|
|
|
|
|
@@ -155,7 +155,7 @@ public:
|
|
|
T length = variable[2];
|
|
|
|
|
|
//整车旋转
|
|
|
- Eigen::Rotation2D<T> rotation(theta);
|
|
|
+ Eigen::Rotation2D<T> rotation(-theta);
|
|
|
Eigen::Matrix<T, 2, 2> rotation_matrix = rotation.toRotationMatrix();
|
|
|
|
|
|
//左前偏移
|
|
@@ -177,7 +177,7 @@ public:
|
|
|
for (int i = 0; i < m_left_front_cloud->size(); ++i) {
|
|
|
const Eigen::Matrix<T, 2, 1> point((T(m_left_front_cloud->points[i].x)),
|
|
|
(T(m_left_front_cloud->points[i].y)));
|
|
|
- const Eigen::Matrix<T, 2, 1> tp(T(0),cy);
|
|
|
+ const Eigen::Matrix<T, 2, 1> tp(T(0),-cy);
|
|
|
//减去经过车辆旋转计算的左前中心
|
|
|
const Eigen::Matrix<T, 2, 1> point_rotation = rotation_matrix * point +tp- wheel_center_normal_left_front;
|
|
|
interpolator_y.Evaluate(point_rotation[1]*T(1000.)+T(1000.),&residual[i]);
|
|
@@ -189,7 +189,7 @@ public:
|
|
|
for (int i = 0; i < m_right_front_cloud->size(); ++i) {
|
|
|
const Eigen::Matrix<T, 2, 1> point((T(m_right_front_cloud->points[i].x) ),
|
|
|
(T(m_right_front_cloud->points[i].y)));
|
|
|
- const Eigen::Matrix<T, 2, 1> tp(T(0),cy);
|
|
|
+ const Eigen::Matrix<T, 2, 1> tp(T(0),-cy);
|
|
|
//减去经过车辆旋转计算的左前中心
|
|
|
const Eigen::Matrix<T, 2, 1> point_rotation = rotation_matrix * point +tp- wheel_center_normal_right_front;
|
|
|
|
|
@@ -202,7 +202,7 @@ public:
|
|
|
for (int i = 0; i < m_left_rear_cloud->size(); ++i) {
|
|
|
const Eigen::Matrix<T, 2, 1> point((T(m_left_rear_cloud->points[i].x)),
|
|
|
(T(m_left_rear_cloud->points[i].y)));
|
|
|
- const Eigen::Matrix<T, 2, 1> tp(T(0),cy);
|
|
|
+ const Eigen::Matrix<T, 2, 1> tp(T(0),-cy);
|
|
|
//减去经过车辆旋转计算的左前中心
|
|
|
const Eigen::Matrix<T, 2, 1> tanslate_point = rotation_matrix * point +tp- wheel_center_normal_left_rear;
|
|
|
interpolator_y.Evaluate(tanslate_point[1]*T(1000.)+T(1000.),
|
|
@@ -215,7 +215,7 @@ public:
|
|
|
for (int i = 0; i < m_right_rear_cloud->size(); ++i) {
|
|
|
const Eigen::Matrix<T, 2, 1> point((T(m_right_rear_cloud->points[i].x)),
|
|
|
(T(m_right_rear_cloud->points[i].y)));
|
|
|
- const Eigen::Matrix<T, 2, 1> tp(T(0),cy);
|
|
|
+ const Eigen::Matrix<T, 2, 1> tp(T(0),-cy);
|
|
|
//减去经过车辆旋转计算的左前中心
|
|
|
const Eigen::Matrix<T, 2, 1> tanslate_point = rotation_matrix * point +tp- wheel_center_normal_right_rear;
|
|
|
|
|
@@ -270,7 +270,7 @@ public:
|
|
|
T theta=T(theta_);
|
|
|
|
|
|
//整车旋转
|
|
|
- Eigen::Rotation2D<T> rotation(theta);
|
|
|
+ Eigen::Rotation2D<T> rotation(-theta);
|
|
|
Eigen::Matrix<T, 2, 2> rotation_matrix = rotation.toRotationMatrix();
|
|
|
|
|
|
//左前偏移
|
|
@@ -298,8 +298,8 @@ public:
|
|
|
//左前轮
|
|
|
int left_front_num = m_left_front_cloud->size();
|
|
|
for (int i = 0; i < m_left_front_cloud->size(); ++i) {
|
|
|
- const Eigen::Matrix<T, 2, 1> point((T(m_left_front_cloud->points[i].x) + cx),
|
|
|
- (T(m_left_front_cloud->points[i].y) + cy));
|
|
|
+ const Eigen::Matrix<T, 2, 1> point((T(m_left_front_cloud->points[i].x) -cx),
|
|
|
+ (T(m_left_front_cloud->points[i].y) - cy));
|
|
|
//减去经过车辆旋转计算的左前中心
|
|
|
const Eigen::Matrix<T, 2, 1> tanslate_point = rotation_matrix * point - wheel_center_normal_left_front;
|
|
|
//旋转
|
|
@@ -313,8 +313,8 @@ public:
|
|
|
//右前轮
|
|
|
int right_front_num = m_right_front_cloud->size();
|
|
|
for (int i = 0; i < m_right_front_cloud->size(); ++i) {
|
|
|
- const Eigen::Matrix<T, 2, 1> point((T(m_right_front_cloud->points[i].x) + cx),
|
|
|
- (T(m_right_front_cloud->points[i].y) + cy));
|
|
|
+ const Eigen::Matrix<T, 2, 1> point((T(m_right_front_cloud->points[i].x) - cx),
|
|
|
+ (T(m_right_front_cloud->points[i].y) - cy));
|
|
|
//减去经过车辆旋转计算的左前中心
|
|
|
const Eigen::Matrix<T, 2, 1> tanslate_point = rotation_matrix * point - wheel_center_normal_right_front;
|
|
|
//旋转
|
|
@@ -329,8 +329,8 @@ public:
|
|
|
int left_rear_num = m_left_rear_cloud->size();
|
|
|
|
|
|
for (int i = 0; i < m_left_rear_cloud->size(); ++i) {
|
|
|
- const Eigen::Matrix<T, 2, 1> point((T(m_left_rear_cloud->points[i].x) + cx),
|
|
|
- (T(m_left_rear_cloud->points[i].y) + cy));
|
|
|
+ const Eigen::Matrix<T, 2, 1> point((T(m_left_rear_cloud->points[i].x) - cx),
|
|
|
+ (T(m_left_rear_cloud->points[i].y) - cy));
|
|
|
//减去经过车辆旋转计算的左前中心
|
|
|
const Eigen::Matrix<T, 2, 1> tanslate_point = rotation_matrix * point - wheel_center_normal_left_rear;
|
|
|
interpolator_l.Evaluate(tanslate_point[0]*T(1000.)+T(200.),&residual[2*(left_front_num + right_front_num + i)]);
|
|
@@ -342,8 +342,8 @@ public:
|
|
|
//右后轮
|
|
|
|
|
|
for (int i = 0; i < m_right_rear_cloud->size(); ++i) {
|
|
|
- const Eigen::Matrix<T, 2, 1> point((T(m_right_rear_cloud->points[i].x) + cx),
|
|
|
- (T(m_right_rear_cloud->points[i].y) + cy));
|
|
|
+ const Eigen::Matrix<T, 2, 1> point((T(m_right_rear_cloud->points[i].x) - cx),
|
|
|
+ (T(m_right_rear_cloud->points[i].y) - cy));
|
|
|
//减去经过车辆旋转计算的左前中心
|
|
|
const Eigen::Matrix<T, 2, 1> tanslate_point = rotation_matrix * point - wheel_center_normal_right_rear;
|
|
|
|
|
@@ -576,4 +576,4 @@ pcl::PointCloud<pcl::PointXYZ>::Ptr detect_wheel_ceres::filter(pcl::PointCloud<p
|
|
|
out->push_back(cloud->points[i]);
|
|
|
}
|
|
|
return out;
|
|
|
-}
|
|
|
+}
|