-
Notifications
You must be signed in to change notification settings - Fork 56
Move to gazebo harmonic #61
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -1,75 +1,65 @@ | ||||
| FROM ubuntu:20.04 | ||||
| FROM ubuntu:24.04 | ||||
|
|
||||
| ENV WORKSPACE_DIR /root | ||||
| ENV FIRMWARE_DIR ${WORKSPACE_DIR}/Firmware | ||||
| ENV FIRMWARE_DIR ${WORKSPACE_DIR}/px4 | ||||
| ENV SITL_RTSP_PROXY ${WORKSPACE_DIR}/sitl_rtsp_proxy | ||||
|
|
||||
| ENV DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true | ||||
| ENV DISPLAY :99 | ||||
| ENV LANG C.UTF-8 | ||||
|
|
||||
| RUN apt-get update && \ | ||||
| apt-get install -y wget lsb-release && \ | ||||
| apt-get -y autoremove && \ | ||||
| apt-get clean autoclean && \ | ||||
| rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/* | ||||
|
|
||||
| RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg && \ | ||||
| echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null | ||||
|
|
||||
|
|
||||
| RUN apt-get update && \ | ||||
| apt-get install -y bc \ | ||||
| apt-get install -y \ | ||||
| bc \ | ||||
| cmake \ | ||||
| gazebo11 \ | ||||
| curl \ | ||||
| git \ | ||||
| gnupg \ | ||||
| gstreamer1.0-plugins-bad \ | ||||
| gstreamer1.0-plugins-base \ | ||||
| gstreamer1.0-plugins-good \ | ||||
| gstreamer1.0-plugins-ugly \ | ||||
| iproute2 \ | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you still need the px4-gazebo-headless/edit_rcS.bash Line 27 in ff79470
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, not sure why I removed it! |
||||
| libeigen3-dev \ | ||||
| libgazebo11-dev \ | ||||
| libgstreamer-plugins-base1.0-dev \ | ||||
| libgstrtspserver-1.0-dev \ | ||||
| libopencv-dev \ | ||||
| libroscpp-dev \ | ||||
| protobuf-compiler \ | ||||
| python3-jsonschema \ | ||||
| python3-numpy \ | ||||
| lsb-release \ | ||||
| python3-pip \ | ||||
| unzip \ | ||||
| xvfb && \ | ||||
| apt-get -y autoremove && \ | ||||
| python3-empy \ | ||||
| python3-future \ | ||||
| python3-jinja2 \ | ||||
| python3-jsonschema \ | ||||
| python3-kconfiglib \ | ||||
| python3-yaml \ | ||||
| xvfb | ||||
|
|
||||
| RUN pip3 install --break-system-packages pyros-genmsg | ||||
|
|
||||
| RUN curl https://packages.osrfoundation.org/gazebo.gpg --output /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg && \ | ||||
| echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null && \ | ||||
| apt-get update && \ | ||||
| apt-get install -y gz-harmonic | ||||
|
|
||||
| RUN apt-get -y autoremove && \ | ||||
| apt-get clean autoclean && \ | ||||
| rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/* | ||||
|
|
||||
| RUN pip3 install --upgrade pip && \ | ||||
| pip3 install empy==3.3.4 \ | ||||
| future \ | ||||
| jinja2 \ | ||||
| kconfiglib \ | ||||
| packaging \ | ||||
| pyros-genmsg \ | ||||
| toml \ | ||||
| pyyaml | ||||
|
|
||||
| RUN git clone https://github.com/PX4/PX4-Autopilot.git ${FIRMWARE_DIR} | ||||
| RUN git -C ${FIRMWARE_DIR} checkout main | ||||
| RUN git -C ${FIRMWARE_DIR} submodule update --init --recursive | ||||
|
|
||||
| COPY edit_rcS.bash ${WORKSPACE_DIR} | ||||
| COPY entrypoint.sh /root/entrypoint.sh | ||||
| RUN chmod +x /root/entrypoint.sh | ||||
|
|
||||
| RUN ["/bin/bash", "-c", " \ | ||||
| cd ${FIRMWARE_DIR} && \ | ||||
| DONT_RUN=1 make px4_sitl gazebo && \ | ||||
| DONT_RUN=1 make px4_sitl gazebo \ | ||||
| "] | ||||
| COPY fix-cmake-build.patch ${FIRMWARE_DIR} | ||||
| RUN git -C ${FIRMWARE_DIR} apply fix-cmake-build.patch | ||||
|
|
||||
| COPY sitl_rtsp_proxy ${SITL_RTSP_PROXY} | ||||
| RUN cmake -B${SITL_RTSP_PROXY}/build -H${SITL_RTSP_PROXY} | ||||
| RUN cmake --build ${SITL_RTSP_PROXY}/build | ||||
|
|
||||
| RUN cmake -DCONFIG=px4_sitl_default -B${FIRMWARE_DIR}/build -S${FIRMWARE_DIR} && \ | ||||
| cmake --build ${FIRMWARE_DIR}/build | ||||
|
|
||||
| COPY edit_rcS.bash ${WORKSPACE_DIR} | ||||
| COPY entrypoint.sh /root/entrypoint.sh | ||||
| RUN chmod +x /root/entrypoint.sh | ||||
|
|
||||
| ENTRYPOINT ["/root/entrypoint.sh"] | ||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,8 +32,8 @@ function get_ip { | |
|
|
||
| OPTIND=1 # Reset in case getopts has been used previously in the shell. | ||
|
|
||
| vehicle=iris | ||
| world=empty | ||
| vehicle=gz_x500 | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dakejahl, @julianoes: does gz_x500 have a camera that would enable the video stream? If not, which airframe does have a camera? I used to do it with typhoon_h480, but it doesn't seem to give me a video stream with gazebo harmonic 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I missed this. The x500_mono_cam is what you're looking for
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Don't be! It was a draft PR that I finally tested today, and tagged you with this question. So you actually answered really fast 😬. Let me try There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well I missed it the first time you tagged me. I have failed you. I have failed my family. I have been a bad chatgpt.
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it works, on the host I can run and get the video 🙌. Thanks for the help! |
||
| world=default | ||
|
|
||
| while getopts "h?v:w:" opt; do | ||
| case "$opt" in | ||
|
|
@@ -65,5 +65,4 @@ Xvfb :99 -screen 0 1600x1200x24+32 & | |
| ${SITL_RTSP_PROXY}/build/sitl_rtsp_proxy & | ||
|
|
||
| source ${WORKSPACE_DIR}/edit_rcS.bash ${IP_API} ${IP_QGC} && | ||
| cd ${FIRMWARE_DIR} && | ||
| HEADLESS=1 make px4_sitl gazebo_${vehicle}__${world} | ||
| HEADLESS=1 PX4_SIM_MODEL=${vehicle} PX4_GZ_WORLD=${world} ${FIRMWARE_DIR}/build/bin/px4 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| diff --git a/src/lib/events/CMakeLists.txt b/src/lib/events/CMakeLists.txt | ||
| index fcdb971f64..cdf366199c 100644 | ||
| --- a/src/lib/events/CMakeLists.txt | ||
| +++ b/src/lib/events/CMakeLists.txt | ||
| @@ -57,6 +57,7 @@ add_custom_command(OUTPUT ${generated_events_px4_file} | ||
| ${PX4_SOURCE_DIR}/Tools/px4events/jsonout.py | ||
| ${PX4_SOURCE_DIR}/Tools/px4events/srcparser.py | ||
| ${PX4_SOURCE_DIR}/Tools/px4events/srcscanner.py | ||
| + modules__uxrce_dds_client | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, why is that? Should we try to fix that properly on the PX4 side (at least for the next release)?
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was failing otherwise 🤷. I didn't investigate further 😇
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without the patch, it fails to build with (still on latest Maybe I'm missing some magic that the Makefile does before calling CMake? I don't know.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Odd. How is this different in docker? 🤔
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am building with cmake, I think because I didn't manage to run the make wrapper just for building (it's running immediately). So I do this: I could imagine that the Makefile does some more magic before calling CMake, including this module stuff?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a way to not make it run: |
||
| prebuild_targets # ensure all generated source files exist | ||
| COMMENT "Generating px4 event json file from source" | ||
| ) | ||
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.
PX4 still needs
bcpretty sure:https://github.com/PX4/PX4-Autopilot/blob/c06ba93175782e5a90a83017fb2f92bb69da58f8/ROMFS/px4fmu_common/init.d-posix/rcS#L199
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.
Oh, for the speed factor. Maybe it explains why it didn't fail in my tests 😇. Adding it back!