=========================================== Isaac ROS AprilTag ``ros1_bridge`` Tutorial =========================================== Overview --------- This tutorial walks you through a graph to estimate the 6DOF pose of AprilTags using :ir_repo:`isaac_ros_apriltag ` running ROS 2 and a ROS 1 rosbag containing images. The image data will be published from the ROS 1 bag and sent to ROS 2 for computation and the tag detections result will be visualized in ROS 1 using the command line ``rostopic echo`` tool. .. figure:: :ir_lfs:`` :width: 800px :align: center Tutorial Walkthrough -------------------- 1. Complete the quickstart :ref:`here `. 2. Complete the :doc:`Isaac ROS ros1_bridge Setup Guide `. 3. Pull down a ROS 1 rosbag of sample data: .. code:: bash cd $ISAAC_ROS_WS/src/isaac_ros_apriltag && \ git lfs pull -X "" -I "resources/rosbags/ros1_bridge_apriltag.bag" 4. Launch the Docker container using the ``run_dev.sh`` script: .. code:: bash cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh ${HOME}/workspaces 5. There is currently a bug that causes a .catkin file to be generated by the ``ros2_humble`` build which uses the --merge-install flag. So manually remove the .catkin file: .. code:: bash sudo rm /opt/ros/humble/install/.catkin .. note:: You will have to remove this file every time a new Isaac ROS docker container is created. But you do not have to do this step when attaching to an already running Docker container 6. Inside the container, build the ROS 2 workspace expect ``ros1_bridge``: .. code:: bash source /opt/ros/humble/setup.bash && \ cd /workspaces/isaac_ros-dev/isaac_ros-dev && \ colcon build --symlink-install --packages-skip ros1_bridge 7. **Attach a second terminal** to the container: .. code:: bash cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh ${HOME}/workspaces .. note:: Do NOT close the first terminal when you attach this second terminal to the container. 8. Inside the container, build and source the workspace: .. code:: bash source isaac_ros_1-dev/install_isolated/setup.bash && \ source isaac_ros-dev/install/setup.bash && \ cd /workspaces/isaac_ros-dev/isaac_ros-dev && \ colcon build --symlink-install --packages-select ros1_bridge --cmake-force-configure && \ source install/setup.bash && \ export ROS_MASTER_URI=http://localhost:11311 && \ ros2 run ros1_bridge dynamic_bridge --bridge-all-topics 9. **Attach a third terminal** to the container: .. code:: bash cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh ${HOME}/workspaces .. note:: Do NOT close the first terminal when you attach this second terminal to the container. 10. Source ``ros1_noetic`` and run ``roscore``: .. code:: bash source /opt/ros/noetic/setup.bash && \ roscore 11. **Attach a fourth terminal** to the Docker container: .. code:: bash cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh ${HOME}/workspaces 12. Play the ROS1 rosbag in a loop: .. code:: bash source /opt/ros/noetic/setup.bash && \ cd /workspaces/isaac_ros-dev/isaac_ros-dev/src/isaac_ros_apriltag/resources/rosbags && \ rosbag play -l ros1_bridge_apriltag.bag 13. **Attach a fifth terminal** to the Docker container: .. code:: bash cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh ${HOME}/workspaces 14. Run the ``isaac_ros_apriltag`` node: .. code:: bash cd /workspaces/isaac_ros-dev/isaac_ros-dev && \ source install/setup.bash && \ ros2 launch isaac_ros_apriltag isaac_ros_apriltag.launch.py 15. **Attach a sixth terminal** to the Docker container: .. code:: bash cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh ${HOME}/workspaces 16. Use ``rostopic echo`` to print the tag detections in ROS 1 : .. code:: bash cd /workspaces/isaac_ros-dev/isaac_ros_1-dev && \ source install_isolated/setup.bash && \ rostopic echo /tag_detections .. figure:: :ir_lfs:`` :width: 800px :align: center