diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 502831e788..9591e78bc9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,9 +17,9 @@ jobs: htmlproofer: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.8' cache: 'pip' @@ -53,7 +53,7 @@ jobs: container: image: ${{ matrix.container }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: 'main' @@ -77,7 +77,7 @@ jobs: run: tar cvzf artifact.tar.gz --directory=build/html . - name: Upload HTML Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v7 with: name: '${{ matrix.branch }}_html_artifacts' path: artifact.tar.gz @@ -86,12 +86,12 @@ jobs: runs-on: ubuntu-latest needs: upload_site_artifacts steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 ref: 'main' - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v6 with: python-version: '3.10' cache: 'pip' @@ -110,7 +110,7 @@ jobs: # TODO (peterdavidfagan): don't hardcode branches for downloads - name: Download Rolling Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v7 with: name: main_html_artifacts path: . @@ -122,7 +122,7 @@ jobs: rm artifact.tar.gz - name: Download Humble Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v7 with: name: humble_html_artifacts path: . @@ -144,7 +144,7 @@ jobs: cp -rf python_api/ build/html/main/doc/api/ # restore artifact html - name: Upload pages artifact - uses: actions/upload-pages-artifact@v2 + uses: actions/upload-pages-artifact@v4 if: github.repository_owner == 'ros-planning' with: path: build/html @@ -159,4 +159,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v2 + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index fee55c15d3..43f831a0f1 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -19,8 +19,8 @@ jobs: name: Format runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: '3.10' - name: Install clang-format-14 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 01288066c4..e0ae43687e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 22.6.0 hooks: - id: black diff --git a/doc/how_to_guides/isaac_panda/isaac_panda_tutorial.rst b/doc/how_to_guides/isaac_panda/isaac_panda_tutorial.rst index b591018313..1b0c909cc0 100644 --- a/doc/how_to_guides/isaac_panda/isaac_panda_tutorial.rst +++ b/doc/how_to_guides/isaac_panda/isaac_panda_tutorial.rst @@ -1,4 +1,142 @@ How To Command Simulated Isaac Robot ==================================== -This How To Guide has been moved, please see the `updated tutorial `_. +This tutorial requires a machine with ``Isaac Sim 4.5`` (recommended) or higher installed. +For Isaac Sim requirements and installation please see the `Omniverse documentation `_. +To configure Isaac Sim to work with ROS 2 please see `this guide `_. + +This tutorial has the following assumptions on system configuration: + +1. NVIDIA Isaac Sim is installed in the default location. Docker based installations of Isaac sim are also supported but it is up to the user to configure the system. +2. Docker is installed. + If you plan to use your GPU with MoveIt, you will need to install `nvidia-docker `_. +3. You clone this repo so that you can build a Ubuntu 22.04 Humble based Docker image that can communicate with Isaac and run this tutorial. + +Introduction to ros2_control +---------------------------- + +One of the recommended ways to execute trajectories calculated by MoveIt is to use the `ros2_control `_ +framework to manage and communicate with your robot, real or simulated. It comes highly recommended because it offers a developers a common API that +allows your software to switch between many different robot types, and the sensors they have built in, by simply changing some launch arguments. +For example if we inspect the Panda Robot's ``ros2_control.xacro`` we can see it uses a flag ``use_fake_hardware`` to switch between being +simulated or connecting to a physical robot. + +.. code-block:: XML + + + + mock_components/GenericSystem + + + franka_hardware/FrankaHardwareInterface + ${robot_ip} + + + + +`Hardware Components `_ +can be of different types, but the plugin ``mock_components/GenericSystem`` is very a simple ``System`` +that forwards the incoming ``command_interface`` values to the tracked ``state_interface`` of the joints (i.e., perfect control of the simulated joints). + +For us to expand our Panda robot to Isaac Sim we first have to introduce `topic_based_ros2_control `_. +This Hardware Interface is a ``System`` that subscribes and publishes on configured topics. +For this tutorial the topic ``/isaac_joint_states`` will contain the robot's current state and ``/isaac_joint_commands`` will be used to actuate it. +The `moveit_resources_panda_moveit_config `_ +we are using in this tutorial does not support connecting to hardware, so our ``ros2_control.xacro`` is now +updated to load the ``TopicBasedSystem`` plugin when the flag ``ros2_control_hardware_type`` is set to ``isaac``. + +.. code-block:: XML + + + mock_components/GenericSystem + + + topic_based_ros2_control/TopicBasedSystem + /isaac_joint_commands + /isaac_joint_states + + +In this tutorial we have included a Python script that loads a Panda robot +and builds an `OmniGraph `_ +to publish and subscribe to the ROS topics used to control the robot. +The OmniGraph also contains nodes to publish RGB and Depth images from the camera mounted on the hand of the Panda. +The RGB image is published to the topic ``/rgb``, the camera info to ``/camera_info``, and the depth image to ``/depth``. +The frame ID of the camera frame is ``/sim_camera``. +To learn about configuring your Isaac Sim robot to communicate with ROS 2 please see the +`Joint Control tutorial https://docs.isaacsim.omniverse.nvidia.com/latest/ros2_tutorials/tutorial_ros2_manipulation.html>`_ +on Omniverse. + +Computer Setup +-------------- + +1. Install `Isaac Sim `_. + +2. Perform a shallow clone of the MoveIt 2 Tutorials repo. + +.. code-block:: bash + + git clone https://github.com/moveit/moveit2_tutorials.git -b main + +3. Go to the folder in which you cloned the tutorials and then switch to the following directory. + +.. code-block:: bash + + cd moveit2_tutorials/doc/how_to_guides/isaac_panda + +4. Build the Docker image. This docker image also contains ``pytorch``. + +.. code-block:: bash + + docker compose build base + + +Running the MoveIt Interactive Marker Demo with Mock Components +--------------------------------------------------------------- + +This section tests out the ``mock_components/GenericSystem`` hardware interface, as opposed to using Isaac Sim. + +1. To test out the ``mock_components/GenericSystem`` hardware interface run: + +.. code-block:: bash + + docker compose up demo_mock_components + +This will open up RViz with the Panda robot using ``mock_components`` to simulate the robot and execute trajectories. + +Please see the :doc:`Quickstart in RViz ` +tutorial if this is your first time using MoveIt with RViz. + +After you are done testing press ``Ctrl+C`` in the terminal to stop the container. + +Running the MoveIt Interactive Marker Demo with Isaac Sim +--------------------------------------------------------- + +1. On the host computer, go to the tutorials launch directory. + +.. code-block:: bash + + cd moveit2_tutorials/doc/how_to_guides/isaac_panda/launch + +2. Then run the following command to load the Panda Robot pre-configured to work with this tutorial. + +.. note:: This step assumes that a compatible version of Isaac Sim is installed on the host in the ``$HOME/isaacsim`` directory for Isaac Sim 4.5 or in the ``$HOME/.local/share/ov/pkg/`` directory for Isaac Sim 4.2 and older. + This step also takes a few minutes to download the assets and setup Isaac Sim so please be + patient and don't click the ``Force Quit`` dialog that pops up while the simulator starts. + +.. code-block:: bash + + ./python.sh isaac_moveit.py + +3. From the ``moveit2_tutorials/doc/how_to_guides/isaac_panda`` directory start a container that connects to Isaac Sim using the ``topic_based_ros2_control/TopicBasedSystem`` hardware interface. + +.. code-block:: bash + + docker compose up demo_isaac + +This will open up RViz with the Panda robot using the ``TopicBasedSystem`` interface to communicate with the simulated robot and execute trajectories. + +.. raw:: html + +
+ +