Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
5b6fda2e
Commit
5b6fda2e
authored
7 years ago
by
Daniel Agar
Browse files
Options
Downloads
Patches
Plain Diff
uuv_example_app move to matrix lib
parent
ac724298
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/examples/uuv_example_app/uuv_example_app.cpp
+5
-7
5 additions, 7 deletions
src/examples/uuv_example_app/uuv_example_app.cpp
with
5 additions
and
7 deletions
src/examples/uuv_example_app/uuv_example_app.cpp
+
5
−
7
View file @
5b6fda2e
...
...
@@ -133,15 +133,13 @@ int uuv_example_app_main(int argc, char *argv[])
// get current rotation matrix from control state quaternions, the quaternions are generated by the
// attitude_estimator_q application using the sensor data
math
::
Quaternion
q_att
(
raw_ctrl_state
.
q
[
0
],
raw_ctrl_state
.
q
[
1
],
raw_ctrl_state
.
q
[
2
],
raw_ctrl_state
.
q
[
3
]);
// control_state is frequently updated
math
::
Matrix
<
3
,
3
>
R
=
q_att
.
to_dcm
();
// create rotation matrix for the quaternion when post multiplying with a column vector
matrix
::
Quatf
q_att
(
raw_ctrl_state
.
q
);
// control_state is frequently updated
matrix
::
Dcmf
R
=
q_att
;
// create rotation matrix for the quaternion when post multiplying with a column vector
// orientation vectors
mat
h
::
Vector
<
3
>
x_B
(
R
(
0
,
0
),
R
(
1
,
0
),
R
(
2
,
0
));
// orientation body x-axis (in world coordinates)
mat
h
::
Vector
<
3
>
y_B
(
R
(
0
,
1
),
R
(
1
,
1
),
R
(
2
,
1
));
// orientation body y-axis (in world coordinates)
mat
h
::
Vector
<
3
>
z_B
(
R
(
0
,
2
),
R
(
1
,
2
),
R
(
2
,
2
));
// orientation body z-axis (in world coordinates)
mat
rix
::
Vector
3f
x_B
(
R
(
0
,
0
),
R
(
1
,
0
),
R
(
2
,
0
));
// orientation body x-axis (in world coordinates)
mat
rix
::
Vector
3f
y_B
(
R
(
0
,
1
),
R
(
1
,
1
),
R
(
2
,
1
));
// orientation body y-axis (in world coordinates)
mat
rix
::
Vector
3f
z_B
(
R
(
0
,
2
),
R
(
1
,
2
),
R
(
2
,
2
));
// orientation body z-axis (in world coordinates)
PX4_INFO
(
"x_B:
\t
%8.4f
\t
%8.4f
\t
%8.4f"
,
(
double
)
x_B
(
0
),
...
...
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