Tutorial for AprilTag Detection with a USB Camera#

https://media.githubusercontent.com/media/NVIDIA-ISAAC-ROS/.github/release-4.0/resources/isaac_ros_docs/concepts/fiducials/apriltag/rviz_usb_cam.png/

Overview#

This tutorial walks you through a graph to estimate the 6DOF pose of AprilTags using images streamed from a USB camera.

Tutorial Walkthrough#

  1. Complete the Isaac ROS AprilTag Quickstart section.

  2. Calibrate the camera following instructions in the camera calibration tutorial. For step 11, use isaac_ros_apriltag in place of <isaac_ros_package>

  3. Install the ROS 2 usb_cam package

    sudo apt-get install -y ros-jazzy-usb-cam
    
  4. Activate the Isaac ROS environment:

    isaac-ros activate
    
  5. Finally, launch the provided launch file:

    Warning

    Make sure to set the camera_width and camera_height arguments based on your camera’s resolution.

    ros2 launch isaac_ros_apriltag isaac_ros_apriltag_usb_cam.launch.py camera_width:=1280 camera_height:=720
    
  6. Launch a second terminal inside the container

    isaac-ros activate
    
  7. Run RViz2 using the preset config file

    rviz2 -d $(ros2 pkg prefix isaac_ros_apriltag --share)/rviz/usb_cam.rviz
    

Note

Your camera vendor may offer a specific ROS 2-compatible camera driver package and you can use that in place of the usb_cam package.

Warning

If you are using a different camera driver package ensure that the camera stream publishes Image and CameraInfo pairs to the topics /image and /camera_info, respectively.