Skip to content

Commit

Permalink
feat: add gazebo documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
BarisYazici committed Jun 27, 2024
1 parent 75cc344 commit 2ab7774
Showing 1 changed file with 102 additions and 6 deletions.
108 changes: 102 additions & 6 deletions source/franka_ros2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,108 @@ This package contains a modified joint_trajectory_controller that can use the ef
`ros2_controllers <https://github.com/ros-controls/ros2_controllers/tree/master/joint_trajectory_controller>`_ master branch.
As soon as, it's backported to Humble, it will be deleted from franka_ros2 repository.


franka_gazebo
^^^^^^^^^^^^^

.. important::

Minimum necessary `franka_description` version is 0.3.0.
You can clone franka_description package from https://github.com/frankaemika/franka_description.

A project integrating Franka ROS 2 with the Gazebo simulator.

Launch RVIZ + Gazebo
""""""""""""""""""""

Launch an example which spawns RVIZ and Gazebo showing the robot:


.. code-block:: shell
ros2 launch franka_gazebo_bringup visualize_franka_robot.launch.py
If you want to display another robot, you can define the arm_id:

.. code-block:: shell
ros2 launch franka_gazebo_bringup visualize_franka_robot.launch.py arm_id:=fp3
If you want to start the simulation including the franka_hand:

.. code-block:: shell
ros2 launch franka_gazebo_bringup visualize_franka_robot.launch.py load_gripper:=true franka_hand:='franka_hand'
Joint Velocity Control Example with Gazebo
""""""""""""""""""""""""""""""""""""""""""

Before starting, be sure to build `franka_example_controllers` and `franka_description` packages.
`franka_description` must have the minimum version of 0.3.0.


.. code-block:: shell
colcon build --packages-select franka_example_controllers
Now you can launch the velocity example with Gazebo simulator.

.. code-block:: shell
ros2 launch franka_gazebo_bringup gazebo_joint_velocity_controller_example.launch.py load_gripper:=true franka_hand:='franka_hand'
Keep in mind that the gripper joint has a bug with the joint velocity controller.
If you are interested in controlling the gripper please use joint position interface.


Joint Position Control Example with Gazebo
""""""""""""""""""""""""""""""""""""""""""

To run the joint position control example you need to have the required software listed in the joint velocity control section.

Then you can run with the following command.

.. code-block:: shell
ros2 launch franka_gazebo_bringup gazebo_joint_position_controller_example.launch.py load_gripper:=true franka_hand:='franka_hand'
Joint Impedance Control Example with Gazebo
""""""""""""""""""""""""""""""""""""""""""""""

For running torque example. You must compile the `franka_ign_ros2_control` package located under `franka_gazebo`.
You can compile `franka_ign_ros2_control` with the following command.

.. code-block:: shell
colcon build --packages-select franka_ign_ros2_control
Then source your workspace.

.. code-block:: shell
source install/setup.sh
Then you can run the impedance control example.

.. code-block:: shell
ros2 launch franka_gazebo_bringup gazebo_joint_impedance_controller_example.launch.py load_gripper:=true franka_hand:='franka_hand'
Throubleshooting
""""""""""""""""

If you experience that Gazebo can't find your model files, try to include the workspace. E.g.


.. code-block:: shell
export GZ_SIM_RESOURCE_PATH=${GZ_SIM_RESOURCE_PATH}:/workspaces/src/
Differences between franka_ros and franka_ros2
----------------------------------------------

Expand All @@ -577,12 +679,6 @@ franka_gripper

* All actions (apart from the ``gripper_action``) have the current gripper width as feedback.

franka_gazebo
^^^^^^^^^^^^^

Currently, we do not offer a Gazebo integration with ``franka_ros2``. However, we provide one
with :doc:`franka_ros`.

franka_visualization
^^^^^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit 2ab7774

Please sign in to comment.