-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts for connecting and flashing to robots
- Loading branch information
1 parent
8c14997
commit 87a733d
Showing
4 changed files
with
37 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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 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,28 @@ | ||
#!/usr/bin/bash | ||
|
||
# Build the source code and flash it to a robot via the dev container. | ||
# This script is useful if you are unable to use the dev container during | ||
# development; for example, if using an IDE that does not support them. | ||
# | ||
# Syntax: scripts/build_and_flash.sh [SSH destination] [scons arguments] | ||
|
||
if [ ! -d "ut-robomaster" ]; then | ||
echo "ut-robomaster not found. Please run from the repository folder" | ||
exit 1 | ||
fi | ||
|
||
run_cmd=" | ||
~/.local/bin/scons build ${@:2} && | ||
cd .. && | ||
scripts/connect_to_robot.sh $1 && | ||
cd ut-robomaster && | ||
~/.local/bin/scons run ${@:2} | ||
" | ||
|
||
podman run -it --rm \ | ||
--userns=keep-id:uid=1000,gid=1000 \ | ||
--security-opt label=disable \ | ||
-v .:/code \ | ||
-w /code/ut-robomaster \ | ||
ghcr.io/ut-ras/robomaster-firmware \ | ||
sh -c "$run_cmd" |
This file contains 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,8 @@ | ||
#!/usr/bin/bash | ||
echo "Attempting connection to [$1]..." | ||
if ssh -fF ssh.config $1 sleep 15; then | ||
echo "Connected" | ||
else | ||
echo "Connection failed" | ||
exit 1 | ||
fi |