Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates on the gravity compensation and troubleshooting #15

Merged
merged 4 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 52 additions & 52 deletions docs/ros2_packages/gravity_compensation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,62 @@ This feature is useful when we use the arm as a teleoperation remote or when we

Currently supported arms include: WidowX-250 6DOF and ALOHA WidowX-250 6DOF.

Structure
=========

.. image:: images/xsarm_gravity_compensation_flowchart_ros2.png
:align: center

As shown above, the `interbotix_xsarm_gravity_compensation` package builds on top of the `interbotix_xsarm_control` package whose details are given :doc:`here <./arm_control>`.

This package contains a single node called **gravity_compensation**.
It subscribes to the ``/<robot_name>/joint_states`` topic, computes and publishes the desired current commands to the ``/<robot_name>/commands/joint_group`` topic.
Please refer to the `interbotix_gravity_compensation`_ repository for more details on its derivations and implementation.

.. _`interbotix_gravity_compensation`: https://github.com/Interbotix/interbotix_ros_toolboxes/tree/humble/interbotix_common_toolbox/interbotix_gravity_compensation

Usage
=====

Run the following launch command, assuming the Aloha WidowX-250 arm is being used:

.. code-block:: console

$ ros2 launch interbotix_xsarm_gravity_compensation interbotix_gravity_compensation.launch.py robot_model:=aloha_wx250s

It runs the ``gravity_compensation`` node and launches the ``xsarm_control`` script to bring up the arm.

Then, enable/disable the gravity compensation with the following service call:

.. code-block:: console

$ ros2 service call /aloha_wx250s/gravity_compensation_enable std_srvs/srv/SetBool 'data: [true/false]'

The arm will hold itself against gravity and can be moved freely when the gravity compensation is enabled.
It will lock in its current position when the gravity compensation is disabled.

.. warning::

The arm WILL torque off and drop for a short period of time while enabling/disabling.
Please make sure it is in a resting position or manually held.

.. warning::

The joints not supporting current control WILL torque off.
Please make sure to use an arm with at least the first three joints supporting current control, e.g., RX, WX, VX series.

This is the bare minimum needed to get up and running. Take a look at the table below to see how to further customize with other launch file arguments.

.. csv-table::
:file: ../_data/gravity_compensation.csv
:header-rows: 1
:widths: 20, 60, 20, 20

Configuration
=============

The **motor_specs.yaml** contains the motor specifications and options for motor assistance and dithering.
A template file is given below
Please check out the template file below for more details.

.. code-block:: yaml

Expand Down Expand Up @@ -114,54 +165,3 @@ A template file is given below

Excessive dithering WILL cause heat and wear on the joints.
Please use it with caution.

Structure
=========

.. image:: images/xsarm_gravity_compensation_flowchart_ros2.png
:align: center

As shown above, the `interbotix_xsarm_gravity_compensation` package builds on top of the `interbotix_xsarm_control` package whose details are given :doc:`here <./arm_control>`.

This package contains a single node called **gravity_compensation**.
It subscribes to the ``/<robot_name>/joint_states`` topic, computes and publishes the desired current commands to the ``/<robot_name>/commands/joint_group`` topic.
Please refer to the `interbotix_gravity_compensation`_ repository for more details on its derivations and implementation.

.. _`interbotix_gravity_compensation`: https://github.com/Interbotix/interbotix_ros_toolboxes/tree/humble/interbotix_common_toolbox/interbotix_gravity_compensation

Usage
=====

Run the following launch command, assuming the Aloha WidowX-250 arm is being used:

.. code-block:: console

$ ros2 launch interbotix_xsarm_gravity_compensation interbotix_gravity_compensation.launch.py robot_model:=aloha_wx250s

It runs the ``gravity_compensation`` node and launches the ``xsarm_control`` script to bring up the arm.

Then, enable/disable the gravity compensation with the following service call:

.. code-block:: console

$ ros2 service call /aloha_wx250s/gravity_compensation_enable std_srvs/srv/SetBool 'data: [true/false]'

The arm will hold itself against gravity and can be moved freely when the gravity compensation is enabled.
It will lock in its current position when the gravity compensation is disabled.

.. warning::

The arm WILL torque off and drop for a short period of time while enabling/disabling.
Please make sure it is in a resting position or manually held.

.. warning::

The joints not supporting current control WILL torque off.
Please make sure to use an arm with at least the first three joints supporting current control, e.g., RX, WX, VX series.

This is the bare minimum needed to get up and running. Take a look at the table below to see how to further customize with other launch file arguments.

.. csv-table::
:file: ../_data/gravity_compensation.csv
:header-rows: 1
:widths: 20, 60, 20, 20
5 changes: 5 additions & 0 deletions docs/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ your own issue`_.
20.04, ROS 2 Galactic on Ubuntu 20.04, and ROS 2 Humble, not on any other operating system (ex.
Mac, Windows), or in a virtual machine.

.. important::

This guide assumes that the latest version of the software packages is used.
Before proceeding, please check that they are up to date.

.. _`interbotix_ros_manipulators bug tracker`: https://github.com/Interbotix/interbotix_ros_manipulators/issues?q=is%3Aissue
.. _`open your own issue`: https://github.com/Interbotix/interbotix_ros_manipulators/issues/new/choose

Expand Down