Welcome to ROSMASTER M3 PRO repository
2. Robot CLI Command Tool
Robot CLI Command Tool
Robot CLI Command Tool1. Course ContentCourse OverviewLearning Objectives2. Preparation3. Introduction to CLI Tools3.1 What is a Robot CLI Control Tool?3.2 Why are CLI command tools needed?4. Communication Architecture for CLI-Controlled Robots5. Launching the MCP Service6. Controlling the Robot via CLI6.1 CLI Command Overview6.2 Command Format6.3 Examples7. Source Code Analysis7.1 MCP Service7.2 CLI Source Code
1. Course Content
Course Overview
- This section explains the use of the robot CLI (Command Line Interface) command tool. Through the command line interface, users can directly control various functions of the robot, such as chassis movement, robotic arm manipulation, visual recognition, navigation and positioning, and waste sorting.
- The CLI command tool encapsulates all MCP Tool interfaces, allowing for quick robot control without relying on AI models, facilitating functional testing and debugging.
- Compared to indirectly controlling robots through AI platforms such as OpenClaw, the CLI command tool provides a more direct and efficient interaction method, suitable for developers to perform functional verification, interface testing, and secondary development.
Learning Objectives
- Understand the functional positioning and application scenarios of robot CLI command tools.
- Be familiar with the functions, parameters, and usage formats of CLI commands.
2. Preparation
- Start the MicroROS chassis agent (if already started, no need to start again)
sh start_agent.sh- Start nodes such as odometry, tf, robotic arm assistance, and camera nodes.
xxxxxxxxxxros2 launch m3pro_bringup car_base.launch.py3. Introduction to CLI Tools
3.1 What is a Robot CLI Control Tool?
A robot CLI (Command Line Interface) control tool is a command-line-based robot control interface that uses the robot_control command to call various robot control tools registered with the MCP server. It encapsulates the robot's low-level control interface, transforming complex ROS2 communication into concise command-line instructions. Users can control the robot to perform various actions simply by entering commands in the terminal.

3.2 Why are CLI command tools needed?
- Direct Remote SSH Control: By remotely logging into the robot's terminal via SSH, users can directly execute CLI commands to control the robot.
- AI-Independent Direct Control: Bypassing AI platforms such as OpenClaw, users can rapidly manipulate the robot directly through the command-line interface, thereby reducing system dependencies and latency.
- Independent Function Testing: Specific functions can be invoked individually for testing purposes; this avoids the "black box" nature of AI-driven operations, making it easier to pinpoint and troubleshoot issues.
- Rapid Interface Verification: The CLI allows for the rapid iteration and testing of all robot control interfaces—verifying both functional completeness and parameter ranges—to ensure that every module is operating correctly.
- Native AI-to-CLI Compatibility: AI models are inherently compatible with command-line interfaces; this enables AI to directly generate and execute CLI commands to control the robot, facilitating highly efficient collaboration between AI and the CLI.
4. Communication Architecture for CLI-Controlled Robots
xxxxxxxxxx┌─────────────┐│ CLI Tool │└──────┬──────┘│ MCP Protocol▼┌─────────────┐│ MCP Server │└──────┬──────┘│▼┌──────────────────────────┐│ ROS2 Communication Stack ││ Topics/Services/Actions │└──────┬───────────────────┘│▼┌───────────────────────┐│ Hardware Driver Layer │└──────┬────────────────┘│▼┌────────────────┐│ Robot Hardware │└────────────────┘
5. Launching the MCP Service
- Launch via Terminal
xxxxxxxxxxros2 launch m3pro_bringup mcp_service.launch.py
6. Controlling the Robot via CLI
6.1 CLI Command Overview
- This section provides a summarized overview of the CLI commands. For complete documentation on CLI usage, please refer to the "CLI Command Summary" document located in the tutorial folder for this section.
| Command | Parameters | Function |
|---|---|---|
| MoveWithSpeed | --linear-x, --linear-y, --angular-z, --duration | Control the robot's omnidirectional base movement via velocity commands |
| Move | --distance, --direction | Control the robot's base to move a specified distance |
| GetCurrentArmJointAngles | None | Retrieve the current angles of each robotic arm joint |
| GetEndEffectorPose | None | Retrieve the pose (position and orientation) of the end-effector (including gripper and camera) |
| ControlSixArmJoint | --arm-joint-1
|