Welcome to MicroROS-Pi5 repository
当製品の日本語版マニュアル資料は、こちらからご取得ください。
2. Robot keyboard control
Robot keyboard control
Note: The Raspberry Pi needs to be in the same LAN as the car, and the ROS_DOMAIN_ID needs to be the same. You can check the [microROS control board parameter configuration] to set the IP and ROS_DOMAIN_ID on the board.
1. Program function description
After the program is started, the car movement can be controlled through the keyboard.
2. Start and connect to the agent
After successfully starting the Raspberry Pi, enter the following command to start the agent,
sh ~/start_agent_rpi5.sh

Then, turn on the car switch and wait for the car to connect to the agent. The connection is successful, as shown in the figure below.

3. Enter the car docker
Open another terminal and enter the following command to enter docker.
xxxxxxxxxxsh ros2_humble.sh
When the following interface appears, you have successfully entered docker. Now you can control the car through commands.

Enter the following command in the terminal to query the agent node.
xxxxxxxxxxros2 node list

4. Start the keyboard control program
Enter the following command in the terminal to start the keyboard control program.
xxxxxxxxxxros2 run yahboomcar_ctrl yahboom_keyboard

The keyboard key descriptions are as follows.
Directional control
| keyboard keys | Function Description | keyboard keys | Function Description |
|---|---|---|---|
| 【i】or【I】 | 【linear,0】 | 【u】or【U】 | 【linear,angular】 |
| 【,】 | 【-linear,0】 | 【o】or【O】 | 【linear,-angular】 |
| 【j】or【J】 | 【0,linear】 | 【m】or【M】 | 【-linear,-angular】 |
| 【l】or【L】 | 【0,-linear】 | 【.】 | 【-linear,angular】 |
That is to say, press the [i] key to move forward, press the [,] key to move backward, press the [l] key to rotate to the right, and press the [j] key to rotate to the left. And so on.
speed control
| keyboard keys | Function Description | keyboard keys | Function Description |
|---|---|---|---|
| 【q】 | Linear speed and angular speed increased by 10% | 【z】 | Linear speed and angular speed are reduced by 10% |
| 【w】 | Linear speed increased by 10% | 【x】 | Line speed reduced by 10% |
| 【e】 | Angular speed increased by 10% | 【c】 | Angular speed reduced by 10% |
| 【t】 | Linear speed X-axis and Y-axis direction switching | 【s】 | Stop keyboard control |
Note: Since the car has a four-wheel drive structure with ordinary tires and cannot move sideways, the [t] button has no meaning. Before each use of keyboard control, you need to click on the terminal that starts the program, otherwise the key event cannot be detected.