RoArm-M3 Control Robotic Arm with Keyboard

From Waveshare Wiki
Jump to: navigation, search
RoArm-M3
RoArm-M3

RoArm-M3-S Robotic Arm
TTL Serial Bus Servo Control Interface / I2C / UART
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

{{{name6}}}

5. Control Robotic Arm with Keyboard

This section describes how to use keyboard keys to control the robotic arm.

If you followed the previous tutorial, before starting the robotic arm control node, you need to first close the Moveit2 drag-and-drop interaction demo in the previous chapter. In the terminal window where the Moveit2 drag interaction example is running, press Ctrl+C to stop this process. The operation terminal of the robotic arm drive node does not need to be manually closed, otherwise, control of the real robotic arm will be impossible.

If you have also ended the terminal process of the robotic arm drive node, you need to run it again according to the content in 3. Drive Node to Control Real-world Robotic Arm. Keep the drive node of the robotic arm running, and then run the robotic arm to control the relevant node.

  • In the terminal interface where the Moveit2 drag-and-drop interaction demo is closed, enter the following command to open the relevant node of the robotic arm control, which will open a new Rviz2 robotic arm model interface:
ros2 launch roarm_moveit_servo servo_control.launch.py
  • It can also be run on the new terminal interface, and when running on the new terminal interface, you must first enter the workspace of the robotic arm ROS2, and then open the relevant node controlled by the robotic arm, as follows:
cd /home/ws/roarm_ws/
ros2 launch roarm_moveit_servo servo_control.launch.py


5.1 Control Robotic Arm with Keyboard

Press Ctrl+Alt+T to open a new terminal window and enter the container, enter the workspace of the ROS2 robotic arm, and run the following command to get the control commands from the keyboard:

cd /home/ws/roarm_ws/
ros2 run roarm_moveit_servo keyboardcontrol

Keep this terminal window active (that is, make sure you are in the terminal window interface when operating the keys), and control the robotic arm through the following keys:

  • Coordinate control
    • Arrow key : X-axis positive direction movement;
    • Arrow key : X-axis negative direction movement;
    • Arrow key : Y-axis positive direction movement;
    • Arrow key : Y-axis negative direction movement;
    • ; key: Z-axis positive direction;
    • . key: Z-axis negative direction;
  • Joint control
    • Number 1 key: base joint movement;
    • Number 2 key: shoulder joint movement;
    • Number 3 key: elbow joint movement;
    • Number 4 key: wrist joint movement;
    • Number 5 key: rolling joint movement;
    • Letter G key: gripper movement;
    • Letter R key: switches the direction of movement controlled by the above joints.

Finally, press the letter Q key to exit the operation.

1200px-M3键盘控制.png