File tree 6 files changed +70
-10
lines changed
6 files changed +70
-10
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"template" : " https://github.com/UrbanMachine/create-ros-app.git" ,
3
- "commit" : " 3d4731e5661e8cbac11d71c60c8e925a989c150c " ,
3
+ "commit" : " 93e541631403e2c2c091c65d6583d61bd85a472c " ,
4
4
"checkout" : null ,
5
5
"context" : {
6
6
"cookiecutter" : {
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ services:
38
38
DISPLAY : $DISPLAY
39
39
# Necessary for PulseAudio passthrough
40
40
PULSE_SERVER : " unix:/pulse-socket"
41
+ # Enable serial passthrough
42
+ privileged : true
41
43
# Gives the container access to kernel capabilities, useful for most robots
42
44
network_mode : host
43
45
cap_add :
Original file line number Diff line number Diff line change @@ -71,4 +71,27 @@ function deploy_and_wait {
71
71
done
72
72
echo " Another process brought down the stack." >&2
73
73
return 1
74
+ }
75
+
76
+ # Shows the user the available launch profiles
77
+ function launch_profiles_helper_msg {
78
+ echo " Available launch profiles are:" >&2
79
+ # shellcheck disable=SC2012
80
+ ls -1 launch-profiles/ | sed ' s/^/ - /' >&2
81
+ echo " " >&2
82
+ echo " Read more about 'launch-profiles' under 'docs/about_template.md'" >&2
83
+ exit 1
84
+ }
85
+
86
+ # Inform the user that the chosen launch profile is invalid if it is not a directory
87
+ function validate_launch_profile {
88
+ local chosen_profile
89
+ chosen_profile=" $1 "
90
+
91
+ # Check if the chosen profile is a directory under 'launch-profiles'
92
+ if [[ ! -d " launch-profiles/${chosen_profile} " ]]; then
93
+ echo " Error: '${chosen_profile} ' is not a valid launch profile." >&2
94
+ echo " It should be a directory under 'launch-profiles/'." >&2
95
+ launch_profiles_helper_msg
96
+ fi
74
97
}
Original file line number Diff line number Diff line change @@ -24,14 +24,11 @@ set -o errexit
24
24
set -o pipefail
25
25
set -o nounset
26
26
27
+ source docker/_shared.sh
28
+
27
29
function usage {
28
30
echo " Usage: docker/launch [--no-pull] <launch-profile>" >&2
29
- echo " Available launch profiles are:" >&2
30
- # shellcheck disable=SC2012
31
- ls -1 launch-profiles/ | sed ' s/^/ - /' >&2
32
- echo " " >&2
33
- echo " Read more about 'launch-profiles' under 'docs/about_template.md'" >&2
34
- exit 1
31
+ launch_profiles_helper_msg
35
32
}
36
33
37
34
function main {
@@ -64,9 +61,7 @@ function main {
64
61
echo " Missing <launch_profile> argument, specify a directory under 'launch-profiles/'" >&2
65
62
usage
66
63
fi
67
-
68
- source docker/_shared.sh
69
-
64
+ validate_launch_profile " ${launch_profile} "
70
65
71
66
# To reduce downtime, build the latest images before stopping any existing stacks.
72
67
if [[ " ${pull_upstream_images} " = true ]]; then
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # Builds and re-runs the ROS nodes container. This is useful if you want to restart
4
+ # the container over and over, oftentimes when developing on you ROS code.
5
+ # The container is only re-run if the image has changed.
6
+ #
7
+ # Usage:
8
+ # docker/reload-ros-nodes <launch-profile>
9
+ #
10
+ # Examples:
11
+ # docker/reload-ros-nodes node_helpers_showcase
12
+
13
+ set -o errexit
14
+ set -o pipefail
15
+ set -o nounset
16
+
17
+ source docker/_shared.sh
18
+
19
+ function main {
20
+ local launch_profile
21
+ launch_profile=" ${1:- } "
22
+
23
+ if [[ -z " ${launch_profile} " ]]; then
24
+ echo " Missing <launch_profile> argument, specify a directory under 'launch-profiles/'" >&2
25
+ echo " Usage: docker/reload-ros-nodes <launch-profile>" >&2
26
+ launch_profiles_helper_msg
27
+ fi
28
+ validate_launch_profile " ${launch_profile} "
29
+
30
+ build_images # Build any images that need to be built
31
+ enable_display_passthrough # Enable passthrough for the stack
32
+
33
+ export LAUNCH_PROFILE=" ${launch_profile} "
34
+ docker compose up -d --force-recreate ros-nodes
35
+ }
36
+
37
+ main " ${@ } "
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ Here's a quick guide on the features of this template
31
31
32
32
# Enter a currently running ROS container to poke around
33
33
docker/exec
34
+
35
+ # Rebuild and restart the ROS nodes in the container, useful for fast development
36
+ docker/reload-ros-nodes
34
37
```
35
38
36
39
More usage examples for the above scripts are documented at the top of the script files.
You can’t perform that action at this time.
0 commit comments