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

Update devcontainer config to support Foxglove Studio on Codespace #110

Draft
wants to merge 69 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
4d54672
Silence build warnings in Noetic
nickswalker Mar 25, 2021
f767360
Fix broken install directives
nickswalker Apr 2, 2021
99c8ab8
Fix main car symlink in install space
nickswalker Apr 2, 2021
3047d3b
Removed timed roslaunch
schmittlema Dec 5, 2021
4a48508
update package.xml
schmittlema Dec 12, 2021
a0e3af3
add noetic install scripts
schmittlema Dec 12, 2021
0a50c16
creating catkin_ws outside container
schmittlema Dec 13, 2021
37e548a
proper path variables
schmittlema Dec 13, 2021
6f1d202
working
schmittlema Dec 14, 2021
0f45269
laptop support and cpu only
schmittlema Jan 6, 2022
60534f4
nav repos
schmittlema Jan 8, 2022
0dca182
more stable install script
schmittlema Jan 8, 2022
212ffee
python deps
schmittlema Jan 9, 2022
1797264
more deps
schmittlema Jan 12, 2022
f22f375
curl separate line, change question
schmittlema Jan 13, 2022
88d8d09
docker permissions, docker-compose for robot only
schmittlema Jan 13, 2022
0680462
remove redundant build
schmittlema Jan 13, 2022
27f3406
remove newgrp
schmittlema Jan 13, 2022
7117628
update install script for macos support
mcdoerr Jan 25, 2022
9009455
build fixes
Mar 16, 2022
623cc52
switch to mushr and os type builds
Mar 17, 2022
2fd7656
default expose port 9090 for foxglove integration
mcdoerr Apr 13, 2022
3eab953
Merge branch 'noetic' of https://github.com/prl-mushr/mushr into noet…
mcdoerr Apr 13, 2022
e2ca88b
add new foxglove layout preset
mcdoerr Apr 14, 2022
3c78526
Merge pull request #77 from prl-mushr/foxglove-viz
schmittlema Apr 15, 2022
ce70552
remove xhost +x
schmittlema Apr 21, 2022
8e2ce8e
remove network:host from compose
schmittlema Apr 21, 2022
a540b47
mushr_noetic as a script
schmittlema Apr 21, 2022
7e075ab
MUSHR prefix and delete old stuff
schmittlema Apr 21, 2022
928fbbb
pushd/popd
schmittlema Apr 21, 2022
d23e0bb
remove making the catkin_ws for them
schmittlema Apr 21, 2022
f2ff027
move mushr_noetic to /usr/local/bin
schmittlema Apr 25, 2022
08a396a
Update mushr_utils/install/mushr_install.bash
schmittlema Apr 28, 2022
905d66e
small tweaks from feedback
schmittlema Apr 28, 2022
d8d3d87
Merge branch 'noetic_bashscript_updates' of github.com:prl-mushr/mush…
schmittlema Apr 28, 2022
a26bfc1
heredoc
schmittlema Apr 28, 2022
48353e3
remove gpu compose
schmittlema Apr 28, 2022
b4ce7ac
add sbpl install
schmittlema Apr 28, 2022
59150b1
interface on laptop set to eth0
schmittlema Apr 29, 2022
dfc6098
remove devices + volumes for cpu
mcdoerr Apr 29, 2022
aea3d47
update foxglove config with new extension panel
mcdoerr May 30, 2022
aaf5122
Merge pull request #81 from prl-mushr/foxglove-config-update
schmittlema May 31, 2022
9e86277
robot --> aarch64 docker image
schmittlema May 31, 2022
d735b44
Merge branch 'noetic' into noetic_bashscript_updates
schmittlema May 31, 2022
129fc2a
Merge pull request #78 from prl-mushr/noetic_bashscript_updates
schmittlema May 31, 2022
89764e6
fix install issues
schmittlema Jun 19, 2022
b88246d
add image tag back in
schmittlema Jun 19, 2022
237567a
fix build scripts
Jun 30, 2022
ca022dc
ws_path --> mushr_ws_path
schmittlema Jul 4, 2022
a39919d
install realsense2camera
schmittlema Aug 17, 2022
c22b9c5
fixed build from scratch on robot
MarkusSchiffer Apr 17, 2023
b921100
removed commented out section
MarkusSchiffer Apr 17, 2023
1704b35
Merge pull request #105 from prl-mushr/noetic-build-fixes
schmittlema Apr 24, 2023
127a4a5
made install changes for OSX, removed python2 for CPU
MarkusSchiffer May 3, 2023
1cd99d4
Merge pull request #106 from prl-mushr/noetic-build-imprv
schmittlema May 4, 2023
f71d079
Add initial devcontainer config
mjyc Jun 3, 2023
6560267
Update mushr_noetic to support 'run' and use it
mjyc Jun 3, 2023
99c043c
Add example vscode tasks config
mjyc Jun 3, 2023
c8de370
Support --trivial-only in mushr_install.bash
mjyc Jun 3, 2023
a744091
Bug fix: set shebang line
mjyc Jun 3, 2023
e4e6041
Remove autogenerated mushr_noetic
mjyc Jun 3, 2023
82dd152
Remove unused dockerfile
Jun 5, 2023
1609652
Refactor
mjyc Jun 6, 2023
6ffc1ea
Add initial workflow config & test
mjyc Jun 6, 2023
dd25d4c
Add roslaunch-teleop-test and start-foxglove-studio tests to smoke_te…
mjyc Jun 7, 2023
7398b4a
Add webserver
mjyc Jun 7, 2023
330bdd4
Make websocket_external_port configurable
mjyc Jun 7, 2023
90c5562
Update tasks.json
mjyc Jun 7, 2023
bc17555
Remove custom caddy install script
mjyc Jun 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .devcontainer/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
(globals) {
encode gzip

@http_scheme {
expression {http.request.scheme}=="https" || {header.X-Forwarded-Scheme}=="https" || {header.X-Forwarded-Proto}=="https"
}
vars @http_scheme WsScheme "wss"
vars WsScheme "ws"

@host_forwarded {
header X-Forwarded-Host *
}
vars @host_forwarded ReqHost {header.X-Forwarded-Host}
vars ReqHost {http.request.hostport}

@websockets {
header_regexp Connection (?i)(Upgrade)
header Upgrade websocket
}
}

:8080 {
# serve foxglove studio
import globals
root * /srv/foxglove
file_server

# serve foxglove studio
reverse_proxy @websockets "localhost:9090"

log {
output file /tmp/caddy.log
}
}
5 changes: 5 additions & 0 deletions .devcontainer/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

cd /home/vscode/catkin_ws/src;
./mushr/mushr_utils/install/mushr_install.bash --trivial-only;
mushr_noetic run 'cd catkin_ws && catkin build'
20 changes: 20 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"image": "osrf/ros:noetic-desktop-full",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"username": "vscode",
"userUid": "1000",
"userGid": "1000"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers-contrib/features/caddy:1": {},
"ghcr.io/devcontainers/features/desktop-lite:1": {
"webPort": 6080
}
},
"forwardPorts": [6080], // for noVNC clients
"remoteUser": "vscode",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/catkin_ws/src/mushr,type=bind",
"workspaceFolder": "/home/vscode/catkin_ws",
"postCreateCommand": "./src/mushr/.devcontainer/install.sh && sudo chown -R vscode:vscode . && ln -s ${containerWorkspaceFolder}/src/mushr/.vscode ${containerWorkspaceFolder} && ./src/mushr/.devcontainer/build.sh"
}
19 changes: 19 additions & 0 deletions .devcontainer/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -e

# Install foxglove studio
cleanup() {
EXIT_CODE=$?
set +e
if [[ -n "${CONTAINER_ID}" ]]; then
echo "Executing cleanup of the container"
docker rm -f "$CONTAINER_ID"
fi
exit $EXIT_CODE
}
trap cleanup EXIT

CONTAINER_ID=$(docker run -d ghcr.io/foxglove/studio)
sudo docker cp "$CONTAINER_ID:/src" /srv/foxglove
docker stop "$CONTAINER_ID"
docker rm "$CONTAINER_ID"
23 changes: 23 additions & 0 deletions .devcontainer/smoke_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e

mushr_noetic run 'source ~/.bashrc && roslaunch mushr_sim teleop.launch' > /tmp/output_roslaunch &
sleep 5
if tail -n 1 /tmp/output_roslaunch | grep -q "Rosbridge WebSocket server started at ws://0.0.0.0:9090"; then
echo "✅ roslaunch-teleop-test passed"
else
cat /tmp/output_roslaunch # print output for debugging purposes
echo "❌ roslaunch-teleop-test failed"
exit 1;
fi

docker run --rm -p "8080:8080" ghcr.io/foxglove/studio:latest &
sleep 10;
if curl -sSf http://localhost:8080 >/dev/null; then
echo "✅ start-foxglove-studio passed"
else
echo "❌ start-foxglove-studio failed"
exit 1;
fi

exit 0;
21 changes: 21 additions & 0 deletions .github/workflows/devcontainer-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -e

SRC_DIR="$(pwd)"

echo "Running Smoke Test"

# Build
export DOCKER_BUILDKIT=1
echo "(*) Installing @devcontainer/cli"
npm install -g @devcontainers/cli

echo "Building Dev Container"
ID_LABEL="test-container=mushr"
devcontainer up --id-label ${ID_LABEL} --workspace-folder "${SRC_DIR}"

# Test
devcontainer exec --workspace-folder "${SRC_DIR}" --id-label ${ID_LABEL} /bin/sh -c './src/mushr/.devcontainer/smoke_test.sh'

# Clean up
docker rm -f $(docker container ls -f "label=${ID_LABEL}" -q)
16 changes: 16 additions & 0 deletions .github/workflows/test-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "CI"
on:
pull_request:
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout main
id: checkout_release
uses: actions/checkout@v3
- name: Devcontainer container smoke test
id: test_devcontainer
shell: bash
run: ./.github/workflows/devcontainer-test.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ yaml-cpp/
mushr_hardware/realsense-ros/
mushr_hardware/realsense2_camera/
mushr_hardware/realsense2_description/
.install_run.txt
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"tasks": [
{
"label": "Roslaunch teleop.launch",
"type": "shell",
"command": "mushr_noetic run 'source ~/.bashrc && ROSBRIDGE_WEBSOCKET_EXTERNAL_PORT=80 roslaunch mushr_sim teleop.launch'",
"problemMatcher": []
},
{
"label": "Start Foxglove Studio server",
"type": "shell",
"command": "caddy run --config ~/catkin_ws/src/mushr/.devcontainer/Caddyfile",
"problemMatcher": []
}
]
}
37 changes: 37 additions & 0 deletions base-repos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
repositories:
mushr_sim:
type: git
url: https://github.com/prl-mushr/mushr_sim.git
version: noetic
mushr/mushr_base/mushr_base:
type: git
url: https://github.com/prl-mushr/mushr_base.git
version: noetic
mushr/mushr_base/vesc:
type: git
url: https://github.com/prl-mushr/vesc.git
version: noetic
mushr/mushr_base/ackermann_cmd_mux:
type: git
url: https://github.com/prl-mushr/ackermann_cmd_mux.git
version: noetic
mushr/mushr_hardware/realsense:
type: git
url: https://github.com/IntelRealSense/realsense-ros.git
version: f400d682beee6c216052a419f419e95b797255ad
range_libc:
type: git
url: https://github.com/prl-mushr/range_libc.git
version: noetic
mushr/mushr_hardware/push_button_utils:
type: git
url: https://github.com/prl-mushr/push_button_utils.git
version: master
mushr/mushr_hardware/ydlidar:
type: git
url: https://github.com/prl-mushr/ydlidar.git
version: master
serial:
type: git
url: https://github.com/wjwwood/serial.git
version: main
26 changes: 18 additions & 8 deletions mushr_description/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.0.2)
project(mushr_description)

find_package(catkin REQUIRED)
Expand All @@ -20,7 +20,7 @@ function(build_xacro infile outfile xacro_args)
# Process xacro into final output
add_custom_command(OUTPUT "${outfile}"
COMMENT "Generating ${outfile}"
COMMAND ${CATKIN_ENV} rosrun xacro xacro --inorder
COMMAND ${CATKIN_ENV} rosrun xacro xacro
-o "${outfile}" "${infile}" ${_xacro_deps_result} ${xacro_args}
DEPENDS "${infile}" ${_xacro_deps_result}
VERBATIM)
Expand Down Expand Up @@ -54,9 +54,11 @@ set(MUSHR_TX2_GREEN_BLACK_URDF "${ROBOTS_OUTPUT_DIR}/mushr_tx2_green_black.urdf"
set(MUSHR_TX2_GREEN_BLACK_LINK "${ROBOTS_OUTPUT_DIR}/racecar-uw-tx2-green-black.urdf")
set(MUSHR_TX2_GREEN_BLACK_ARGS "platform_color:=green" "inset_color:=black")

set(MUSHR_NANO_URDF_XACRO "${ROBOTS_SRC_DIR}/mushr_nano.urdf.xacro")
set(MUSHR_NANO_URDF "${ROBOTS_OUTPUT_DIR}/mushr_nano.urdf")
set(MUSHR_NANO_LINK "${ROBOTS_OUTPUT_DIR}/racecar-uw-nano.urdf")
set(MUSHR_NANO_BASE "mushr_nano.urdf")
set(MUSHR_NANO_LINK "racecar-uw-nano.urdf")
set(MUSHR_NANO_URDF_XACRO "${ROBOTS_SRC_DIR}/${MUSHR_NANO_BASE}.xacro")
set(MUSHR_NANO_URDF "${ROBOTS_OUTPUT_DIR}/${MUSHR_NANO_BASE}")
set(MUSHR_NANO_LINK_DEVEL "${ROBOTS_OUTPUT_DIR}/${MUSHR_NANO_LINK}")

set(MUSHR_NANO_RED_WHITE_URDF_XACRO "${ROBOTS_SRC_DIR}/mushr_nano.urdf.xacro")
set(MUSHR_NANO_RED_WHITE_URDF "${ROBOTS_OUTPUT_DIR}/mushr_nano_red_white.urdf")
Expand Down Expand Up @@ -118,7 +120,7 @@ add_custom_target(link_mushr_tx2 ALL
add_custom_target(link_mushr_tx2_green_black ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink ${MUSHR_TX2_GREEN_BLACK_URDF} ${MUSHR_TX2_GREEN_BLACK_LINK})
add_custom_target(link_mushr_nano ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink ${MUSHR_NANO_URDF} ${MUSHR_NANO_LINK})
COMMAND ${CMAKE_COMMAND} -E create_symlink ${MUSHR_NANO_URDF} ${MUSHR_NANO_LINK_DEVEL})
add_custom_target(link_mushr_nano_red_white ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink ${MUSHR_NANO_RED_WHITE_URDF} ${MUSHR_NANO_RED_WHITE_LINK})
add_custom_target(link_mushr_nano_teal_purple ALL
Expand All @@ -128,11 +130,19 @@ add_custom_target(link_mushr_nano_purple_gold ALL
add_custom_target(link_mushr_nano_green_black ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink ${MUSHR_NANO_GREEN_BLACK_URDF} ${MUSHR_NANO_GREEN_BLACK_LINK})

install(DIRECTORY DESTINATION "${CATKIN_PACKAGE_SHARE_DESTINATION}/robots")
install(DIRECTORY robots DESTINATION "${CATKIN_PACKAGE_SHARE_DESTINATION}")

install(FILES
${DESCRIPTION_FILES}
${CORE_DESCRIPTION_FILES}
DESTINATION "${CATKIN_PACKAGE_SHARE_DESTINATION}/robots")

install(CODE "execute_process( \
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${CMAKE_INSTALL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/robots/${MUSHR_NANO_BASE} \
${CMAKE_INSTALL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/robots/${MUSHR_NANO_LINK} \
)"
)

install(DIRECTORY meshes
DESTINATION "${CATKIN_PACKAGE_SHARE_DESTINATION}")

Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
<arg name="sensors_config" default="$(find mushr_hardware)/config/$(arg racecar_version)/sensors.yaml" />
<rosparam file="$(arg sensors_config)" command="load" />

<node pkg="timed_roslaunch" type="timed_roslaunch.sh"
args="10 realsense2_camera rs_camera.launch camera:=/$(arg car_name)/camera tf_prefix:=/$(arg car_name)/camera"
name="rs_camera_timed_roslaunch" output="screen" />

<include file="$(find realsense2_camera)/launch/rs_camera.launch" >
<arg name="camera" value="$(arg car_name)/camera" />
<arg name="tf_prefix" default="$(arg tf_prefix)/camera"/>
</include>

<include file="$(find ydlidar)/launch/lidar.launch" >
<arg name="car_name" value="$(arg car_name)" />
<arg name="tf_prefix" default="$(arg tf_prefix)"/>
Expand Down
40 changes: 0 additions & 40 deletions mushr_hardware/mushr_hardware/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,49 +14,9 @@
<!-- Commonly used license strings: -->
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
<license>TODO</license>


<!-- Url tags are optional, but multiple are allowed, one per tag -->
<!-- Optional attribute type can be: website, bugtracker, or repository -->
<!-- Example: -->
<!-- <url type="website">http://wiki.ros.org/mushr_hardware</url> -->


<!-- Author tags are optional, multiple are allowed, one per tag -->
<!-- Authors do not have to be maintainers, but could be -->
<!-- Example: -->
<!-- <author email="[email protected]">Jane Doe</author> -->


<!-- The *depend tags are used to specify dependencies -->
<!-- Dependencies can be catkin packages or system dependencies -->
<!-- Examples: -->
<!-- Use depend as a shortcut for packages that are both build and exec dependencies -->
<!-- <depend>roscpp</depend> -->
<!-- Note that this is equivalent to the following: -->
<!-- <build_depend>roscpp</build_depend> -->
<!-- <exec_depend>roscpp</exec_depend> -->
<!-- Use build_depend for packages you need at compile time: -->
<!-- <build_depend>message_generation</build_depend> -->
<!-- Use build_export_depend for packages you need in order to build against this package: -->
<!-- <build_export_depend>message_generation</build_export_depend> -->
<!-- Use buildtool_depend for build tool packages: -->
<!-- <buildtool_depend>catkin</buildtool_depend> -->
<!-- Use exec_depend for packages you need at runtime: -->
<!-- <exec_depend>message_runtime</exec_depend> -->
<!-- Use test_depend for packages you need only for testing: -->
<!-- <test_depend>gtest</test_depend> -->
<!-- Use doc_depend for packages you need only for building documentation: -->
<!-- <doc_depend>doxygen</doc_depend> -->
<buildtool_depend>catkin</buildtool_depend>
<exec_depend>realsense2_camera</exec_depend>
<exec_depend>ydlidar</exec_depend>
<exec_depend>push_button_utils</exec_depend>


<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- Other tools can request additional information be placed here -->

</export>
</package>
Loading