Control of the robotic arm

1 Slider Control

Click the ROS2 Shell icon on the desktop or the corresponding icon in the lower bar of the desktop to open the ROS1 environment terminal:

Then run the command:

ros2 launch mercury_a1 slider_control.launch.py

It will open rviz and a slider component and you will see something like this:

Then you can control the movement of the model in rviz2 by dragging the slider . The real Mercury A1 will move with it.

Please note: Since the robot arm will move to the current position of the model when the command is input, please make sure that the model in rviz2 does not appear to be worn out before you use the command Do not quickly drag the slider after connecting the robotic arm to prevent damage to the robotic arm

2 Model Follow

In addition to the above controls, we can also make the model follow the movement of the real robotic arm .

Click the ROS2 Shell icon on the desktop or the corresponding icon in the lower column of the desktop to open the ROS2 environment terminal:

Then run the command:

ros2 launch mercury_a1 mercury_follow.launch.py

It will open rviz to show the model following effect .

3 GUI Control

On the basis of the previous, this package also provides a simple GUI control interface . This method means that the real robotic arms are linked with each other, please connect to mycobot.

Click the ROS2 Shell icon on the desktop or the corresponding icon in the lower column of the desktop to open the ROS2 environment terminal:

Then run the command:

ros2 launch mercury_a1 simple_gui.launch.py

Next, open another ROS2 environment terminal:

Then run the command:

ros2 run mercury_a1 simple_gui

4 Keyboard Control

The function of keyboard control is added in the package of mercury_a1, and it is synchronized in real time in rviz. This function relies on pythonApi, so make sure to connect with the real robotic arm.

Click the ROS2 Shell icon on the desktop or the corresponding icon in the lower column of the desktop to open the ROS2 environment terminal:

Then run the command:

ros2 launch mercury_a1 teleop_keyboard.launch.py

The operation effect is as follows:

The command line will output Mercury A1 information, as follows:

[INFO] [launch]: All log files can be found below /home/er/.ros/log/2023-09-05-10-43-12-301971-u20-VirtualBox-6290
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [6293]
[INFO] [rviz2-2]: process started with pid [6295]
[INFO] [follow_display-3]: process started with pid [6297]
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link link1 had 1 children
[robot_state_publisher-1] Link link2 had 1 children
[robot_state_publisher-1] Link link3 had 1 children
[robot_state_publisher-1] Link link4 had 1 children
[robot_state_publisher-1] Link link5 had 1 children
[robot_state_publisher-1] Link link6 had 1 children
[robot_state_publisher-1] Link link7 had 0 children
[robot_state_publisher-1] [INFO] [1659667392.703132973] [robot_state_publisher]: got segment base
[robot_state_publisher-1] [INFO] [1659667392.703485410] [robot_state_publisher]: got segment link1
[robot_state_publisher-1] [INFO] [1659667392.703545198] [robot_state_publisher]: got segment link2
[robot_state_publisher-1] [INFO] [1659667392.703571119] [robot_state_publisher]: got segment link3
[robot_state_publisher-1] [INFO] [1659667392.703587512] [robot_state_publisher]: got segment link4
[robot_state_publisher-1] [INFO] [1659667392.703603744] [robot_state_publisher]: got segment link5
[robot_state_publisher-1] [INFO] [1659667392.703619685] [robot_state_publisher]: got segment link6
[robot_state_publisher-1] [INFO] [1659667392.703619685] [robot_state_publisher]: got segment link7
[rviz2-2] [INFO] [1659667393.588026632] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-2] [INFO] [1659667393.588472253] [rviz2]: OpenGl version: 3.1 (GLSL 1.4)
[rviz2-2] [INFO] [1659667393.766777360] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-2] Parsing robot urdf xml string.
[follow_display-3] [INFO] [1659667394.310152595] [follow_display]: port:/dev/ttyAMA1, baud:115200

Next, open another ROS2 environment terminal:

Then run the command:

ros2 run mercury_a1 teleop_keyboard

You will see the following output on the command line:

Mercury Teleop Keyboard Controller
---------------------------
Movimg options(control coordinations [x,y,z,rx,ry,rz]):
              w(x+)

    a(y-)     s(x-)     d(y+)

    z(z-) x(z+)

u(rx+)   i(ry+)   o(rz+)
j(rx-)   k(ry-)   l(rz-)

Gripper control:
    g - open
    h - close

Other:
    1 - Go to init pose
    2 - Go to home pose
    3 - Resave home pose
    q - Quit

currently:    speed: 60    change percent: 10

In this terminal, you can control the state of the robot arm and move the robot arm through the keys in the command line.

Note: The coordinate control operation can only be performed after the 2 command is executed.


← Previous Page | Next Section →

results matching ""

    No results matching ""