Skip to content

Commit

Permalink
add new rotation (#14512)
Browse files Browse the repository at this point in the history
* add new rotation  ROLL_270_YAW_180

fix compile error

fix rotation

modify roatation

* modify enum to 41
  • Loading branch information
jinchengde authored Apr 22, 2020
1 parent a96bc6a commit e82880d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/conversion/rotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,5 +294,13 @@ rotate_3f(enum Rotation rot, float &x, float &y, float &z)
y = -tmp;
return;
}

case ROTATION_ROLL_270_YAW_180: {
x = -x;
tmp = y;
y = -z;
z = -tmp;
return;
}
}
}
2 changes: 2 additions & 0 deletions src/lib/conversion/rotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ enum Rotation {
ROTATION_PITCH_45 = 33,
ROTATION_PITCH_315 = 34,
ROTATION_ROLL_90_YAW_270 = 35,
ROTATION_ROLL_270_YAW_180 = 41,
ROTATION_MAX
};

Expand Down Expand Up @@ -131,6 +132,7 @@ const rot_lookup_t rot_lookup[] = {
{ 0, 45, 0 },
{ 0, 315, 0 },
{ 90, 0, 270 },
{270, 0, 180 },
};

/**
Expand Down

0 comments on commit e82880d

Please sign in to comment.