-
Notifications
You must be signed in to change notification settings - Fork 2
Additions of examples #1
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
Open
ajmhs
wants to merge
15
commits into
rticommunity:main
Choose a base branch
from
ajmhs:ajmh_additions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f4329e1
Add LSS_Library_Python as git submodule
ajmhs c70ecc7
Add concrete, documented examples which demonstrate further how to us…
ajmhs 31f6024
Fixed example dockerfile comment
ajmhs b53ac9e
Updated xbox and joystick controllers for responsiveness, mapping and…
ajmhs 4ad05b7
fix: add LSS_Library_Python submodule
wcoleman-rti fc19708
doc: align readme style/structure with rest of the project
wcoleman-rti 2c2171b
Update examples/WIS/html/robot_arm.html
ajmhs bc4bef5
Update examples/WIS/xml_config/wis_service.xml
ajmhs 1cda7dc
Update examples/WIS/xml_config/wis_service.xml
ajmhs ed9ed7a
Update examples/WIS/scripts/variables.sh
ajmhs a295d2f
Update examples/WIS/scripts/launch_wis.sh
ajmhs 81dba2d
Update examples/WIS/scripts/launch_wis.sh
ajmhs dabe99f
Update examples/telemetry_bridge/launch_telemetry_app.sh
ajmhs 7b61818
Updated the WIS variables script to make it more portable and added a…
ajmhs c62eace
Reworked the main robot app to improve performance issues found durin…
ajmhs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| [submodule "resource/cmake/rticonnextdds-cmake-utils"] | ||
| path = resource/cmake/rticonnextdds-cmake-utils | ||
| url = https://github.com/rticommunity/rticonnextdds-cmake-utils | ||
| [submodule "examples/lss_robot/LSS_Library_Python"] | ||
| path = examples/lss_robot/LSS_Library_Python | ||
| url = https://github.com/Lynxmotion/LSS_Library_Python.git | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| # The Dockerfile is based on the official Ubuntu image for the jammy release. | ||
| # The CONNEXT_VERSION argument is used to specify the version of RTI Connext to install. | ||
| # The RTI_LICENSE_AGREEMENT_ACCEPTED argument is used to accept the RTI license agreement during installation. | ||
| # The NDDSHOME environment variable is set to the installation directory of RTI Connext. | ||
| # | ||
| # The Dockerfile installs the RTI Connext Debian Package from the official RTI repository. It also installs some build tools and the license file. | ||
| # | ||
| # The CMD instruction specifies the default command to run when the container starts. In this case, it runs the /bin/bash shell. | ||
| # | ||
| # To build the Docker image, run the following command from the root repository folder: | ||
| # docker build -t connext:medtech_ra -f containers/base/Dockerfile --build-arg RTI_LICENSE_AGREEMENT_ACCEPTED=accepted --build-arg CONNEXT_VERSION=7.3.0 . | ||
| # | ||
| # To run the Docker container, run the following command: | ||
| # | ||
| # docker run --rm -it --network host -e DISPLAY --privileged --hostname rtimedtech -v $XAUTHORITY:/root/.Xauthority -v /tmp/.X11-unix:/tmp/.X11-unix -v $RTI_LICENSE_FILE:/root/rti_license.dat connext:medtech_ra bash | ||
wcoleman-rti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # | ||
| # Explanation of the options used in the docker run command: | ||
| # The -it option is used to run the container in interactive mode. | ||
| # The --rm option is used to remove the container when it exits. | ||
| # The --network host option is used to share the host's network stack with the container | ||
| # The -e DISPLAY option is used to set the DISPLAY environment variable in the container to the host's DISPLAY variable. | ||
| # The --privileged option is used to give the container additional privileges. | ||
| # The --hostname option is used to set the hostname of the container to rtimedtech. | ||
| # The -v $XAUTHORITY:/root/.Xauthority option is used to mount the X11 authentication file from the host to the container. | ||
wcoleman-rti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # The -v /tmp/.X11-unix:/tmp/.X11-unix option is used to mount the X11 socket from the host to the container. | ||
| # The -v $RTI_LICENSE_FILE:/root/rti_license.dat option is used to mount the RTI license file from the host to the container. | ||
| # | ||
| # The container will start and run the /bin/bash shell. | ||
|
|
||
|
|
||
| FROM ubuntu:jammy AS install-stage | ||
|
|
||
| ARG CONNEXT_VERSION=7.3.0 | ||
| ARG RTI_LICENSE_AGREEMENT_ACCEPTED | ||
|
|
||
| ENV DISPLAY=:0 | ||
| ENV SHELL=/bin/bash | ||
| ENV TZ=Europe/Madrid | ||
| ENV NDDSHOME=/opt/rti.com/rti_connext_dds-${CONNEXT_VERSION} | ||
| SHELL ["/bin/bash", "-c"] | ||
|
|
||
| # Install the required packages | ||
| RUN export DEBIAN_FRONTEND=noninteractive \ | ||
| && apt-get update \ | ||
| && apt-get install -y \ | ||
| ca-certificates \ | ||
| dash \ | ||
| tzdata \ | ||
| git \ | ||
| build-essential \ | ||
| cmake \ | ||
| libgtk-3-dev \ | ||
| libgtksourceviewmm-3.0-dev \ | ||
| python3 \ | ||
| python3-gi \ | ||
| python3-gi-cairo \ | ||
| python3-numpy \ | ||
| python3-matplotlib \ | ||
| python3-pip \ | ||
| gir1.2-gtk-4.0 \ | ||
| libgtk2.0-0 \ | ||
| libxxf86vm1 \ | ||
| libsm6 \ | ||
| libcanberra-gtk-module \ | ||
| iproute2 \ | ||
| iputils-ping \ | ||
| curl \ | ||
| nano \ | ||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists | ||
|
|
||
| # Install the RTI Connext Python API | ||
| RUN pip install rti.connext | ||
|
|
||
| # Install the RTI Connext Debian Package | ||
| RUN curl -sSL -o /usr/share/keyrings/rti-official-archive.gpg \ | ||
| https://packages.rti.com/deb/official/repo.key | ||
|
|
||
| RUN printf -- "deb [arch=%s, signed-by=%s] %s %s main\n" \ | ||
| $(dpkg --print-architecture) \ | ||
| /usr/share/keyrings/rti-official-archive.gpg \ | ||
| https://packages.rti.com/deb/official \ | ||
| $(. /etc/os-release && echo ${VERSION_CODENAME}) | tee /etc/apt/sources.list.d/rti-official.list >/dev/null | ||
|
|
||
| RUN export DEBIAN_FRONTEND=noninteractive \ | ||
| RTI_LICENSE_AGREEMENT_ACCEPTED=${RTI_LICENSE_AGREEMENT_ACCEPTED} \ | ||
| && apt-get update \ | ||
| && apt-get install -y \ | ||
| rti-connext-dds-${CONNEXT_VERSION} \ | ||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists | ||
|
|
||
| RUN echo "source ${NDDSHOME}/resource/scripts/rtisetenv_*.bash" >> /root/.bashrc | ||
|
|
||
| WORKDIR /root | ||
|
|
||
| RUN git clone --recurse-submodule https://github.com/rticommunity/rticonnextdds-medtech-reference-architecture.git medtech_ra | ||
| WORKDIR /root/medtech_ra/modules/01-operating-room | ||
|
|
||
| # Create a script to build the sources | ||
| RUN echo "#!/bin/bash" > build_module_01.sh | ||
| RUN echo "source ${NDDSHOME}/resource/scripts/rtisetenv_*.bash" >> build_module_01.sh | ||
| RUN echo "mkdir build && cd build && cmake .. && cmake --build ." >> build_module_01.sh | ||
| RUN chmod +x build_module_01.sh | ||
|
|
||
| # Configure licence file | ||
| RUN echo "export RTI_LICENSE_FILE=/root/rti_license.dat" >> /root/.bashrc | ||
| RUN rm ${NDDSHOME}/rti_license.dat | ||
| RUN ln -s /root/rti_licence.dat ${NDDSHOME}/rti_license.dat | ||
|
|
||
| FROM scratch AS final-stage | ||
|
|
||
| WORKDIR /root | ||
|
|
||
| COPY --from=install-stage / / | ||
|
|
||
| WORKDIR /root/medtech_ra/modules/01-operating-room | ||
| RUN ./build_module_01.sh | ||
|
|
||
| WORKDIR /root | ||
| CMD ["/bin/bash"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| # The Dockerfile is based on the official Ubuntu image for the jammy release. | ||
| # The CONNEXT_VERSION argument is used to specify the version of RTI Connext to install. | ||
| # The RTI_LICENSE_AGREEMENT_ACCEPTED argument is used to accept the RTI license agreement during installation. | ||
| # The NDDSHOME environment variable is set to the installation directory of RTI Connext. | ||
| # | ||
| # The Dockerfile installs the RTI Connext Debian Package from the official RTI repository. It also installs some build tools and the license file. | ||
| # | ||
| # The CMD instruction specifies the default command to run when the container starts. In this case, it runs the /bin/bash shell. | ||
| # | ||
| # To build the Docker image, run the following command from the root repository folder: | ||
| # docker build -t connext:medtech_ra -f containers/examples/Dockerfile --build-arg RTI_LICENSE_AGREEMENT_ACCEPTED=accepted --build-arg CONNEXT_VERSION=7.3.0 . | ||
| # | ||
| # To run the Docker container, run the following command: | ||
| # | ||
| # docker run --rm -it --network host -e DISPLAY -e SDL_AUDIODRIVER=dummy --device=/dev/ttyUSB0 --privileged --hostname rtimedtech -v $XAUTHORITY:/root/.Xauthority -v /tmp/.X11-unix:/tmp/.X11-unix -v $RTI_LICENSE_FILE:/root/rti_license.dat connext:medtech_ra bash | ||
wcoleman-rti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # | ||
| # Explanation of the options used in the docker run command: | ||
| # The -it option is used to run the container in interactive mode. | ||
| # The --rm option is used to remove the container when it exits. | ||
| # The --network host option is used to share the host's network stack with the container | ||
| # The -e DISPLAY option is used to set the DISPLAY environment variable in the container to the host's DISPLAY variable. | ||
| # The -e SDL_AUDIODRIVER=dummy option is used to set the SDL_AUDIODRIVER environment variable to dummy to avoid audio issues. | ||
| # The --device=/dev/ttyUSB0 option is used to give the container access to the USB device (e.g., joystick or xbox controller). | ||
| # The --privileged option is used to give the container additional privileges. | ||
| # The --hostname option is used to set the hostname of the container to rtimedtech. | ||
| # The -v $XAUTHORITY:/root/.Xauthority option is used to mount the X11 authentication file from the host to the container. | ||
wcoleman-rti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # The -v /tmp/.X11-unix:/tmp/.X11-unix option is used to mount the X11 socket from the host to the container. | ||
| # The -v $RTI_LICENSE_FILE:/root/rti_license.dat option is used to mount the RTI license file from the host to the container. | ||
| # | ||
| # The container will start and run the /bin/bash shell. | ||
|
|
||
|
|
||
| FROM ubuntu:jammy AS install-stage | ||
|
|
||
| ARG CONNEXT_VERSION=7.3.0 | ||
| ARG RTI_LICENSE_AGREEMENT_ACCEPTED | ||
|
|
||
| ENV DISPLAY=:0 | ||
| ENV SHELL=/bin/bash | ||
| ENV TZ=Europe/Madrid | ||
| ENV NDDSHOME=/opt/rti.com/rti_connext_dds-${CONNEXT_VERSION} | ||
| SHELL ["/bin/bash", "-c"] | ||
|
|
||
| # Install the required packages | ||
| RUN export DEBIAN_FRONTEND=noninteractive \ | ||
| && apt-get update \ | ||
| && apt-get install -y \ | ||
| ca-certificates \ | ||
| dash \ | ||
| tzdata \ | ||
| git \ | ||
| build-essential \ | ||
| cmake \ | ||
| libgtk-3-dev \ | ||
| libgtksourceviewmm-3.0-dev \ | ||
| python3 \ | ||
| python3-gi \ | ||
| python3-gi-cairo \ | ||
| python3-numpy \ | ||
| python3-matplotlib \ | ||
| python3-pip \ | ||
| python3-pygame \ | ||
| python3-serial \ | ||
| gir1.2-gtk-4.0 \ | ||
| libgtk2.0-0 \ | ||
| libxxf86vm1 \ | ||
| libsm6 \ | ||
| libcanberra-gtk-module \ | ||
| iproute2 \ | ||
| iputils-ping \ | ||
| curl \ | ||
| nano \ | ||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists | ||
|
|
||
| # Install the RTI Connext Python API | ||
| RUN pip install rti.connext | ||
|
|
||
| # Install the RTI Connext Debian Package | ||
| RUN curl -sSL -o /usr/share/keyrings/rti-official-archive.gpg \ | ||
| https://packages.rti.com/deb/official/repo.key | ||
|
|
||
| RUN printf -- "deb [arch=%s, signed-by=%s] %s %s main\n" \ | ||
| $(dpkg --print-architecture) \ | ||
| /usr/share/keyrings/rti-official-archive.gpg \ | ||
| https://packages.rti.com/deb/official \ | ||
| $(. /etc/os-release && echo ${VERSION_CODENAME}) | tee /etc/apt/sources.list.d/rti-official.list >/dev/null | ||
|
|
||
| RUN export DEBIAN_FRONTEND=noninteractive \ | ||
| RTI_LICENSE_AGREEMENT_ACCEPTED=${RTI_LICENSE_AGREEMENT_ACCEPTED} \ | ||
| && apt-get update \ | ||
| && apt-get install -y \ | ||
| rti-connext-dds-${CONNEXT_VERSION} \ | ||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists | ||
|
|
||
| RUN echo "source ${NDDSHOME}/resource/scripts/rtisetenv_*.bash" >> /root/.bashrc | ||
|
|
||
| WORKDIR /root | ||
|
|
||
| RUN git clone --recurse-submodule https://github.com/rticommunity/rticonnextdds-medtech-reference-architecture.git medtech_ra | ||
| WORKDIR /root/medtech_ra/modules/01-operating-room | ||
|
|
||
| # Copy additional source files | ||
| COPY ./examples/joystick_controller/joystick_controller.py \ | ||
| ./examples/lss_robot/lss_robot_app.py \ | ||
| ./examples/lss_robot/LSS_Library_Python/src/lss.py \ | ||
| ./examples/lss_robot/LSS_Library_Python/src/lss_const.py \ | ||
| ./examples/telemetry_bridge/telemetry_app.py \ | ||
| ./examples/xbox_controller/xbox_controller.py \ | ||
| /root/medtech_ra/modules/01-operating-room/src/ | ||
|
|
||
| # Copy launch scripts | ||
| COPY ./examples/joystick_controller/launch_arm_joystick.sh \ | ||
| ./examples/lss_robot/launch_robot_app.sh \ | ||
| ./examples/telemetry_bridge/launch_telemetry_app.sh \ | ||
| ./examples/xbox_controller/launch_arm_xbox.sh \ | ||
| /root/medtech_ra/modules/01-operating-room/scripts/ | ||
|
|
||
| # Create a script to build the sources | ||
| RUN echo "#!/bin/bash" > build_module_01.sh | ||
| RUN echo "source ${NDDSHOME}/resource/scripts/rtisetenv_*.bash" >> build_module_01.sh | ||
| RUN echo "mkdir build && cd build && cmake .. && cmake --build ." >> build_module_01.sh | ||
| RUN chmod +x build_module_01.sh | ||
|
|
||
| # Configure licence file | ||
| RUN echo "export RTI_LICENSE_FILE=/root/rti_license.dat" >> /root/.bashrc | ||
| RUN rm ${NDDSHOME}/rti_license.dat | ||
| RUN ln -s /root/rti_licence.dat ${NDDSHOME}/rti_license.dat | ||
|
|
||
| FROM scratch AS final-stage | ||
|
|
||
| WORKDIR /root | ||
|
|
||
| COPY --from=install-stage / / | ||
|
|
||
| WORKDIR /root/medtech_ra/modules/01-operating-room | ||
| RUN ./build_module_01.sh | ||
|
|
||
| WORKDIR /root | ||
| CMD ["/bin/bash"] | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 some reason the submodule didn't get added to the git index (maybe not committed?), so
git submodule update --init ...didn't pull in the LSS submodule. I used this to add the submodule locally, butexamples/lss_robot/LSS_Library_Pythonjust needs to be committed.git submodule add -f https://github.com/Lynxmotion/LSS_Library_Python.git examples/lss_robot/LSS_Library_Python