-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
cmake px4 + sitl package #9309
cmake px4 + sitl package #9309
Conversation
e5f984f
to
3f8a59b
Compare
6f1a44b
to
de255a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shaves ~2 minutes off each test.
e57ad17
to
c26ce65
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works with Gazebo + Jenkins. I added some comments to explain some of the details, but It looks good to go.
Jenkinsfile
Outdated
unstash 'px4_sitl_package' | ||
sh 'unzip build/posix_sitl_default/px4-posix_sitl_default*.zip' | ||
sh 'mv px4-posix_sitl_default*/bin/px4 px4-posix_sitl_default*/share/px4/' | ||
sh 'chmod +x px4-posix_sitl_default*/share/px4/px4' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely happy about having to do this -- it looks messy. Creating a procedure like the one for build nodes will clean it up.
Jenkinsfile
Outdated
sh './Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`' | ||
unstash 'px4_sitl_package' | ||
sh 'unzip build/posix_sitl_default/px4-posix_sitl_default*.zip' | ||
sh 'mv px4-posix_sitl_default*/bin/px4 px4-posix_sitl_default*/share/px4/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a result of cpack using different bin and share dirs. It needs to be moved for ROS.
return 1 | ||
fi | ||
|
||
SRC_DIR=$1 | ||
BUILD_DIR=$2 | ||
|
||
# setup Gazebo env and update package path | ||
export GAZEBO_PLUGIN_PATH=${BUILD_DIR}/build_gazebo:${GAZEBO_PLUGIN_PATH} | ||
export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:${SRC_DIR}/Tools/sitl_gazebo/models | ||
# Disabling the remote model download seems only necessary with Gazebo 6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gazebo 6 isn't supported anymore.
export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:${SRC_DIR}/Tools/sitl_gazebo/models | ||
# Disabling the remote model download seems only necessary with Gazebo 6 | ||
#export GAZEBO_MODEL_DATABASE_URI="" | ||
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${SRC_DIR}/Tools/sitl_gazebo/Build/msgs/:${BUILD_DIR}/build_gazebo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build/msgs
doesn't exist and msgs aren't needed to be in the path variable
@dagar So far we have everything we need for use by Jenkins. Do we want to consider use by users?
|
platforms/posix/CMakeLists.txt
Outdated
DIRECTORY | ||
${PROJECT_SOURCE_DIR}/build/posix_sitl_default/build_gazebo | ||
DESTINATION | ||
${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/build/posix_sitl_default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to think about how to do this independant of directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could create a list of the files and use DIRECTORY
with FILES_MATCHING
to reduce the number of install
commands. I originally did it this way to be clear about where everything is coming from while I was determining the pieces that we needed. I'm not attached to this implementation.
|
If we do a tarball instead of zip it will preserve the permissions. |
3de5843
to
5e803c3
Compare
Permissions are good. I'm happier with this. Let me know if you want this all squashed and/or if this is OK. FYI, the tar.bz2 is close to 90MB. The size of the extracted contents is ~270MB. The large size comes from the 50 models in sitl_gazebo that takes up ~240MB. Jenkins seems to be handling this fine, but this will eat space on master. From the docs: |
Jenkinsfile
Outdated
sh './Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`' | ||
unstash 'px4_sitl_package' | ||
sh 'tar -xjpf build/posix_sitl_default/px4-posix_sitl_default*.bz2' | ||
sh 'mv px4-posix_sitl_default*/bin/px4 px4-posix_sitl_default*/share/px4/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the move?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For ROS to find px4 -- for use with the launch file -- px4 needs to be next to the package.xml
and CMakeLists.txt
. This makes it think it is a ROS package, allowing it to be used in the launch file.
Alternatively, we can launch everything differently with a different set of scripts, but for now, this resembles the current structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just found it a bit weird that the package contents need to be massaged to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. It is weird. To avoid this we can either 1) change cpack target destination for px4 -- don't use bin and share dirs or 2) don't launch px4 in roslaunch anymore -- script the launch instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do whatever's easier and simpler at this point. Keep in mind CI is effectively the only consumer of the package at the moment, so it might as well be made to fit.
I don't have an opinion about dropping roslaunch yet. What's better long term?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point, where the pkg is only for CI, I'd rather change the CPack destination dirs. Option 2 is a more invasive change (new launch file and script, more testing, and so on). Long term, if users are to sudo dpkg -i px4.deb
, this would be the more appropriate approach.
This looks great. I have a couple minor questions and things to verify about the paths, but I think we're nearly good to go. What do you think about having a separate sitl_gazebo package in the future? |
Can we skip the checkout per mission build? |
Yes. If we need it, we can build it as a separate component in cmake, but it would be nicer of we could simply pull the already-built lib files and models we need from a "released" version of sitl_gazebo (OSRF hosted or even a separate Jenkins job that would build and keep versions on S3) for use with Jenkins. I also think the idea here is to move in the direction where users don't have to build anything to run SITL sims.
Yes. I think so. Let me check this out later today. |
d28d86b
to
b792699
Compare
Nice improvement! |
TODO
jmavsim andgazebo running from both package and build dir