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
d4c7dbc9
Commit
d4c7dbc9
authored
6 years ago
by
Beat Küng
Committed by
Daniel Agar
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
posix rcS: automatically find matching autostart file based on SYS_AUTOSTART
parent
6971a928
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
ROMFS/px4fmu_common/init.d-posix/rcS
+26
-19
26 additions, 19 deletions
ROMFS/px4fmu_common/init.d-posix/rcS
with
26 additions
and
19 deletions
ROMFS/px4fmu_common/init.d-posix/rcS
+
26
−
19
View file @
d4c7dbc9
...
...
@@ -37,6 +37,16 @@ fi
# exit early when the minimal shell is requested
[
$RUN_MINIMAL_SHELL
==
yes
]
&&
exit
0
# Use environment variable PX4_ESTIMATOR to choose estimator.
if
[
"
$PX4_ESTIMATOR
"
==
"ekf2"
]
;
then
param
set
SYS_MC_EST_GROUP 2
elif
[
"
$PX4_ESTIMATOR
"
==
"lpe"
]
;
then
param
set
SYS_MC_EST_GROUP 1
elif
[
"
$PX4_ESTIMATOR
"
==
"inav"
]
;
then
param
set
SYS_MC_EST_GROUP 0
fi
if
param compare SYS_AUTOSTART
$REQUESTED_AUTOSTART
then
set
AUTOCNF no
...
...
@@ -92,14 +102,19 @@ then
param
set
SYS_RESTART_TYPE 2
fi
# Use environment variable PX4_ESTIMATOR to choose estimator.
if
[
"
$PX4_ESTIMATOR
"
==
"ekf2"
]
;
then
param
set
SYS_MC_EST_GROUP 2
elif
[
"
$PX4_ESTIMATOR
"
==
"lpe"
]
;
then
param
set
SYS_MC_EST_GROUP 1
# Autostart ID
autostart_file_match
=
"etc/init.d-posix/
$(
param show
-q
SYS_AUTOSTART
)
_*"
autostart_files
=(
$autostart_file_match
)
autostart_file
=
"
${
autostart_files
[0]
}
"
# use first match, but there should really only be one
if
[
!
-e
"
$autostart_file
"
]
;
then
echo
"Error: no autostart file found"
exit
-1
fi
sh
"
$autostart_file
"
dataman start
replay tryapplyparams
simulator start
-s
...
...
@@ -113,7 +128,11 @@ commander start
land_detector start multicopter
navigator start
if
param compare SYS_MC_EST_GROUP 1
if
param compare SYS_MC_EST_GROUP 0
then
attitude_estimator_q start
position_estimator_inav start
elif
param compare SYS_MC_EST_GROUP 1
then
attitude_estimator_q start
local_position_estimator start
...
...
@@ -128,18 +147,6 @@ fi
mc_pos_control start
mc_att_control start
# TODO: eventually we want to re-use the existing autostart
# infrastructure already available on NuttX.
if
param compare SYS_AUTOSTART 10016
then
sh etc/init.d-posix/10016_iris
elif
param compare SYS_AUTOSTART 6011
then
sh etc/init.d-posix/6011_typhoon_h480
fi
mavlink start
-x
-u
14556
-r
4000000
mavlink start
-x
-u
14557
-r
4000000
-m
onboard
-o
14540
mavlink stream
-r
50
-s
POSITION_TARGET_LOCAL_NED
-u
14556
...
...
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