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
f11465bb
Commit
f11465bb
authored
6 years ago
by
Alessandro Simovic
Committed by
Matthias Grob
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
orbit: publish uorb message
parent
10913a66
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lib/FlightTasks/tasks/Orbit/FlightTaskOrbit.cpp
+19
-0
19 additions, 0 deletions
src/lib/FlightTasks/tasks/Orbit/FlightTaskOrbit.cpp
src/lib/FlightTasks/tasks/Orbit/FlightTaskOrbit.hpp
+6
-1
6 additions, 1 deletion
src/lib/FlightTasks/tasks/Orbit/FlightTaskOrbit.hpp
with
25 additions
and
1 deletion
src/lib/FlightTasks/tasks/Orbit/FlightTaskOrbit.cpp
+
19
−
0
View file @
f11465bb
...
...
@@ -46,6 +46,11 @@ FlightTaskOrbit::FlightTaskOrbit()
_sticks_data_required
=
false
;
}
FlightTaskOrbit
::~
FlightTaskOrbit
()
{
orb_unadvertise
(
_orbit_status_pub
);
}
bool
FlightTaskOrbit
::
applyCommandParameters
(
const
vehicle_command_s
&
command
)
{
bool
ret
=
true
;
...
...
@@ -165,5 +170,19 @@ bool FlightTaskOrbit::update()
// yawspeed feed-forward because we know the necessary angular rate
_yawspeed_setpoint
=
_v
/
_r
;
// publish telemetry
_orbit_status
.
radius
=
_r
;
_orbit_status
.
frame
=
6
;
// MAV_FRAME_GLOBAL_RELATIVE_ALT_INT
_orbit_status
.
x
=
_center
(
0
);
_orbit_status
.
y
=
_center
(
1
);
_orbit_status
.
z
=
_center
(
2
);
if
(
_orbit_status_pub
==
nullptr
)
{
_orbit_status_pub
=
orb_advertise
(
ORB_ID
(
orbit_status
),
&
_orbit_status
);
}
else
{
orb_publish
(
ORB_ID
(
orbit_status
),
_orbit_status_pub
,
&
_orbit_status
);
}
return
true
;
}
This diff is collapsed.
Click to expand it.
src/lib/FlightTasks/tasks/Orbit/FlightTaskOrbit.hpp
+
6
−
1
View file @
f11465bb
...
...
@@ -42,12 +42,14 @@
#pragma once
#include
"FlightTaskManualAltitudeSmooth.hpp"
#include
<uORB/uORB.h>
#include
<uORB/topics/orbit_status.h>
class
FlightTaskOrbit
:
public
FlightTaskManualAltitudeSmooth
{
public:
FlightTaskOrbit
();
virtual
~
FlightTaskOrbit
()
=
default
;
virtual
~
FlightTaskOrbit
();
bool
applyCommandParameters
(
const
vehicle_command_s
&
command
)
override
;
bool
activate
()
override
;
...
...
@@ -89,4 +91,7 @@ private:
const
float
_radius_max
=
100.
f
;
const
float
_velocity_max
=
10.
f
;
const
float
_acceleration_max
=
2.
f
;
orb_advert_t
_orbit_status_pub
=
nullptr
;
orbit_status_s
_orbit_status
=
{};
};
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