Skip to content

Commit

Permalink
📦 Ported over to ROS 2 Jazzy Jalisco. Verified with local running wit…
Browse files Browse the repository at this point in the history
…h jazzy-enable Docker image and container.
  • Loading branch information
cardboardcode committed May 30, 2024
1 parent efa33f9 commit ccfb0cd
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codecov_ci_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
codecov_ci:
runs-on: ubuntu-latest
container:
image: ros:humble-perception-jammy
image: ros:jazzy-perception-noble
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/industrial_ci_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
strategy:
matrix:
env:
- {ROS_DISTRO: humble, ROS_REPO: testing}
- {ROS_DISTRO: humble, ROS_REPO: main}
- {ROS_DISTRO: jazzy, ROS_REPO: testing}
- {ROS_DISTRO: jazzy, ROS_REPO: main}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: 'ros-industrial/industrial_ci@master'
env: ${{matrix.env}}
env: ${{matrix.env}}
7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
FROM ros:humble-perception-jammy
FROM ros:jazzy-perception-noble

MAINTAINER Bey Hao Yun <[email protected]>

# Add user
RUN adduser --quiet --disabled-password user

# Install OpenCV
RUN apt-get update && \
apt-get install -y xauth xxd x11-xserver-utils && \
rm -rf /var/lib/apt/lists/*

USER user

WORKDIR /home/user
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A ROS2 package that **simulates a camera**, providing ROS messages from **playin
## **Dependencies**

1. [OpenCV](https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html)
2. ROS2 [Humble Hawksbill](https://docs.ros.org/en/humble/Installation.html)
2. ROS2 [Jazzy Jalisco](https://docs.ros.org/en/jazzy/Installation.html)

## **Setup** :hammer:

Expand All @@ -21,7 +21,7 @@ A ROS2 package that **simulates a camera**, providing ROS messages from **playin
cd $HOME
git clone https://github.com/cardboardcode/virtual_camera.git --branch humble_devel --single-branch --depth 1
cd ~/virtual_camera
source /opt/ros/humble/setup.bash
source /opt/ros/jazzy/setup.bash
colcon build
```

Expand Down Expand Up @@ -77,7 +77,7 @@ This section is for **users who do not want to worry about installing all depend
**Build** the docker image.

```bash
docker build --tag vcam_image:humble .
docker build --tag vcam_image:jazzy .
```

**Run** the docker image.
Expand All @@ -89,14 +89,14 @@ xhost +local:docker
docker run -it \
--ipc host \
--net host \
--name vcam_humble_test_container \
--name vcam_jazzy_test_container \
-v $(pwd):/home/user/virtual_camera \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-u 1000 \
vcam_image:humble /bin/bash
vcam_image:jazzy /bin/bash

# For subsequent run.
docker start vcam_humble_test_container && docker exec -it vcam_humble_test_container bash
docker start vcam_jazzy_test_container && docker exec -it vcam_humble_test_container bash

```
4 changes: 2 additions & 2 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ pip install -U colcon-lcov-result

# Install ROS 2 dependencies
rosdep update
rosdep install -y --from-paths ./ --ignore-src --rosdistro humble
rosdep install -y --from-paths ./ --ignore-src --rosdistro jazzy

# Build virtual_camera ROS 2 package
source /opt/ros/humble/setup.bash
source /opt/ros/jazzy/setup.bash
colcon build --symlink-install --cmake-args \
-DCMAKE_CXX_FLAGS='-fprofile-arcs -ftest-coverage' \
-DCMAKE_C_FLAGS='-fprofile-arcs -ftest-coverage'
Expand Down
2 changes: 1 addition & 1 deletion include/virtual_camera/image_viewer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <string>
#include <memory>

#include "cv_bridge/cv_bridge.h"
#include "cv_bridge/cv_bridge.hpp"
#include "rclcpp/rclcpp.hpp"
#include "std_msgs/msg/string.hpp"
#include "sensor_msgs/msg/image.hpp"
Expand Down
2 changes: 1 addition & 1 deletion include/virtual_camera/virtual_camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <functional>
#include <memory>

#include "cv_bridge/cv_bridge.h"
#include "cv_bridge/cv_bridge.hpp"
#include "rclcpp/rclcpp.hpp"
#include "std_msgs/msg/string.hpp"
#include "sensor_msgs/msg/image.hpp"
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

source /opt/ros/humble/setup.bash
source /opt/ros/jazzy/setup.bash
colcon build
2 changes: 1 addition & 1 deletion scripts/change_fps.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

source /opt/ros/foxy/setup.bash
source /opt/ros/jazzy/setup.bash

echo "Please input the FPS integer (1-200)"
read input
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_cov_report.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# Source local ROS2 distro
source /opt/ros/humble/setup.bash
source /opt/ros/jazzy/setup.bash

if [[ $1 == "update" ]]; then
sudo rm -r build/ install/ log/ lcov/
Expand Down
2 changes: 1 addition & 1 deletion scripts/run.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash

source /opt/ros/humble/setup.bash
source /opt/ros/jazzy/setup.bash
source install/setup.bash
ros2 run virtual_camera virtual_camera
2 changes: 1 addition & 1 deletion scripts/show_image.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/env bash

source /opt/ros/humble/setup.bash
source /opt/ros/jazzy/setup.bash
source install/setup.bash
ros2 launch virtual_camera showimageraw.launch.py use_image_viewer:=true
2 changes: 1 addition & 1 deletion test/image_viewer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <memory>
#include <functional>

#include "cv_bridge/cv_bridge.h"
#include "cv_bridge/cv_bridge.hpp"
#include "rclcpp/rclcpp.hpp"
#include "std_msgs/msg/string.hpp"
#include "sensor_msgs/msg/image.hpp"
Expand Down
2 changes: 1 addition & 1 deletion test/virtual_camera_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <memory>
#include <functional>

#include "cv_bridge/cv_bridge.h"
#include "cv_bridge/cv_bridge.hpp"
#include "rclcpp/rclcpp.hpp"
#include "std_msgs/msg/string.hpp"
#include "sensor_msgs/msg/image.hpp"
Expand Down

0 comments on commit ccfb0cd

Please sign in to comment.