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
773d1ec6
Commit
773d1ec6
authored
7 years ago
by
Mohammed Kabir
Committed by
Lorenz Meier
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
camera_feedback : only use global position subscription to fill geotagging packet
parent
c623e64f
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/modules/camera_feedback/camera_feedback.cpp
+4
-14
4 additions, 14 deletions
src/modules/camera_feedback/camera_feedback.cpp
with
4 additions
and
14 deletions
src/modules/camera_feedback/camera_feedback.cpp
+
4
−
14
View file @
773d1ec6
...
...
@@ -50,7 +50,6 @@ CameraFeedback::CameraFeedback() :
_task_should_exit
(
false
),
_main_task
(
-
1
),
_trigger_sub
(
-
1
),
_lpos_sub
(
-
1
),
_gpos_sub
(
-
1
),
_att_sub
(
-
1
),
_capture_pub
(
nullptr
),
...
...
@@ -141,10 +140,8 @@ CameraFeedback::task_main()
fds
[
0
].
events
=
POLLIN
;
// Geotagging subscriptions
_lpos_sub
=
orb_subscribe
(
ORB_ID
(
vehicle_local_position
));
_gpos_sub
=
orb_subscribe
(
ORB_ID
(
vehicle_global_position
));
_att_sub
=
orb_subscribe
(
ORB_ID
(
vehicle_attitude
));
struct
vehicle_local_position_s
lpos
=
{};
struct
vehicle_global_position_s
gpos
=
{};
struct
vehicle_attitude_s
att
=
{};
...
...
@@ -172,22 +169,15 @@ CameraFeedback::task_main()
orb_copy
(
ORB_ID
(
vehicle_global_position
),
_gpos_sub
,
&
gpos
);
}
orb_check
(
_lpos_sub
,
&
updated
);
if
(
updated
)
{
orb_copy
(
ORB_ID
(
vehicle_local_position
),
_lpos_sub
,
&
lpos
);
}
orb_check
(
_att_sub
,
&
updated
);
if
(
updated
)
{
orb_copy
(
ORB_ID
(
vehicle_attitude
),
_att_sub
,
&
att
);
}
if
(
gpos
.
timestamp
==
0
||
lpos
.
timestamp
==
0
||
att
.
timestamp
==
0
||
!
lpos
.
xy_valid
)
{
if
(
trig
.
timestamp
==
0
||
gpos
.
timestamp
==
0
||
att
.
timestamp
==
0
)
{
// reject until we have valid data
continue
;
}
...
...
@@ -209,7 +199,7 @@ CameraFeedback::task_main()
capture
.
alt
=
gpos
.
alt
;
capture
.
ground_distance
=
l
pos
.
dist_bottom_valid
?
lpos
.
dist_bottom
:
-
1.0
f
;
capture
.
ground_distance
=
g
pos
.
terrain_alt_valid
?
(
gpos
.
alt
-
gpos
.
terrain_alt
)
:
-
1.0
f
;
// Fill attitude data
// TODO : this needs to be rotated by camera orientation or set to gimbal orientation when available
...
...
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