2017-06-01 09:47:33 -03:00
|
|
|
|
2015-09-08 21:50:18 -03:00
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
2018-04-11 16:10:51 -03:00
|
|
|
get_property(module_libraries GLOBAL PROPERTY PX4_MODULE_LIBRARIES)
|
2017-08-29 18:22:05 -03:00
|
|
|
|
2022-12-09 00:03:44 -04:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
|
2018-12-12 14:30:07 -04:00
|
|
|
|
2018-09-27 06:25:23 -03:00
|
|
|
set(PX4_SHELL_COMMAND_PREFIX "px4-")
|
add posix shell
squashed & rebased version, not including:
- listener changes
- src/firmware renaming
Commits:
tag_to_version.py: fix Python3 error
subprocess.communicate returns bytes instead of a str which is not the
same for Python3. Therefore, we need to decode the bytes.
cmake: remove folder src/firmware
The folder src/firmware was not intuitive. Why would the binaries for
SITL be inside a src and why even inside a src/firmware folder. Also,
the rootfs was put there which made it even more confusing.
The CMakeLists.txt files are moved into cmake/ and get now called from
the main CMakeLists.txt.
qshell: support for return value
Instead of just sending commands, qshell will now also wait until
the command has finished on QURT and sent back a return value. This will
allow all modules on the DSP side to be spawned from the Linux side
meaning that we only need one config/startup file instead of two.
adb_upload: create folders before pushing
Previously the script failed if the folder on the destination was not
already existing. This therefore makes pushing easier.
posix: spawn PX4 modules in bash
This adds the possibility to spawn PX4 modules out of bash. Basically,
the main executable can now be started as a server/daemon or as a
client.
The server replaces the existing functionality of the main exe with
the pxh shell, however, it also opens a pipe that clients can talk to.
Clients can run or spawn PX4 modules or commands by connecting to the
server over the pipe. They clients will get the stdout and return value
of their commands via a client specific pipe back.
This work will allow to start all modules using a bash script similar to
the way it is done in NuttX where the NuttShell scripts the startup
scripts and starts the modules.
SITL: use new client shell in SITL
This is a first step to use the new shell capabilities for SITL.
The new startup bash script rcS merges (and therefore replaces) the two
existing scripts rcS_gazebo_iris and rcS_jmavsim_iris.
More cleanup will be necessary for the rest of the SITL startup scripts.
Snapdragon: use new shell to start all modules
Instead of different mainapp.config and px4.config files, we can now use
a unified rcS bash script which starts all the modules based on
parameters, mainly the SYS_AUTOSTART param.
Snapdragon: fix the airframe description
pxh: argv needs to end with a nullptr
The comment was wrong that argv needs an additional 0 termination.
Instead it needs a nullptr at the end.
px4_posix_tasks: variable cleanup
The px4_task_spawn_cmd function got a cleanup while debugging, however,
no functional changes.
Snapdragon: move some drivers to 4100 config
These drivers are supported by the community, so they go into the 4100
config.
Snapdragon: update 210qc platform
px4_daemon: use doxygen comments
apps.h_in: fix string printf: use .c_str()
px4_daemon: \b -> \n in printf
px4_daemon: handle error in generate_uuid (close the file on error)
posix main: some clarifications in comment (it's the symlinks not the script aliases)
cmake: remove new install command again
This one was probably wrong and untested. Installing needs revisiting.
POSIX: remove argument USES_TERMINAL
POSIX: copy init and mixer files for SITL
Instead of using non-working install commands, the mixer and startup
files are now copied as part of the build in cmake.
adb_upload.sh: remove leftover commented printf
POSIX main: just the pointer instead of memmove
POSIX main: remove chroot
chroot is removed because it hasn't been used anywhere and seems
untested.
px4_daemon: remove client pipe when cleaning up
px4_daemon: fail if the client pipe already exists
The client pipe is supposed to be specific (by UUID), so the path
shouldn't exist already.
history: limit the number of history entries
This is a protection to avoid filling the memory if we are entering a
lot of commands (e.g. auto-generated).
px4_daemon: add a threadsafe map and use it
px4_daemon: whitespace
px4_daemon: fix client parsing
Sometimes the client ends up reading more than one packet in one read.
The parsing is not made for this and would require a (ring)buffer for
it.
The solution of this commit just reads as much as needed from the pipe
which avoids having to do buffering and parsing.
posix: changes sitl_run.sh and main.cpp cleanup
This changes the paths in sitl_run.sh quite a bit to allow the px4
binary to run in the rootfs directory which should make it convenient
and very close to the NuttX variant.
Also main.cpp got a big cleanup after the big rebase with some
conflicts. Quite some functionality was removed but it has yet to be
seen if it needs to be re-added.
px4_log: cleanup log levels, now they make sense
Before DEBUG and INFO log levels where inverted which didn't make much
sense in my eyes.
dataman: fix path for bash shell
logger: fix paths for bash shell
mavlink: fix paths for bash shell
param: fix path for bash shell
inav: fix paths for bash shell
sdlog2: fix paths for bash shell
ROMFS: add forgotten mixer to list
SITL init: more models, more options
- Support for different models using the unified startup
script rcS.
- Support to choose the estimator by setting the environment variable
PX4_ESTIMATOR.
- Support to choose the logger by setting the environment variable
PX4_LOGGER.
rcS: fix string comparison
listener: use template file
Instead of having all of the C++ code inside the Python file it is
nicer to have a separate template file with the C++ headers, etc.
px4_log: add PX4_INFO_RAW for raw printfs
This allows to do custom formatting but is still transported over
sockets to clients.
topic_listener: use PX4_INFO_RAW instead of printf
commander: use PX4_INFO_RAW for status
listener: rewrite to classes and factory
posix: fix some argument warnings
generate_listener.py: by accident changed shebang
listener: big refactor of the generator
Hopefully this makes it easier to read and change in the future.
rcS: manually take over rebase changes
listener: remove leftover try
listener: properly clean up topic instance
rcS: take over some vehicle specific changes
posix-configs: vehicle specifics to separate files
posix-configs: remove leftover lines
uORBDevices: new PX4_INFO_RAW instead of printf
px4_log: just use printf on NuttX
listener: use less binary space, strip on NuttX
generate_listener.py: remove commented code
cmake: fix syntax error from merge
px4_daemon: fixes after rebase of apps.h/cpp fix
px4_daemon: namespace missing
posix: only create stub for fsync on QURT
unitests: reduce dependencies of param test
This makes the unit test compile and link again after the bash changes.
QURT: some compile fixes after a rebase
SITL: arg change for sitl_run.sh to use rcS_test
This allows to use a custom startup file for testing.
SITL: add the folder test_data
SITL: implement shutdown command as systemcmd
The shutdown command needs to be a proper systemcmd, otherwise the alias
and symlink generation doesn't work and we end up calling shutdown of
the host computer which is to be avoided.
px4fmu_test: same IO_pass mixer as px4fmu_default
px4fmu_test: use normal quad x mixer
There is no good reason to use a specific test mixer, except more cmake
code around it. Therefore just use the same mixer as default, and at
some point px4fmu_test and px4fmu_default can get merged
POSIX: cleanup, dir and symlink fixes
This cleans up the logic behind the symlinking and creating directories.
POSIX: correct arg order in usage info
tests: fix paths for SITL tests
POSIX: printf fix
sitl_run.sh: try to make this run on Mac as well
cmake: try to make jenkins happier
Path cleanup, the bin is no longer in src/firmware
POSIX: fix symlink logic
SITL: prefix all exported env variables
cmake: fix path for ROS tests
integrationtests: fix log path
launch: try to make tets with ROS working again
px4_defines: fix after wrong merge deconflicting
px4_defines: get paths for POSIX correct
cmake: fix cmake arguments
This was fine with cmake 3.6 but did not work with cmake 3.2.2
cmake: use cp instead of cmake -E copy
cmake -E copy does not support copying multiple files with versions <
3.5. Therefore, just use cp for now.
ROMFS: fix build error after rebase
cmake: fix paths in configs
launch: use `spawn_model` again
cmake: various fixes after big rebase
param: path fixes after rebase
posix platform: fixes after rebase
test_mixer: fix screwed up rebase
2018-08-02 16:32:51 -03:00
|
|
|
|
2018-09-27 06:25:23 -03:00
|
|
|
add_definitions("-DPX4_SHELL_COMMAND_PREFIX=\"${PX4_SHELL_COMMAND_PREFIX}\"")
|
add posix shell
squashed & rebased version, not including:
- listener changes
- src/firmware renaming
Commits:
tag_to_version.py: fix Python3 error
subprocess.communicate returns bytes instead of a str which is not the
same for Python3. Therefore, we need to decode the bytes.
cmake: remove folder src/firmware
The folder src/firmware was not intuitive. Why would the binaries for
SITL be inside a src and why even inside a src/firmware folder. Also,
the rootfs was put there which made it even more confusing.
The CMakeLists.txt files are moved into cmake/ and get now called from
the main CMakeLists.txt.
qshell: support for return value
Instead of just sending commands, qshell will now also wait until
the command has finished on QURT and sent back a return value. This will
allow all modules on the DSP side to be spawned from the Linux side
meaning that we only need one config/startup file instead of two.
adb_upload: create folders before pushing
Previously the script failed if the folder on the destination was not
already existing. This therefore makes pushing easier.
posix: spawn PX4 modules in bash
This adds the possibility to spawn PX4 modules out of bash. Basically,
the main executable can now be started as a server/daemon or as a
client.
The server replaces the existing functionality of the main exe with
the pxh shell, however, it also opens a pipe that clients can talk to.
Clients can run or spawn PX4 modules or commands by connecting to the
server over the pipe. They clients will get the stdout and return value
of their commands via a client specific pipe back.
This work will allow to start all modules using a bash script similar to
the way it is done in NuttX where the NuttShell scripts the startup
scripts and starts the modules.
SITL: use new client shell in SITL
This is a first step to use the new shell capabilities for SITL.
The new startup bash script rcS merges (and therefore replaces) the two
existing scripts rcS_gazebo_iris and rcS_jmavsim_iris.
More cleanup will be necessary for the rest of the SITL startup scripts.
Snapdragon: use new shell to start all modules
Instead of different mainapp.config and px4.config files, we can now use
a unified rcS bash script which starts all the modules based on
parameters, mainly the SYS_AUTOSTART param.
Snapdragon: fix the airframe description
pxh: argv needs to end with a nullptr
The comment was wrong that argv needs an additional 0 termination.
Instead it needs a nullptr at the end.
px4_posix_tasks: variable cleanup
The px4_task_spawn_cmd function got a cleanup while debugging, however,
no functional changes.
Snapdragon: move some drivers to 4100 config
These drivers are supported by the community, so they go into the 4100
config.
Snapdragon: update 210qc platform
px4_daemon: use doxygen comments
apps.h_in: fix string printf: use .c_str()
px4_daemon: \b -> \n in printf
px4_daemon: handle error in generate_uuid (close the file on error)
posix main: some clarifications in comment (it's the symlinks not the script aliases)
cmake: remove new install command again
This one was probably wrong and untested. Installing needs revisiting.
POSIX: remove argument USES_TERMINAL
POSIX: copy init and mixer files for SITL
Instead of using non-working install commands, the mixer and startup
files are now copied as part of the build in cmake.
adb_upload.sh: remove leftover commented printf
POSIX main: just the pointer instead of memmove
POSIX main: remove chroot
chroot is removed because it hasn't been used anywhere and seems
untested.
px4_daemon: remove client pipe when cleaning up
px4_daemon: fail if the client pipe already exists
The client pipe is supposed to be specific (by UUID), so the path
shouldn't exist already.
history: limit the number of history entries
This is a protection to avoid filling the memory if we are entering a
lot of commands (e.g. auto-generated).
px4_daemon: add a threadsafe map and use it
px4_daemon: whitespace
px4_daemon: fix client parsing
Sometimes the client ends up reading more than one packet in one read.
The parsing is not made for this and would require a (ring)buffer for
it.
The solution of this commit just reads as much as needed from the pipe
which avoids having to do buffering and parsing.
posix: changes sitl_run.sh and main.cpp cleanup
This changes the paths in sitl_run.sh quite a bit to allow the px4
binary to run in the rootfs directory which should make it convenient
and very close to the NuttX variant.
Also main.cpp got a big cleanup after the big rebase with some
conflicts. Quite some functionality was removed but it has yet to be
seen if it needs to be re-added.
px4_log: cleanup log levels, now they make sense
Before DEBUG and INFO log levels where inverted which didn't make much
sense in my eyes.
dataman: fix path for bash shell
logger: fix paths for bash shell
mavlink: fix paths for bash shell
param: fix path for bash shell
inav: fix paths for bash shell
sdlog2: fix paths for bash shell
ROMFS: add forgotten mixer to list
SITL init: more models, more options
- Support for different models using the unified startup
script rcS.
- Support to choose the estimator by setting the environment variable
PX4_ESTIMATOR.
- Support to choose the logger by setting the environment variable
PX4_LOGGER.
rcS: fix string comparison
listener: use template file
Instead of having all of the C++ code inside the Python file it is
nicer to have a separate template file with the C++ headers, etc.
px4_log: add PX4_INFO_RAW for raw printfs
This allows to do custom formatting but is still transported over
sockets to clients.
topic_listener: use PX4_INFO_RAW instead of printf
commander: use PX4_INFO_RAW for status
listener: rewrite to classes and factory
posix: fix some argument warnings
generate_listener.py: by accident changed shebang
listener: big refactor of the generator
Hopefully this makes it easier to read and change in the future.
rcS: manually take over rebase changes
listener: remove leftover try
listener: properly clean up topic instance
rcS: take over some vehicle specific changes
posix-configs: vehicle specifics to separate files
posix-configs: remove leftover lines
uORBDevices: new PX4_INFO_RAW instead of printf
px4_log: just use printf on NuttX
listener: use less binary space, strip on NuttX
generate_listener.py: remove commented code
cmake: fix syntax error from merge
px4_daemon: fixes after rebase of apps.h/cpp fix
px4_daemon: namespace missing
posix: only create stub for fsync on QURT
unitests: reduce dependencies of param test
This makes the unit test compile and link again after the bash changes.
QURT: some compile fixes after a rebase
SITL: arg change for sitl_run.sh to use rcS_test
This allows to use a custom startup file for testing.
SITL: add the folder test_data
SITL: implement shutdown command as systemcmd
The shutdown command needs to be a proper systemcmd, otherwise the alias
and symlink generation doesn't work and we end up calling shutdown of
the host computer which is to be avoided.
px4fmu_test: same IO_pass mixer as px4fmu_default
px4fmu_test: use normal quad x mixer
There is no good reason to use a specific test mixer, except more cmake
code around it. Therefore just use the same mixer as default, and at
some point px4fmu_test and px4fmu_default can get merged
POSIX: cleanup, dir and symlink fixes
This cleans up the logic behind the symlinking and creating directories.
POSIX: correct arg order in usage info
tests: fix paths for SITL tests
POSIX: printf fix
sitl_run.sh: try to make this run on Mac as well
cmake: try to make jenkins happier
Path cleanup, the bin is no longer in src/firmware
POSIX: fix symlink logic
SITL: prefix all exported env variables
cmake: fix path for ROS tests
integrationtests: fix log path
launch: try to make tets with ROS working again
px4_defines: fix after wrong merge deconflicting
px4_defines: get paths for POSIX correct
cmake: fix cmake arguments
This was fine with cmake 3.6 but did not work with cmake 3.2.2
cmake: use cp instead of cmake -E copy
cmake -E copy does not support copying multiple files with versions <
3.5. Therefore, just use cp for now.
ROMFS: fix build error after rebase
cmake: fix paths in configs
launch: use `spawn_model` again
cmake: various fixes after big rebase
param: path fixes after rebase
posix platform: fixes after rebase
test_mixer: fix screwed up rebase
2018-08-02 16:32:51 -03:00
|
|
|
|
2015-09-08 19:39:13 -03:00
|
|
|
px4_posix_generate_builtin_commands(
|
2016-10-21 10:54:48 -03:00
|
|
|
OUT apps
|
2015-09-10 00:00:58 -03:00
|
|
|
MODULE_LIST ${module_libraries})
|
2015-09-08 19:39:13 -03:00
|
|
|
|
add posix shell
squashed & rebased version, not including:
- listener changes
- src/firmware renaming
Commits:
tag_to_version.py: fix Python3 error
subprocess.communicate returns bytes instead of a str which is not the
same for Python3. Therefore, we need to decode the bytes.
cmake: remove folder src/firmware
The folder src/firmware was not intuitive. Why would the binaries for
SITL be inside a src and why even inside a src/firmware folder. Also,
the rootfs was put there which made it even more confusing.
The CMakeLists.txt files are moved into cmake/ and get now called from
the main CMakeLists.txt.
qshell: support for return value
Instead of just sending commands, qshell will now also wait until
the command has finished on QURT and sent back a return value. This will
allow all modules on the DSP side to be spawned from the Linux side
meaning that we only need one config/startup file instead of two.
adb_upload: create folders before pushing
Previously the script failed if the folder on the destination was not
already existing. This therefore makes pushing easier.
posix: spawn PX4 modules in bash
This adds the possibility to spawn PX4 modules out of bash. Basically,
the main executable can now be started as a server/daemon or as a
client.
The server replaces the existing functionality of the main exe with
the pxh shell, however, it also opens a pipe that clients can talk to.
Clients can run or spawn PX4 modules or commands by connecting to the
server over the pipe. They clients will get the stdout and return value
of their commands via a client specific pipe back.
This work will allow to start all modules using a bash script similar to
the way it is done in NuttX where the NuttShell scripts the startup
scripts and starts the modules.
SITL: use new client shell in SITL
This is a first step to use the new shell capabilities for SITL.
The new startup bash script rcS merges (and therefore replaces) the two
existing scripts rcS_gazebo_iris and rcS_jmavsim_iris.
More cleanup will be necessary for the rest of the SITL startup scripts.
Snapdragon: use new shell to start all modules
Instead of different mainapp.config and px4.config files, we can now use
a unified rcS bash script which starts all the modules based on
parameters, mainly the SYS_AUTOSTART param.
Snapdragon: fix the airframe description
pxh: argv needs to end with a nullptr
The comment was wrong that argv needs an additional 0 termination.
Instead it needs a nullptr at the end.
px4_posix_tasks: variable cleanup
The px4_task_spawn_cmd function got a cleanup while debugging, however,
no functional changes.
Snapdragon: move some drivers to 4100 config
These drivers are supported by the community, so they go into the 4100
config.
Snapdragon: update 210qc platform
px4_daemon: use doxygen comments
apps.h_in: fix string printf: use .c_str()
px4_daemon: \b -> \n in printf
px4_daemon: handle error in generate_uuid (close the file on error)
posix main: some clarifications in comment (it's the symlinks not the script aliases)
cmake: remove new install command again
This one was probably wrong and untested. Installing needs revisiting.
POSIX: remove argument USES_TERMINAL
POSIX: copy init and mixer files for SITL
Instead of using non-working install commands, the mixer and startup
files are now copied as part of the build in cmake.
adb_upload.sh: remove leftover commented printf
POSIX main: just the pointer instead of memmove
POSIX main: remove chroot
chroot is removed because it hasn't been used anywhere and seems
untested.
px4_daemon: remove client pipe when cleaning up
px4_daemon: fail if the client pipe already exists
The client pipe is supposed to be specific (by UUID), so the path
shouldn't exist already.
history: limit the number of history entries
This is a protection to avoid filling the memory if we are entering a
lot of commands (e.g. auto-generated).
px4_daemon: add a threadsafe map and use it
px4_daemon: whitespace
px4_daemon: fix client parsing
Sometimes the client ends up reading more than one packet in one read.
The parsing is not made for this and would require a (ring)buffer for
it.
The solution of this commit just reads as much as needed from the pipe
which avoids having to do buffering and parsing.
posix: changes sitl_run.sh and main.cpp cleanup
This changes the paths in sitl_run.sh quite a bit to allow the px4
binary to run in the rootfs directory which should make it convenient
and very close to the NuttX variant.
Also main.cpp got a big cleanup after the big rebase with some
conflicts. Quite some functionality was removed but it has yet to be
seen if it needs to be re-added.
px4_log: cleanup log levels, now they make sense
Before DEBUG and INFO log levels where inverted which didn't make much
sense in my eyes.
dataman: fix path for bash shell
logger: fix paths for bash shell
mavlink: fix paths for bash shell
param: fix path for bash shell
inav: fix paths for bash shell
sdlog2: fix paths for bash shell
ROMFS: add forgotten mixer to list
SITL init: more models, more options
- Support for different models using the unified startup
script rcS.
- Support to choose the estimator by setting the environment variable
PX4_ESTIMATOR.
- Support to choose the logger by setting the environment variable
PX4_LOGGER.
rcS: fix string comparison
listener: use template file
Instead of having all of the C++ code inside the Python file it is
nicer to have a separate template file with the C++ headers, etc.
px4_log: add PX4_INFO_RAW for raw printfs
This allows to do custom formatting but is still transported over
sockets to clients.
topic_listener: use PX4_INFO_RAW instead of printf
commander: use PX4_INFO_RAW for status
listener: rewrite to classes and factory
posix: fix some argument warnings
generate_listener.py: by accident changed shebang
listener: big refactor of the generator
Hopefully this makes it easier to read and change in the future.
rcS: manually take over rebase changes
listener: remove leftover try
listener: properly clean up topic instance
rcS: take over some vehicle specific changes
posix-configs: vehicle specifics to separate files
posix-configs: remove leftover lines
uORBDevices: new PX4_INFO_RAW instead of printf
px4_log: just use printf on NuttX
listener: use less binary space, strip on NuttX
generate_listener.py: remove commented code
cmake: fix syntax error from merge
px4_daemon: fixes after rebase of apps.h/cpp fix
px4_daemon: namespace missing
posix: only create stub for fsync on QURT
unitests: reduce dependencies of param test
This makes the unit test compile and link again after the bash changes.
QURT: some compile fixes after a rebase
SITL: arg change for sitl_run.sh to use rcS_test
This allows to use a custom startup file for testing.
SITL: add the folder test_data
SITL: implement shutdown command as systemcmd
The shutdown command needs to be a proper systemcmd, otherwise the alias
and symlink generation doesn't work and we end up calling shutdown of
the host computer which is to be avoided.
px4fmu_test: same IO_pass mixer as px4fmu_default
px4fmu_test: use normal quad x mixer
There is no good reason to use a specific test mixer, except more cmake
code around it. Therefore just use the same mixer as default, and at
some point px4fmu_test and px4fmu_default can get merged
POSIX: cleanup, dir and symlink fixes
This cleans up the logic behind the symlinking and creating directories.
POSIX: correct arg order in usage info
tests: fix paths for SITL tests
POSIX: printf fix
sitl_run.sh: try to make this run on Mac as well
cmake: try to make jenkins happier
Path cleanup, the bin is no longer in src/firmware
POSIX: fix symlink logic
SITL: prefix all exported env variables
cmake: fix path for ROS tests
integrationtests: fix log path
launch: try to make tets with ROS working again
px4_defines: fix after wrong merge deconflicting
px4_defines: get paths for POSIX correct
cmake: fix cmake arguments
This was fine with cmake 3.6 but did not work with cmake 3.2.2
cmake: use cp instead of cmake -E copy
cmake -E copy does not support copying multiple files with versions <
3.5. Therefore, just use cp for now.
ROMFS: fix build error after rebase
cmake: fix paths in configs
launch: use `spawn_model` again
cmake: various fixes after big rebase
param: path fixes after rebase
posix platform: fixes after rebase
test_mixer: fix screwed up rebase
2018-08-02 16:32:51 -03:00
|
|
|
px4_posix_generate_alias(
|
|
|
|
OUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/px4-alias.sh
|
|
|
|
MODULE_LIST ${module_libraries}
|
2018-09-27 06:25:23 -03:00
|
|
|
PREFIX ${PX4_SHELL_COMMAND_PREFIX}
|
add posix shell
squashed & rebased version, not including:
- listener changes
- src/firmware renaming
Commits:
tag_to_version.py: fix Python3 error
subprocess.communicate returns bytes instead of a str which is not the
same for Python3. Therefore, we need to decode the bytes.
cmake: remove folder src/firmware
The folder src/firmware was not intuitive. Why would the binaries for
SITL be inside a src and why even inside a src/firmware folder. Also,
the rootfs was put there which made it even more confusing.
The CMakeLists.txt files are moved into cmake/ and get now called from
the main CMakeLists.txt.
qshell: support for return value
Instead of just sending commands, qshell will now also wait until
the command has finished on QURT and sent back a return value. This will
allow all modules on the DSP side to be spawned from the Linux side
meaning that we only need one config/startup file instead of two.
adb_upload: create folders before pushing
Previously the script failed if the folder on the destination was not
already existing. This therefore makes pushing easier.
posix: spawn PX4 modules in bash
This adds the possibility to spawn PX4 modules out of bash. Basically,
the main executable can now be started as a server/daemon or as a
client.
The server replaces the existing functionality of the main exe with
the pxh shell, however, it also opens a pipe that clients can talk to.
Clients can run or spawn PX4 modules or commands by connecting to the
server over the pipe. They clients will get the stdout and return value
of their commands via a client specific pipe back.
This work will allow to start all modules using a bash script similar to
the way it is done in NuttX where the NuttShell scripts the startup
scripts and starts the modules.
SITL: use new client shell in SITL
This is a first step to use the new shell capabilities for SITL.
The new startup bash script rcS merges (and therefore replaces) the two
existing scripts rcS_gazebo_iris and rcS_jmavsim_iris.
More cleanup will be necessary for the rest of the SITL startup scripts.
Snapdragon: use new shell to start all modules
Instead of different mainapp.config and px4.config files, we can now use
a unified rcS bash script which starts all the modules based on
parameters, mainly the SYS_AUTOSTART param.
Snapdragon: fix the airframe description
pxh: argv needs to end with a nullptr
The comment was wrong that argv needs an additional 0 termination.
Instead it needs a nullptr at the end.
px4_posix_tasks: variable cleanup
The px4_task_spawn_cmd function got a cleanup while debugging, however,
no functional changes.
Snapdragon: move some drivers to 4100 config
These drivers are supported by the community, so they go into the 4100
config.
Snapdragon: update 210qc platform
px4_daemon: use doxygen comments
apps.h_in: fix string printf: use .c_str()
px4_daemon: \b -> \n in printf
px4_daemon: handle error in generate_uuid (close the file on error)
posix main: some clarifications in comment (it's the symlinks not the script aliases)
cmake: remove new install command again
This one was probably wrong and untested. Installing needs revisiting.
POSIX: remove argument USES_TERMINAL
POSIX: copy init and mixer files for SITL
Instead of using non-working install commands, the mixer and startup
files are now copied as part of the build in cmake.
adb_upload.sh: remove leftover commented printf
POSIX main: just the pointer instead of memmove
POSIX main: remove chroot
chroot is removed because it hasn't been used anywhere and seems
untested.
px4_daemon: remove client pipe when cleaning up
px4_daemon: fail if the client pipe already exists
The client pipe is supposed to be specific (by UUID), so the path
shouldn't exist already.
history: limit the number of history entries
This is a protection to avoid filling the memory if we are entering a
lot of commands (e.g. auto-generated).
px4_daemon: add a threadsafe map and use it
px4_daemon: whitespace
px4_daemon: fix client parsing
Sometimes the client ends up reading more than one packet in one read.
The parsing is not made for this and would require a (ring)buffer for
it.
The solution of this commit just reads as much as needed from the pipe
which avoids having to do buffering and parsing.
posix: changes sitl_run.sh and main.cpp cleanup
This changes the paths in sitl_run.sh quite a bit to allow the px4
binary to run in the rootfs directory which should make it convenient
and very close to the NuttX variant.
Also main.cpp got a big cleanup after the big rebase with some
conflicts. Quite some functionality was removed but it has yet to be
seen if it needs to be re-added.
px4_log: cleanup log levels, now they make sense
Before DEBUG and INFO log levels where inverted which didn't make much
sense in my eyes.
dataman: fix path for bash shell
logger: fix paths for bash shell
mavlink: fix paths for bash shell
param: fix path for bash shell
inav: fix paths for bash shell
sdlog2: fix paths for bash shell
ROMFS: add forgotten mixer to list
SITL init: more models, more options
- Support for different models using the unified startup
script rcS.
- Support to choose the estimator by setting the environment variable
PX4_ESTIMATOR.
- Support to choose the logger by setting the environment variable
PX4_LOGGER.
rcS: fix string comparison
listener: use template file
Instead of having all of the C++ code inside the Python file it is
nicer to have a separate template file with the C++ headers, etc.
px4_log: add PX4_INFO_RAW for raw printfs
This allows to do custom formatting but is still transported over
sockets to clients.
topic_listener: use PX4_INFO_RAW instead of printf
commander: use PX4_INFO_RAW for status
listener: rewrite to classes and factory
posix: fix some argument warnings
generate_listener.py: by accident changed shebang
listener: big refactor of the generator
Hopefully this makes it easier to read and change in the future.
rcS: manually take over rebase changes
listener: remove leftover try
listener: properly clean up topic instance
rcS: take over some vehicle specific changes
posix-configs: vehicle specifics to separate files
posix-configs: remove leftover lines
uORBDevices: new PX4_INFO_RAW instead of printf
px4_log: just use printf on NuttX
listener: use less binary space, strip on NuttX
generate_listener.py: remove commented code
cmake: fix syntax error from merge
px4_daemon: fixes after rebase of apps.h/cpp fix
px4_daemon: namespace missing
posix: only create stub for fsync on QURT
unitests: reduce dependencies of param test
This makes the unit test compile and link again after the bash changes.
QURT: some compile fixes after a rebase
SITL: arg change for sitl_run.sh to use rcS_test
This allows to use a custom startup file for testing.
SITL: add the folder test_data
SITL: implement shutdown command as systemcmd
The shutdown command needs to be a proper systemcmd, otherwise the alias
and symlink generation doesn't work and we end up calling shutdown of
the host computer which is to be avoided.
px4fmu_test: same IO_pass mixer as px4fmu_default
px4fmu_test: use normal quad x mixer
There is no good reason to use a specific test mixer, except more cmake
code around it. Therefore just use the same mixer as default, and at
some point px4fmu_test and px4fmu_default can get merged
POSIX: cleanup, dir and symlink fixes
This cleans up the logic behind the symlinking and creating directories.
POSIX: correct arg order in usage info
tests: fix paths for SITL tests
POSIX: printf fix
sitl_run.sh: try to make this run on Mac as well
cmake: try to make jenkins happier
Path cleanup, the bin is no longer in src/firmware
POSIX: fix symlink logic
SITL: prefix all exported env variables
cmake: fix path for ROS tests
integrationtests: fix log path
launch: try to make tets with ROS working again
px4_defines: fix after wrong merge deconflicting
px4_defines: get paths for POSIX correct
cmake: fix cmake arguments
This was fine with cmake 3.6 but did not work with cmake 3.2.2
cmake: use cp instead of cmake -E copy
cmake -E copy does not support copying multiple files with versions <
3.5. Therefore, just use cp for now.
ROMFS: fix build error after rebase
cmake: fix paths in configs
launch: use `spawn_model` again
cmake: various fixes after big rebase
param: path fixes after rebase
posix platform: fixes after rebase
test_mixer: fix screwed up rebase
2018-08-02 16:32:51 -03:00
|
|
|
)
|
|
|
|
|
2019-09-04 11:30:20 -03:00
|
|
|
if (CMAKE_BUILD_TYPE STREQUAL FuzzTesting)
|
|
|
|
add_executable(px4
|
|
|
|
src/px4/common/main_fuzztesting.cpp
|
|
|
|
apps.cpp
|
|
|
|
)
|
|
|
|
else()
|
2022-08-22 12:00:03 -03:00
|
|
|
add_definitions(-DPX4_SOURCE_DIR="${PX4_SOURCE_DIR}" -DPX4_BINARY_DIR="${PX4_BINARY_DIR}")
|
|
|
|
|
2019-09-04 11:30:20 -03:00
|
|
|
add_executable(px4
|
|
|
|
src/px4/common/main.cpp
|
|
|
|
apps.cpp
|
|
|
|
)
|
|
|
|
endif()
|
2018-04-11 16:10:51 -03:00
|
|
|
|
2021-07-15 14:17:15 -03:00
|
|
|
target_link_libraries(px4
|
|
|
|
PRIVATE
|
|
|
|
${module_libraries}
|
2021-10-18 13:12:38 -03:00
|
|
|
m
|
2021-07-15 14:17:15 -03:00
|
|
|
parameters
|
|
|
|
)
|
2018-08-29 13:31:14 -03:00
|
|
|
|
2021-10-18 13:12:38 -03:00
|
|
|
if((NOT APPLE) AND (NOT ANDROID))
|
2021-07-15 14:17:15 -03:00
|
|
|
target_link_libraries(px4 PRIVATE rt)
|
|
|
|
endif()
|
2018-08-29 13:31:14 -03:00
|
|
|
|
2021-10-18 13:12:38 -03:00
|
|
|
if(NOT ANDROID)
|
|
|
|
target_link_libraries(px4 PRIVATE pthread)
|
|
|
|
endif()
|
|
|
|
|
2021-07-15 14:17:15 -03:00
|
|
|
target_link_libraries(px4 PRIVATE uORB)
|
2018-08-29 13:31:14 -03:00
|
|
|
|
2019-09-04 11:30:20 -03:00
|
|
|
if (CMAKE_BUILD_TYPE STREQUAL FuzzTesting)
|
|
|
|
target_include_directories(px4 PRIVATE SYSTEM "${CMAKE_BINARY_DIR}/mavlink}")
|
|
|
|
target_compile_options(px4 PRIVATE "-Wno-cast-align")
|
|
|
|
endif()
|
|
|
|
|
2021-07-15 14:17:15 -03:00
|
|
|
#=============================================================================
|
|
|
|
# install
|
|
|
|
#
|
2018-08-29 13:31:14 -03:00
|
|
|
|
2021-07-15 14:17:15 -03:00
|
|
|
# TODO: extend to snapdragon
|
|
|
|
|
|
|
|
# px4 dirs
|
|
|
|
install(
|
|
|
|
DIRECTORY
|
|
|
|
${PROJECT_SOURCE_DIR}/posix-configs
|
|
|
|
${PROJECT_SOURCE_DIR}/test
|
|
|
|
${CMAKE_BINARY_DIR}/etc
|
|
|
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
|
|
|
DESTINATION
|
|
|
|
${PROJECT_NAME}
|
|
|
|
USE_SOURCE_PERMISSIONS
|
|
|
|
)
|
2018-01-31 19:49:09 -04:00
|
|
|
|
2018-08-29 13:31:14 -03:00
|
|
|
# Module Symlinks
|
|
|
|
px4_posix_generate_symlinks(
|
|
|
|
MODULE_LIST ${module_libraries}
|
2018-09-27 06:25:23 -03:00
|
|
|
PREFIX ${PX4_SHELL_COMMAND_PREFIX}
|
2018-08-29 13:31:14 -03:00
|
|
|
TARGET px4
|
|
|
|
)
|
|
|
|
|
2022-08-22 12:00:03 -03:00
|
|
|
if(config_romfs_root)
|
2020-09-10 08:24:46 -03:00
|
|
|
add_subdirectory(${PX4_SOURCE_DIR}/ROMFS ${PX4_BINARY_DIR}/ROMFS)
|
|
|
|
add_dependencies(px4 romfs_gen_files_target)
|
|
|
|
endif()
|
|
|
|
|
2018-07-24 01:04:47 -03:00
|
|
|
|
2018-12-04 12:13:56 -04:00
|
|
|
# board defined upload helper
|
|
|
|
if(EXISTS "${PX4_BOARD_DIR}/cmake/upload.cmake")
|
|
|
|
include(${PX4_BOARD_DIR}/cmake/upload.cmake)
|
|
|
|
endif()
|
2018-07-24 01:04:47 -03:00
|
|
|
|
2022-11-15 14:09:04 -04:00
|
|
|
# board defined link libraries
|
|
|
|
if(EXISTS "${PX4_BOARD_DIR}/cmake/link_libraries.cmake")
|
|
|
|
include(${PX4_BOARD_DIR}/cmake/link_libraries.cmake)
|
|
|
|
endif()
|
2018-01-31 19:49:09 -04:00
|
|
|
|
2020-01-06 21:15:39 -04:00
|
|
|
if("${PX4_BOARD}" MATCHES "beaglebone_blue")
|
2019-12-29 17:59:42 -04:00
|
|
|
target_link_libraries(px4 PRIVATE robotics_cape)
|
2016-09-01 20:12:05 -03:00
|
|
|
|
2020-01-06 21:15:39 -04:00
|
|
|
elseif("${PX4_BOARD}" MATCHES "emlid_navio2")
|
|
|
|
target_link_libraries(px4 PRIVATE atomic)
|
|
|
|
|
2020-11-09 18:49:50 -04:00
|
|
|
# vscode launch.json
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Debug/launch_rpi.json.in ${PX4_SOURCE_DIR}/.vscode/launch.json COPYONLY)
|
|
|
|
|
2020-01-06 21:15:39 -04:00
|
|
|
elseif("${PX4_BOARD}" MATCHES "sitl")
|
2016-12-13 07:20:39 -04:00
|
|
|
|
2020-11-09 18:49:50 -04:00
|
|
|
# vscode launch.json
|
|
|
|
if(${PX4_BOARD_LABEL} MATCHES "replay")
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Debug/launch_replay.json.in ${PX4_SOURCE_DIR}/.vscode/launch.json COPYONLY)
|
2022-08-22 12:00:03 -03:00
|
|
|
|
2020-11-09 18:49:50 -04:00
|
|
|
else()
|
2022-09-10 17:18:02 -03:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Debug/launch_sitl.json.in ${PX4_SOURCE_DIR}/.vscode/launch.json COPYONLY)
|
2020-11-09 18:49:50 -04:00
|
|
|
endif()
|
|
|
|
|
2022-08-22 12:00:03 -03:00
|
|
|
set(SITL_WORKING_DIR ${PX4_BINARY_DIR}/rootfs)
|
|
|
|
file(MAKE_DIRECTORY ${SITL_WORKING_DIR})
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Debug/posix.lldbinit ${SITL_WORKING_DIR}/.lldbinit COPYONLY)
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Debug/posix.gdbinit ${SITL_WORKING_DIR}/.gdbinit COPYONLY)
|
|
|
|
|
2017-11-21 21:22:48 -04:00
|
|
|
if(BUILD_TESTING)
|
2018-01-04 23:12:03 -04:00
|
|
|
include(sitl_tests)
|
2017-11-21 21:22:48 -04:00
|
|
|
endif()
|
2016-12-13 07:20:39 -04:00
|
|
|
|
2022-09-21 23:11:42 -03:00
|
|
|
# "none" legacy SITL helper target
|
|
|
|
add_custom_target(none
|
|
|
|
COMMAND $<TARGET_FILE:px4>
|
|
|
|
WORKING_DIRECTORY ${SITL_WORKING_DIR}
|
|
|
|
USES_TERMINAL
|
|
|
|
DEPENDS px4
|
|
|
|
)
|
|
|
|
|
2018-08-29 13:31:14 -03:00
|
|
|
# install
|
|
|
|
|
|
|
|
# px4 dirs
|
|
|
|
install(
|
|
|
|
DIRECTORY
|
|
|
|
${PROJECT_SOURCE_DIR}/integrationtests
|
|
|
|
${PROJECT_SOURCE_DIR}/launch
|
2018-12-12 15:02:01 -04:00
|
|
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
2018-08-29 13:31:14 -03:00
|
|
|
DESTINATION
|
|
|
|
${PROJECT_NAME}
|
|
|
|
USE_SOURCE_PERMISSIONS
|
|
|
|
)
|
2018-08-08 03:04:12 -03:00
|
|
|
|
2018-08-29 13:31:14 -03:00
|
|
|
# px4 files
|
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
${PROJECT_SOURCE_DIR}/CMakeLists.txt
|
|
|
|
${PROJECT_SOURCE_DIR}/package.xml
|
|
|
|
DESTINATION
|
|
|
|
${PROJECT_NAME}
|
|
|
|
)
|
2018-05-02 10:47:12 -03:00
|
|
|
|
2018-08-29 13:31:14 -03:00
|
|
|
# px4 Tools dirs
|
|
|
|
install(
|
|
|
|
DIRECTORY
|
|
|
|
${PROJECT_SOURCE_DIR}/Tools/ecl_ekf
|
|
|
|
DESTINATION
|
|
|
|
${PROJECT_NAME}/Tools
|
|
|
|
USE_SOURCE_PERMISSIONS
|
|
|
|
)
|
2018-05-02 10:47:12 -03:00
|
|
|
|
2018-08-29 13:31:14 -03:00
|
|
|
# px4 Tools files
|
|
|
|
install(
|
|
|
|
PROGRAMS
|
2023-01-15 12:36:12 -04:00
|
|
|
${PROJECT_SOURCE_DIR}/Tools/simulation/gazebo-classic/setup_gazebo.bash
|
2018-08-29 13:31:14 -03:00
|
|
|
${PROJECT_SOURCE_DIR}/Tools/upload_log.py
|
|
|
|
DESTINATION
|
|
|
|
${PROJECT_NAME}/Tools
|
|
|
|
)
|
2018-05-02 10:47:12 -03:00
|
|
|
|
2020-09-10 08:24:46 -03:00
|
|
|
# ROMFS files
|
|
|
|
install(
|
|
|
|
DIRECTORY
|
2020-09-15 17:55:01 -03:00
|
|
|
${PX4_BINARY_DIR}/etc
|
2020-09-10 08:24:46 -03:00
|
|
|
DESTINATION
|
|
|
|
${PROJECT_NAME}/build/px4_sitl_default
|
|
|
|
)
|
|
|
|
|
2023-01-17 12:20:51 -04:00
|
|
|
# gazebo dirs
|
2018-08-29 13:31:14 -03:00
|
|
|
install(
|
|
|
|
DIRECTORY
|
2023-01-17 12:20:51 -04:00
|
|
|
${PROJECT_SOURCE_DIR}/Tools/simulation/gz/models
|
|
|
|
${PROJECT_SOURCE_DIR}/Tools/simulation/gz/worlds
|
2018-08-29 13:31:14 -03:00
|
|
|
DESTINATION
|
2023-01-15 12:36:12 -04:00
|
|
|
${PROJECT_NAME}/Tools/simulation/gazebo-classic/sitl_gazebo-classic
|
2023-12-18 12:49:51 -04:00
|
|
|
OPTIONAL
|
2018-08-29 13:31:14 -03:00
|
|
|
)
|
2018-05-02 10:47:12 -03:00
|
|
|
|
2018-08-29 13:31:14 -03:00
|
|
|
endif()
|