Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Ardupilot
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
Ardupilot
Commits
3d2c9910
Commit
3d2c9910
authored
10 years ago
by
Randy Mackay
Browse files
Options
Downloads
Patches
Plain Diff
AP_Math: add yaw 293, pitch 68, roll 180 rotation
parent
13b8159f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libraries/AP_Math/rotations.h
+2
-1
2 additions, 1 deletion
libraries/AP_Math/rotations.h
libraries/AP_Math/vector3.cpp
+9
-0
9 additions, 0 deletions
libraries/AP_Math/vector3.cpp
with
11 additions
and
1 deletion
libraries/AP_Math/rotations.h
+
2
−
1
View file @
3d2c9910
...
@@ -64,11 +64,12 @@ enum Rotation {
...
@@ -64,11 +64,12 @@ enum Rotation {
ROTATION_ROLL_270_PITCH_270
=
35
,
ROTATION_ROLL_270_PITCH_270
=
35
,
ROTATION_ROLL_90_PITCH_180_YAW_90
=
36
,
ROTATION_ROLL_90_PITCH_180_YAW_90
=
36
,
ROTATION_ROLL_90_YAW_270
=
37
,
ROTATION_ROLL_90_YAW_270
=
37
,
ROTATION_YAW_293_PITCH_68_ROLL_180
=
38
,
ROTATION_MAX
ROTATION_MAX
};
};
/*
/*
Here are the same values in a form sutable for a @Values attribute in
Here are the same values in a form sutable for a @Values attribute in
auto documentation:
auto documentation:
@Values: 0:None,1:Yaw45,2:Yaw90,3:Yaw135,4:Yaw180,5:Yaw225,6:Yaw270,7:Yaw315,8:Roll180,9:Roll180Yaw45,10:Roll180Yaw90,11:Roll180Yaw135,12:Pitch180,13:Roll180Yaw225,14:Roll180Yaw270,15:Roll180Yaw315,16:Roll90,17:Roll90Yaw45,18:Roll90Yaw90,19:Roll90Yaw135,20:Roll270,21:Roll270Yaw45,22:Roll270Yaw90,23:Roll270Yaw136,24:Pitch90,25:Pitch270,26:Pitch180Yaw90,27:Pitch180Yaw270,28:Roll90Pitch90,29:Roll180Pitch90,30:Roll270Pitch90,31:Roll90Pitch180,32:Roll270Pitch180,33:Roll90Pitch270,34:Roll180Pitch270,35:Roll270Pitch270,36:Roll90Pitch180Yaw90,37:Roll90Yaw270
@Values: 0:None,1:Yaw45,2:Yaw90,3:Yaw135,4:Yaw180,5:Yaw225,6:Yaw270,7:Yaw315,8:Roll180,9:Roll180Yaw45,10:Roll180Yaw90,11:Roll180Yaw135,12:Pitch180,13:Roll180Yaw225,14:Roll180Yaw270,15:Roll180Yaw315,16:Roll90,17:Roll90Yaw45,18:Roll90Yaw90,19:Roll90Yaw135,20:Roll270,21:Roll270Yaw45,22:Roll270Yaw90,23:Roll270Yaw136,24:Pitch90,25:Pitch270,26:Pitch180Yaw90,27:Pitch180Yaw270,28:Roll90Pitch90,29:Roll180Pitch90,30:Roll270Pitch90,31:Roll90Pitch180,32:Roll270Pitch180,33:Roll90Pitch270,34:Roll180Pitch270,35:Roll270Pitch270,36:Roll90Pitch180Yaw90,37:Roll90Yaw270
,38:Yaw293Pitch68Roll180
*/
*/
This diff is collapsed.
Click to expand it.
libraries/AP_Math/vector3.cpp
+
9
−
0
View file @
3d2c9910
...
@@ -221,6 +221,15 @@ void Vector3<T>::rotate(enum Rotation rotation)
...
@@ -221,6 +221,15 @@ void Vector3<T>::rotate(enum Rotation rotation)
tmp
=
x
;
x
=
y
;
y
=
-
tmp
;
tmp
=
x
;
x
=
y
;
y
=
-
tmp
;
return
;
return
;
}
}
case
ROTATION_YAW_293_PITCH_68_ROLL_180
:
{
float
tmp
=
x
;
float
tmpy
=
y
;
float
tmpz
=
z
;
x
=
0.1430389
f
*
tmp
-
0.9184465
f
*
tmpy
-
0.3687762
f
*
tmpz
;
y
=
-
0.3321327
f
*
tmp
-
0.3955452
f
*
tmpy
+
0.8562895
f
*
tmpz
;
z
=
-
0.9323238
f
*
tmp
-
0.00000003
f
*
tmpy
-
0.3616245
f
*
tmpz
;
return
;
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment