Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SITL: unify all init scripts #10222

Merged
merged 19 commits into from
Aug 14, 2018
Merged

SITL: unify all init scripts #10222

merged 19 commits into from
Aug 14, 2018

Conversation

bkueng
Copy link
Member

@bkueng bkueng commented Aug 13, 2018

This combines all SITL startup scripts into a common rcS file with separate autostart files for each model using the same structure as we have on NuttX. The rc.vehicle_setup from NuttX is now also used in SITL, which starts all vehicle type-specific apps and loads the mixer. So a considerable portion of the scripts is now shared.

Bash does not allow empty 'if then else' clauses, so I added 'if ! ' support for NuttX and changed all existing occurrences.

I tested all the models with gazebo (rover doesn't seem to work, but it does not on master either).
Mutli-vehicle simulation works now generically.

This depends on PX4/NuttX-apps#2.

It's probably best to review commit by commit.

Note that LPE needs to be selected with export PX4_ESTIMATOR=lpe now.

@hamishwillee docs will follow.

Script testing

I found ShellCheck, a static analyzer for (bash) scripts. I added a script to run it, and we should add it to CI via:

./Tools/run-shellcheck.sh ROMFS/px4fmu_common/

It will test the NuttX scripts as well.

@mhkabir
Copy link
Member

mhkabir commented Aug 13, 2018

Tangential comment, but the POSIX shell stuff seems to have broken mixer loading on external SITL setups (e.g when launching PX4 via roslaunch).

@dagar
Copy link
Member

dagar commented Aug 13, 2018

Great! ShellCheck was already on my list for CI. It's small enough we can add it to px4io/px4-dev-base. https://github.com/PX4/containers/blob/master/docker/px4-dev/Dockerfile_base

Killing off the other fake posix_sitl builds (posix_sitl_{ekf2, lpe, inav, etc}) would also be nice.

@@ -0,0 +1,30 @@
#!nsh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use #!sh everywhere.
I don't know why we don't currently have a /bin/ in NuttX.

@dagar
Copy link
Member

dagar commented Aug 13, 2018

@mhkabir let's get something simple with roslaunch in the CI system. Likewise for building PX4 in a catkin workspace. This has to be the minimum bar for support.

@bkueng
Copy link
Member Author

bkueng commented Aug 13, 2018

Killing off the other fake posix_sitl builds (posix_sitl_{ekf2, lpe, inav, etc}) would also be nice.

Yes I have that on the list for one of the next iterations.

@bkueng bkueng changed the title [WIP] SITL: unify all init scripts SITL: unify all init scripts Aug 13, 2018
@bkueng
Copy link
Member Author

bkueng commented Aug 13, 2018

I updated the NuttX submodule, should be good to go/review.

The command is now: 'make posix none_shell'
which means: don't start a simulator and run a minimal shell only.
RC input is now handled via rc_input module
This also removes the HIGHRES_IMU mavlink stream to the GCS. I don't see
why it's needed and it adds noticeable CPU load.
This info is on the dev-guide now
Use './Tools/run-shellcheck.sh ROMFS/px4fmu_common' to run it.
@dagar
Copy link
Member

dagar commented Aug 14, 2018

Rebased on master to fit into px4fmu-v2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants