Skip to content

Devanthro/csi_camera

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSI-Camera ROS2 nodes

Implementation of ROS2 nodes to publish CSI camera images from Nvidia Jetson as sensor_msgs/CompressedImage based on https://github.com/JetsonHacksNano/CSI-Camera.

Usage

ros2 run csi_camera simple_camera # to publish images from sensor_id=0
# or
ros2 run csi_camera dual_camera # to publish images from both cameras

I added the additional ros2 humble hawksbill packages h264_package, h265_package and h265_dual_package. These make use of the H264 / H65 videocodec for hardware encoding. When you extract them to you your packages folder on your ros humble hawksbill directory, you are able to use them by executing the following steps:

  1. First go to the directory
cd ros2_humble
  1. If you’re package hasn’t been build yet, do so
~/ros2_humble$ source colcon build --packages-select my_camera_package_h265 (or h264)
  1. Then source it
~/ros2_humble$ source /opt/ros/humble/local_setup.bash
  1. Now you open a new terminal which you also source. head within both terminals to src folder with
cd src
  1. Then type in one terminal
ros2 run my_camera_package_h265 camera_subscriber
  1. And in the other one
ros2 run my_camera_package_h265 camera_publisher

To see the data:

ros2 topic echo /image/left/image_compressed # sensor_id=0
ros2 topic echo /image/right/image_compressed

Docker setup

To grant access to CSI cameras inside a docker container running on Jetson Xavier, run docker with the following arguments:

 docker run --gpus all -e NVIDIA_REQUIRE_JETPACK="csv-mounts=all" --runtime nvidia --name YOUR_NAME -ti --privileged -v /dev:/dev -v /tmp/argus_socket:/tmp/argus_socket --network host YOUR_IMAGE_ID /bin/bash

Docker used is based on https://github.com/dusty-nv/jetson-containers, specifically foxy-ros-base-l4t-r32.7.1.

About

ROS2 nodes to publish Nvidia Jetson CSI camera images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages