-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker_run.sh
More file actions
executable file
·44 lines (39 loc) · 1.62 KB
/
Copy pathdocker_run.sh
File metadata and controls
executable file
·44 lines (39 loc) · 1.62 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
#!/bin/bash
# Helper script to run Tinymovr ROS 2 in Docker
set -e
# Check if Docker is installed
if ! command -v docker &> /dev/null; then
echo "Docker is not installed. Install with:"
echo " curl -fsSL https://get.docker.com -o get-docker.sh"
echo " sudo sh get-docker.sh"
echo " sudo usermod -aG docker $USER"
exit 1
fi
# Check if docker compose is available (new) or docker-compose (old)
if docker compose version &> /dev/null; then
COMPOSE_CMD="docker compose"
elif command -v docker-compose &> /dev/null; then
COMPOSE_CMD="docker-compose"
else
echo "Docker Compose is not available."
echo "It should have been installed with Docker."
echo "Try: docker compose version"
exit 1
fi
echo "Starting ROS 2 Humble container..."
$COMPOSE_CMD up -d
echo ""
echo "Container started. To enter the container:"
echo " docker exec -it tinymovr_ros2 bash"
echo ""
echo "Once inside, build and run your robot:"
echo " apt update && apt install -y python3-pip python3-colcon-common-extensions iproute2 ros-humble-ament-package ros-humble-rosidl-typesupport-c ros-humble-rosidl-typesupport-cpp ros-humble-rosidl-default-generators ros-humble-ros2-control ros-humble-ros2-controllers ros-humble-xacro ros-humble-robot-state-publisher ros-humble-teleop-twist-keyboard"
echo " cd /workspace"
echo " source /opt/ros/humble/setup.bash"
echo " colcon build --packages-select tinymovr_ros"
echo " source install/setup.bash"
echo " # Set up CAN (from inside container)"
echo " ip link set can0 type can bitrate 1000000"
echo " ip link set up can0"
echo " # Launch"
echo " ros2 launch tinymovr_ros my_robot.launch.py"