-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add hardware and sim Docker * Fix hardware docker * Fixes * Use packages-up-to * Add description to compose
- Loading branch information
1 parent
678324d
commit 9c3307c
Showing
10 changed files
with
137 additions
and
64 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 |
---|---|---|
@@ -1,2 +1 @@ | ||
SERIAL_PORT=/dev/ttyUSB0 | ||
ROS_NAMESPACE=robot1 | ||
ROBOT_NAMESPACE=rosbot |
This file was deleted.
Oops, something went wrong.
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,34 @@ | ||
ARG ROS_DISTRO=humble | ||
|
||
FROM husarnet/ros:${ROS_DISTRO}-ros-core | ||
|
||
WORKDIR /ros2_ws | ||
|
||
ENV HUSARION_ROS_BUILD_TYPE=hardware | ||
|
||
COPY .. src/rosbot_ros | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
python3-pip \ | ||
ros-dev-tools \ | ||
stm32flash \ | ||
ros-${ROS_DISTRO}-teleop-twist-keyboard && \ | ||
# Setup workspace | ||
vcs import src < src/rosbot_ros/rosbot/rosbot_hardware.repos && \ | ||
rm -r src/rosbot_ros/rosbot_gazebo && \ | ||
# Install dependencies | ||
rosdep init && \ | ||
rosdep update --rosdistro $ROS_DISTRO && \ | ||
rosdep install --from-paths src -y -i && \ | ||
# Build | ||
source /opt/ros/$ROS_DISTRO/setup.bash && \ | ||
colcon build --symlink-install --packages-up-to rosbot --cmake-args -DCMAKE_BUILD_TYPE=Release && \ | ||
# Get version | ||
echo $(cat /ros2_ws/src/rosbot/package.xml | grep '<version>' | sed -r 's/.*<version>([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') >> /version.txt && \ | ||
# Size optimization | ||
export SUDO_FORCE_REMOVE=yes && \ | ||
apt-get remove -y \ | ||
ros-dev-tools && \ | ||
apt-get autoremove -y && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* |
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,35 @@ | ||
ARG ROS_DISTRO=humble | ||
|
||
FROM husarnet/ros:${ROS_DISTRO}-ros-core | ||
|
||
WORKDIR /ros2_ws | ||
|
||
ENV HUSARION_ROS_BUILD_TYPE=simulation | ||
|
||
COPY .. src/rosbot_ros | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
python3-pip \ | ||
ros-dev-tools \ | ||
stm32flash \ | ||
ros-${ROS_DISTRO}-teleop-twist-keyboard && \ | ||
# Setup workspace | ||
vcs import src < src/rosbot_ros/rosbot/rosbot_hardware.repos && \ | ||
vcs import src < src/rosbot_ros/rosbot/rosbot_simulation.repos && \ | ||
cp -r src/ros2_controllers/imu_sensor_broadcaster src && rm -rf src/ros2_controllers && \ | ||
# Install dependencies | ||
rosdep init && \ | ||
rosdep update --rosdistro $ROS_DISTRO && \ | ||
rosdep install --from-paths src -y -i && \ | ||
# Build | ||
source /opt/ros/$ROS_DISTRO/setup.bash && \ | ||
colcon build --symlink-install --packages-up-to rosbot --cmake-args -DCMAKE_BUILD_TYPE=Release && \ | ||
# Get version | ||
echo $(cat /ros2_ws/src/rosbot/package.xml | grep '<version>' | sed -r 's/.*<version>([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') >> /version.txt && \ | ||
# Size optimization | ||
export SUDO_FORCE_REMOVE=yes && \ | ||
apt-get remove -y \ | ||
ros-dev-tools && \ | ||
apt-get autoremove -y && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* |
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,22 @@ | ||
# Quick Start | ||
# | ||
# 1. Run `docker compose -f compose.hardware.yaml up` on the ROSbot | ||
# 2. Open a shell inside a docker container `docker compose -f compose.hardware.yaml exec -it rosbot bash` | ||
# 3. Run `ros2 run teleop_twist_keyboard teleop_twist_keyboard` inside the container | ||
|
||
services: | ||
rosbot: | ||
build: | ||
context: .. | ||
dockerfile: docker/Dockerfile.hardware | ||
network_mode: host | ||
ipc: host | ||
restart: unless-stopped | ||
devices: | ||
- ${SERIAL_PORT:-/dev/ttyUSB0} | ||
- /dev/bus/usb/ # FTDI | ||
command: > | ||
ros2 launch rosbot_bringup combined.launch.py | ||
mecanum:=${MECANUM:-False} | ||
namespace:=${ROBOT_NAMESPACE:-rosbot} | ||
serial_port:=${SERIAL_PORT:-/dev/ttyUSB0} |
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,32 @@ | ||
# Quick Start | ||
# | ||
# 1. Run `xhost +local:docker && docker compose -f compose.simulation.yaml up` on the laptop | ||
# (optionally you can chang `gpu-config` -> `cpu config`). | ||
# 2. Open a shell inside a docker container `docker compose -f compose.simulation.yaml exec -it rosbot bash` | ||
# 3. Run `ros2 run teleop_twist_keyboard teleop_twist_keyboard` inside the container | ||
|
||
x-gpu-config: | ||
&gpu-config | ||
runtime: nvidia | ||
environment: | ||
- DISPLAY=${DISPLAY:?err} | ||
- NVIDIA_VISIBLE_DEVICES=all | ||
- NVIDIA_DRIVER_CAPABILITIES=all | ||
|
||
x-cpu-config: | ||
&cpu-config | ||
environment: | ||
- DISPLAY=${DISPLAY:?err} | ||
|
||
services: | ||
rosbot: | ||
build: | ||
context: .. | ||
dockerfile: docker/Dockerfile.simulation | ||
network_mode: host | ||
ipc: host | ||
<<: [ *gpu-config] | ||
command: > | ||
ros2 launch rosbot_gazebo simulation.launch.py | ||
mecanum:=${MECANUM:-False} | ||
namespace:=${ROBOT_NAMESPACE:-rosbot} |
This file was deleted.
Oops, something went wrong.
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