Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahiminfinite committed Aug 8, 2023
1 parent 83af6b2 commit 8ad26e9
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions doc/examples/realtime_servo/realtime_servo_tutorial.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Realtime Servo
============
===============

MoveIt Servo facilitates realtime control of your robot arm.

Expand All @@ -18,9 +18,9 @@ If you haven't already done so, make sure you've completed the steps in :doc:`Ge


Design overview
--------------
---------------

Moveit Servo consists of two main parts, the core implementation `Servo` which provides a C++ interface, and the `ServoNode` which
Moveit Servo consists of two main parts, the core implementation ``Servo`` which provides a C++ interface, and the ``ServoNode`` which
wraps the C++ interface and provides a ROS interface.

The configuration of Servo is done through ROS parameters specified in `servo_parameters.yaml <https://github.com/ros-planning/moveit2/blob/main/moveit_ros/moveit_servo/config/servo_parameters.yaml>`_
Expand All @@ -30,16 +30,16 @@ In addition to the servoing capability, MoveIt Servo has some convenient feature
- Checking for singularities
- Checking for collisions

The collision checking is an optional feature that can be disabled using the `check_collisions` parameter.
The collision checking is an optional feature that can be disabled using the ``check_collisions`` parameter.

Using the C++ API
------------------
The C++ interface allows the user to create and utilize an instance of Servo within their C++ programs.
This can be beneficial when there is a performance requirement to avoid the overhead of ROS communication infrastucture,
or when the output generated by Servo needs to be fed into some other controller that does not have a ROS interface.

When using Servo with the C++ interface the three input command types are `JointJogCommand`, `TwistCommand` and `PoseCommand`.
The output from Servo when using the C++ interface is `KinematicState`, a struct containing joint names, positions, velocities and accelerations.
When using Servo with the C++ interface the three input command types are ``JointJogCommand``, ``TwistCommand`` and ``PoseCommand``.
The output from Servo when using the C++ interface is ``KinematicState``, a struct containing joint names, positions, velocities and accelerations.
As given by the definitions in `datatypes <https://github.com/ros-planning/moveit2/blob/main/moveit_ros/moveit_servo/include/moveit_servo/utils/datatypes.hpp>`_ header file.

The first step is to create a Servo instance.
Expand Down Expand Up @@ -127,7 +127,7 @@ Using the PoseCommand
// This is generally run in a loop.
KinematicState next_joint_state = servo.getNextJointState(command);

The `next_joint_state` result can then be used for further steps in the control pipeline.
The ``next_joint_state`` result can then be used for further steps in the control pipeline.

The status of Servo resulting from the last command can be obtained by:

Expand All @@ -137,31 +137,31 @@ The status of Servo resulting from the last command can be obtained by:

The satus can be used as input for various decisions.

See `here <https://github.com/ros-planning/moveit2/tree/main/moveit_ros/moveit_servo/demos/cpp_interface>`_ for complete examples of using the C++ interface.
The demos can be launched using the launch files found `here <https://github.com/ros-planning/moveit2/tree/main/moveit_ros/moveit_servo/launch>`_.
See `moveit_servo/demos <https://github.com/ros-planning/moveit2/tree/main/moveit_ros/moveit_servo/demos/cpp_interface>`_ for complete examples of using the C++ interface.
The demos can be launched using the launch files found in `moveit_servo/launch <https://github.com/ros-planning/moveit2/tree/main/moveit_ros/moveit_servo/launch>`_.

- `ros2 launch moveit_servo demo_joint_jog.launch.py``
- `ros2 launch moveit_servo demo_twist.launch.py`
- `ros2 launch moveit_servo demo_pose.launch.py`
- ``ros2 launch moveit_servo demo_joint_jog.launch.py``
- ``ros2 launch moveit_servo demo_twist.launch.py``
- ``ros2 launch moveit_servo demo_pose.launch.py``


Using the ROS API
-----------------

To use Servo through the ROS interface, it must be launched as a **Node** or **Component** along with the required parameters as seen `here <https://github.com/ros-planning/moveit2/blob/main/moveit_ros/moveit_servo/launch/demo_ros_api.launch.py>`_.
To use Servo through the ROS interface, it must be launched as a ``Node`` or ``Component`` along with the required parameters as seen `here <https://github.com/ros-planning/moveit2/blob/main/moveit_ros/moveit_servo/launch/demo_ros_api.launch.py>`_.

When using Servo with the ROS interface the commands are ROS messages of the following types published to respective topics specified by the Servo parameters.

1. `control_msgs::msg::JointJog` on the topic specified by *joint_command_in_topic* parameter.
2. `geometry_msgs::msg::TwistStamped` on the topic specified by *cartesian_command_in_topic* parameter.
3. `geometry_msgs::msg::PoseStamped` on the topic specified by *pose_command_in_topic* parameter.
1. ``control_msgs::msg::JointJog`` on the topic specified by ``joint_command_in_topic`` parameter.
2. ``geometry_msgs::msg::TwistStamped`` on the topic specified by ``cartesian_command_in_topic`` parameter.
3. ``geometry_msgs::msg::PoseStamped`` on the topic specified by ``pose_command_in_topic`` parameter.

The output from Servo can either be `trajectory_msgs::msg::JointTrajectory`` or `std_msgs::msg::Float64MultiArray`
The output from Servo can either be ``trajectory_msgs::msg::JointTrajectory`` or ``std_msgs::msg::Float64MultiArray``
selected using the *command_out_type* parameter, and published on the topic specified by *command_out_topic* parameter.

The command type for Servo can be selected using the `ServoCommandType` service, see definition `here <https://github.com/ros-planning/moveit_msgs/blob/ros2/srv/ServoCommandType.srv>`_.
The command type for Servo can be selected using the ``ServoCommandType`` service, see definition `ServoCommandType <https://github.com/ros-planning/moveit_msgs/blob/ros2/srv/ServoCommandType.srv>`_.

From cli : `ros2 service call /servo_node/switch_command_type moveit_msgs/srv/ServoCommandType "{command_type: 1}"`
From cli : ``ros2 service call /servo_node/switch_command_type moveit_msgs/srv/ServoCommandType "{command_type: 1}"``

Programmatically:

Expand All @@ -183,14 +183,14 @@ Programmatically:
}
}

Similarly, Servo can be paused using the pause service of type `std_msgs::srv::SetBool`.
Similarly, Servo can be paused using the pause service of type ``std_msgs::srv::SetBool``.

When using the ROS interface, the status of Servo is available on the topic `/servo_node/status`, see definition `here <https://github.com/ros-planning/moveit_msgs/blob/ros2/msg/ServoStatus.msg>`_.
When using the ROS interface, the status of Servo is available on the topic ``/servo_node/status``, see definition `ServoStatus <https://github.com/ros-planning/moveit_msgs/blob/ros2/msg/ServoStatus.msg>`_.

Launch ROS interface demo: `ros2 launch moveit_servo demo_ros_api.launch.py`.
Launch ROS interface demo: ``ros2 launch moveit_servo demo_ros_api.launch.py``.

Once the demo is running, the robot can be teleoperated through the keyboard.

Launch the keyboard demo: `ros2 run moveit_servo servo_keyboard_input`.
Launch the keyboard demo: ``ros2 run moveit_servo servo_keyboard_input``.

An example of using the pose commands in the context of servoing to open a door can be seen `here <https://github.com/ros-planning/moveit2_tutorials/blob/main/doc/examples/realtime_servo/src/pose_tracking_tutorial.cpp>`_.
An example of using the pose commands in the context of servoing to open a door can be seen in this `example <https://github.com/ros-planning/moveit2_tutorials/blob/main/doc/examples/realtime_servo/src/pose_tracking_tutorial.cpp>`_.

0 comments on commit 8ad26e9

Please sign in to comment.