-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
63 lines (50 loc) · 2.36 KB
/
justfile
File metadata and controls
63 lines (50 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
set shell := ["zsh", "-c"]
setup: install-git-filters rosdep build
install-git-filters:
# Install git filters
# The vscode settings file gets updated by the ros extension and contains the full path to the current user's home directory.
# We don't want to commit this path, so we use a git filter to remove it when git adds the file to the staging area.
# This does not affect the file on disk, so vscode will still work as expected.
git config filter.removeFullHomePath.clean "sed '/\/\(home\|root\).*\(install\|build\)/d'"
rosdep:
# Initialize rosdep if not already done
[ -f /etc/ros/rosdep/sources.list.d/20-default.list ] || sudo rosdep init
# Update rosdep and install dependencies from meta directory
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y
clean:
# Clean the workspace
# This removes all build, install, and log directories
rm -rf build/ install/ log/
clean-robot ip:
# Clean the workspace on the robot with the given IP address
ssh ubuntu@{{ip}} "cd /home/ubuntu/rpc_workspace && rm -rf build/ install/ log/"
build:
# Build the workspace
. /opt/ros/humble/setup.zsh
colcon build --symlink-install --continue-on-error
_build-robot ip:
# Run the build command on the robot
ssh ubuntu@{{ip}} "cd /home/ubuntu/rpc_workspace && . /opt/ros/$ROS_DISTRO/setup.bash && colcon build --symlink-install --continue-on-error"
build-package package:
# Build a specific package in the workspace
. /opt/ros/humble/setup.zsh
colcon build --symlink-install --packages-select {{package}}
sync ip:
# Sync the workspace to a robot with the given IP address
# Copy this repository to the robot
rsync --delete -av --exclude='.git' --exclude='install' --exclude='build' --exclude='log' . ubuntu@{{ip}}:/home/ubuntu/rpc_workspace/
deploy ip: (sync ip) (_build-robot ip)
deploy-clean ip: (clean-robot ip) (deploy ip)
connect ip:
# Restart the zenoh bridge on the robot with the given IP address. This is currently a hack, as sometimes the bridge needs a restart somehow.
ssh ubuntu@{{ip}} "sudo systemctl restart zenoh-bridge.service"
# Start a zenoh connection to the specified IP address
zenoh-bridge-ros2dds -e tcp/{{ip}}:7447
# Stop the ros2 deamon, so we realistic topics when we run `ros2 topic list`
ros2 daemon stop
source:
# Source the ROS 2 environment
. /opt/ros/humble/setup.zsh
# Source the workspace setup file
. install/setup.zsh